diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java index 9864888cf5..6e2e440f38 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java @@ -14,6 +14,7 @@ import org.joda.time.LocalDate; import org.joda.time.format.DateTimeFormat; import org.joda.time.format.DateTimeFormatter; +import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.*; @@ -347,4 +348,18 @@ public class DateUtils { System.out.println(666); } + + /** + * 获取日期前一天 + * @author zhaoqifeng + * @date 2020/6/22 11:08 + * @param date + * @return java.util.Date + */ + public static Date getBeforeDay(Date date) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + calendar.add(Calendar.DATE, -1); + return calendar.getTime(); + } } diff --git a/epmet-gateway/pom.xml b/epmet-gateway/pom.xml index 5d56b23a15..354c47f3ea 100644 --- a/epmet-gateway/pom.xml +++ b/epmet-gateway/pom.xml @@ -175,8 +175,12 @@ lb://resi-voice-server + lb://data-report-server + + lb://data-statistical-server + @@ -255,6 +259,8 @@ lb://resi-voice-server lb://data-report-server + + lb://data-statistical-server diff --git a/epmet-gateway/src/main/resources/bootstrap.yml b/epmet-gateway/src/main/resources/bootstrap.yml index f8a8c8f75b..f67bd8fdec 100644 --- a/epmet-gateway/src/main/resources/bootstrap.yml +++ b/epmet-gateway/src/main/resources/bootstrap.yml @@ -268,6 +268,15 @@ spring: filters: - StripPrefix=1 - CpAuth=true + #统计服务 + - id: data-statistical-server + uri: @gateway.routes.data-statistical-server.uri@ + order: 29 + predicates: + - Path=${server.servlet.context-path}/data/stats/** + filters: + - StripPrefix=1 + - CpAuth=true nacos: discovery: server-addr: @nacos.server-addr@ diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/constant/IssueConstant.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/constant/IssueConstant.java new file mode 100644 index 0000000000..88d4f44c78 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/constant/IssueConstant.java @@ -0,0 +1,14 @@ +package com.epmet.issue.constant; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/22 14:07 + */ +public interface IssueConstant { + String MONTH = "month"; + String DATE = "date"; + String VOTING_NAME = "表决中"; + String SHIFT_NAME = "已转项目"; + String CLOSED_NAME = "已关闭"; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/form/IssueIncrtrendFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/form/IssueIncrtrendFormDTO.java new file mode 100644 index 0000000000..b4577b2811 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/form/IssueIncrtrendFormDTO.java @@ -0,0 +1,19 @@ +package com.epmet.issue.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/22 16:32 + */ +@Data +public class IssueIncrtrendFormDTO implements Serializable { + private static final long serialVersionUID = 4408419854627376175L; + /** + * 类型,按日date 按月month + */ + private String type; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueDataDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueDataDTO.java new file mode 100644 index 0000000000..961727e31c --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueDataDTO.java @@ -0,0 +1,206 @@ +package com.epmet.issue.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/22 14:11 + */ +@Data +public class IssueDataDTO implements Serializable { + + private static final long serialVersionUID = 9136989870868730175L; + /** + * 组织ID + */ + private String agencyId; + + /** + * 组织名 + */ + private String agencyName; + + /** + * 网格ID + */ + private String gridId; + + /** + * 网格名 + */ + private String gridName; + + /** + * 年度ID + */ + private String yearId; + + /** + * 年度名 + */ + private String yearName; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 季度名 + */ + private String quarterName; + + /** + * 月度ID + */ + private String monthId; + + /** + * 月度名 + */ + private String monthName; + + /** + * 周ID + */ + private String weekId; + + /** + * 日期ID + */ + private String dateId; + + /** + * 日期名 + */ + private String dateName; + + /** + * 当日议题增量 + */ + 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; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueIncrtrendResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueIncrtrendResultDTO.java new file mode 100644 index 0000000000..d63d332a9b --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueIncrtrendResultDTO.java @@ -0,0 +1,30 @@ +package com.epmet.issue.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/22 16:30 + */ +@NoArgsConstructor +@Data +public class IssueIncrtrendResultDTO implements Serializable { + + private static final long serialVersionUID = 7762529188251385355L; + /** + * 日期 + */ + private String date; + /** + * 状态(表决中,已转项目,已关闭) + */ + private String type; + /** + * 数量 + */ + private Integer value; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueSubAgencyResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueSubAgencyResultDTO.java new file mode 100644 index 0000000000..c401d5ecc4 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueSubAgencyResultDTO.java @@ -0,0 +1,34 @@ +package com.epmet.issue.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/22 16:24 + */ +@NoArgsConstructor +@Data +public class IssueSubAgencyResultDTO implements Serializable { + + private static final long serialVersionUID = 2640337888693960513L; + /** + * 组织ID + */ + private String agencyId; + /** + * 组织名 + */ + private String name; + /** + * 类型 表决中,已转项目,已关闭 + */ + private String type; + /** + * 数量 + */ + private Integer value; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueSubGridResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueSubGridResultDTO.java new file mode 100644 index 0000000000..3313f0a8e7 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueSubGridResultDTO.java @@ -0,0 +1,27 @@ +package com.epmet.issue.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/22 16:27 + */ +@Data +public class IssueSubGridResultDTO implements Serializable { + private static final long serialVersionUID = -3318384216762207856L; + /** + * 网格名 + */ + private String name; + /** + * 类型 表决中,已转项目,已关闭 + */ + private String type; + /** + * 数量 + */ + private Integer value; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueSummaryInfoResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueSummaryInfoResultDTO.java new file mode 100644 index 0000000000..c53707c0a1 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueSummaryInfoResultDTO.java @@ -0,0 +1,54 @@ +package com.epmet.issue.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/22 16:17 + */ +@NoArgsConstructor +@Data +public class IssueSummaryInfoResultDTO implements Serializable { + + private static final long serialVersionUID = -7959140755148294338L; + /** + * 机关ID + */ + private String agencyId; + /** + * 议题总数 + */ + private Integer issueTotal; + /** + * 表决中数量 + */ + private Integer votingTotal; + /** + * 已转项目数量 + */ + private Integer shiftProjectTotal; + /** + * 已关闭数量 + */ + private Integer closedTotal; + /** + * 表决中占比 + */ + private String votingRatio; + /** + * 已转项目占比 + */ + private String shiftProjectRatio; + /** + * 已关闭占比 + */ + private String closedRatio; + /** + * 更新至日期 + */ + private String dateName; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueSummaryPieResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueSummaryPieResultDTO.java new file mode 100644 index 0000000000..f6940edeeb --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueSummaryPieResultDTO.java @@ -0,0 +1,30 @@ +package com.epmet.issue.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/22 16:21 + */ +@NoArgsConstructor +@Data +public class IssueSummaryPieResultDTO implements Serializable { + + private static final long serialVersionUID = -971115426789868580L; + /** + * 名称 表决中,已转项目,已关闭 + */ + private String name; + /** + * 值 + */ + private Integer value; + /** + * 百分比 + */ + private String ratio; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/.gitignore b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/.gitignore deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/constant/ProjectConstant.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/constant/ProjectConstant.java new file mode 100644 index 0000000000..7a50f4afb0 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/constant/ProjectConstant.java @@ -0,0 +1,17 @@ +package com.epmet.project.constant; + +/** + * @Author sun + * @Description 数据-项目 + **/ +public interface ProjectConstant { + + String DATE = "date"; + String MONTH = "month"; + + /** + * 根据Token获取组织信息失败 + */ + String GET_AGENCYID = "根据Token获取组织信息失败"; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/FactAgencyProjectDailyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/FactAgencyProjectDailyDTO.java new file mode 100644 index 0000000000..ab608a0184 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/FactAgencyProjectDailyDTO.java @@ -0,0 +1,182 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.project.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 机关下日项目数据统计 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据,每日定时执行,先删后增 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Data +public class FactAgencyProjectDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id 【dim_customer.id】 + */ + private String customerId; + + /** + * 机关Id 【dim_agency.id】 + */ + private String agencyId; + + /** + * 上级组织Id【dim_agency.pid】 + */ + private String parentId; + + /** + * 日维度Id 【dim_date.id】 + */ + private String dateId; + + /** + * 周维度Id 【dim_week.id】 + */ + private String weekId; + + /** + * 月维度Id 【dim_month.id】 + */ + private String monthId; + + /** + * 季ID + */ + private String quarterId; + + /** + * 年维度Id 【dim_year.id】 + */ + private String yearId; + + /** + * 截止当日项目总数 【当前组织及下级项目总数】 + */ + private Integer projectTotal; + + /** + * 截止当日处理中项目数 【当前组织及下级所有未结案项目总数】 + */ + private Integer pendingTotal; + + /** + * 截止当日处理中项目占比 【当前组织及下级未结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal pendingRatio; + + /** + * 截止当日已结案项目数 【当前组织及下级已结案项目总数】 + */ + private Integer closedTotal; + + /** + * 截止当日已结案项目占比 【当前组织及下级已结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal closedRatio; + + /** + * 截止当日已结案中已解决项目数 【当前组织及下级已结案项目中已解决总数】 + */ + private Integer resolvedTotal; + + /** + * 截止当日已结案中已解决项目占比 【当前组织及下级已结案项目中已解决占比】 + */ + private BigDecimal resolvedRatio; + + /** + * 截止当日已结案中未解决项目数 【当前组织及下级已结案项目中未解决总数】 + */ + private Integer unresolvedTotal; + + /** + * 截止当日已结案中未解决项目占比 【当前组织及下级已结案项目中未解决占比】 + */ + private BigDecimal unresolvedRatio; + + /** + * 当日项目总数 【当前组织及下级项目总数】 + */ + private Integer projectIncr; + + /** + * 当日处理中项目数 【当前组织及下级前一日新增处理中项目数】 + */ + private Integer pendingIncr; + + /** + * 当日已结案项目数 【当前组织及下级前一日新增结案项目数】 + */ + private Integer closedIncr; + + /** + * 当日已结案项目中已解决数 【当前组织及下级前一日新增结案中已解决项目数】 + */ + private Integer resolvedIncr; + + /** + * 当日已结案项目组未解决数 【当前组织及下级前一日新增结案中未解决项目数】 + */ + private Integer unresolvedIncr; + + /** + * 删除标识 【0.未删除 1.已删除】 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/form/ProjectIncrTrendFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/form/ProjectIncrTrendFormDTO.java new file mode 100644 index 0000000000..a7364cfac9 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/form/ProjectIncrTrendFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.project.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author sun + * @Description 数据-项目-日/月数据查询-接口入参 + */ +@Data +public class ProjectIncrTrendFormDTO implements Serializable { + + private static final long serialVersionUID = -4929038359220814068L; + + public interface ProjectIncr { + } + + /** + * 类型 month:代表月 date:代表日 + */ + @NotBlank(message = "month / date 类型不能为空", groups = {ProjectIncr.class}) + private String type; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectIncrTrendResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectIncrTrendResultDTO.java new file mode 100644 index 0000000000..b53b2a9f14 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectIncrTrendResultDTO.java @@ -0,0 +1,31 @@ +package com.epmet.project.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author sun + * @Description 数据-项目-获取组织下饼图数据-接口返参 + **/ +@Data +public class ProjectIncrTrendResultDTO implements Serializable { + + private static final long serialVersionUID = 8529179932504931368L; + + /** + * 日期(2020/1/1;2020/1/2...) + */ + private String date; + + /** + * 类型对应数量 + */ + private Integer value; + + /** + * 类型名称(处理中;已结案) + */ + private String type; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSubAgencyResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSubAgencyResultDTO.java new file mode 100644 index 0000000000..31d25fe6bb --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSubAgencyResultDTO.java @@ -0,0 +1,36 @@ +package com.epmet.project.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author sun + * @Description 数据-项目-获取组织下饼图数据-接口返参 + **/ +@Data +public class ProjectSubAgencyResultDTO implements Serializable { + + private static final long serialVersionUID = 8529179932504931368L; + + /** + * 机关Id + */ + private String agencyId; + + /** + * 机关名称 + */ + private String name; + + /** + * 不同类型对应数据 + */ + private Integer value; + + /** + * 类型名称(处理中;已结案) + */ + private String type; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSubGridResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSubGridResultDTO.java new file mode 100644 index 0000000000..19f1632be0 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSubGridResultDTO.java @@ -0,0 +1,36 @@ +package com.epmet.project.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author sun + * @Description 数据-项目-获取组织下饼图数据-接口返参 + **/ +@Data +public class ProjectSubGridResultDTO implements Serializable { + + private static final long serialVersionUID = 8529179932504931368L; + + /** + * 机关Id + */ + private String agencyId; + + /** + * 机关名称 + */ + private String name; + + /** + * 不同类型对应数据 + */ + private Integer value; + + /** + * 类型名称(处理中;已结案) + */ + private String type; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSummaryInfoResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSummaryInfoResultDTO.java new file mode 100644 index 0000000000..e371fce1f5 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSummaryInfoResultDTO.java @@ -0,0 +1,31 @@ +package com.epmet.project.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author sun + * @Description 数据-项目-获取组织下饼图数据-接口返参 + **/ +@Data +public class ProjectSummaryInfoResultDTO implements Serializable { + + private static final long serialVersionUID = 8529179932504931368L; + + /** + * 类型名称(处理中;已结案) + */ + private String name; + + /** + * 类型对应数量 + */ + private Integer value; + + /** + * 类型对应百分比(10% 10.1% 10.01%小数点后两位) + */ + private String ratio; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSummaryResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSummaryResultDTO.java new file mode 100644 index 0000000000..0223644b78 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSummaryResultDTO.java @@ -0,0 +1,50 @@ +package com.epmet.project.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author sun + * @Description 数据-项目-汇总数据-接口返参 + **/ +@Data +public class ProjectSummaryResultDTO implements Serializable { + + private static final long serialVersionUID = 8529179932504931368L; + + /** + * 机关Id + */ + private String agencyId; + + /** + * 项目总数 + */ + private Integer projectTotal; + + /** + * 更新日期 + */ + private String dateName; + + /** + * 处理中总数 + */ + private Integer pendingTotal; + + /** + * 处理中占比 + */ + private String pendingRatio; + + /** + * 已结案总数 + */ + private Integer closedTotal; + + /** + * 已结案占比 + */ + private String closedRatio; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/form/TagFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/form/TagFormDTO.java new file mode 100644 index 0000000000..8b52307d91 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/form/TagFormDTO.java @@ -0,0 +1,29 @@ +package com.epmet.publicity.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author jyy + * @CreateTime 2020/6/22 12:07 + */ +@Data +public class TagFormDTO implements Serializable { + + private static final long serialVersionUID = 1788937450915240575L; + + public interface GroupJava {} + + /** + * 获取数据条数;默认为10 + */ + private Integer pageSize; + + /** + * 时间查询维度;日:date;月:month;季:quarter;年:year + */ + @NotBlank(message = "type不能为空", groups = {GroupJava.class}) + private String type; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactArticlePublishedAgencyDailyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactArticlePublishedAgencyDailyDTO.java new file mode 100644 index 0000000000..8aa0274eab --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactArticlePublishedAgencyDailyDTO.java @@ -0,0 +1,121 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.publicity.dto.result; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 文章发布数量【机关】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Data +public class FactArticlePublishedAgencyDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 文章累计发文数量 文章数量 + */ + private Integer articleTotalCount; + + /** + * 当前发文数量 当前未下线的文章数量 + */ + private Integer articlePublishedCount; + + /** + * 日期ID 日期ID + */ + private String dateId; + + /** + * 周ID 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + + /** + * 删除状态 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactArticlePublishedDepartmentDailyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactArticlePublishedDepartmentDailyDTO.java new file mode 100644 index 0000000000..63dcdf8194 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactArticlePublishedDepartmentDailyDTO.java @@ -0,0 +1,121 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.publicity.dto.result; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 文章发布数量【部门】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Data +public class FactArticlePublishedDepartmentDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 发布文章单位所属机关ID 发布文章单位所属机关ID + */ + private String agencyId; + + /** + * 部门ID + */ + private String departmentId; + + /** + * 文章累计发文数量 文章数量 + */ + private Integer articleTotalCount; + + /** + * 当前发文数量 当前未下线的文章数量 + */ + private Integer articlePublishedCount; + + /** + * 日期ID 日期ID + */ + private String dateId; + + /** + * 周ID 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + + /** + * 删除状态 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactArticlePublishedGridDailyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactArticlePublishedGridDailyDTO.java new file mode 100644 index 0000000000..ef9441018c --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactArticlePublishedGridDailyDTO.java @@ -0,0 +1,121 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.publicity.dto.result; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 文章发布数量【网格】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Data +public class FactArticlePublishedGridDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 发布单位所属机关ID 发布单位所属机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 文章累计发文数量 文章数量 + */ + private Integer articleTotalCount; + + /** + * 当前发文数量 当前未下线的文章数量 + */ + private Integer articlePublishedCount; + + /** + * 日期ID 日期ID + */ + private String dateId; + + /** + * 周ID 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + + /** + * 删除状态 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagAgencyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagAgencyDTO.java new file mode 100644 index 0000000000..766a95393a --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagAgencyDTO.java @@ -0,0 +1,63 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.publicity.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 文章引用标签阅读数量【机关】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Data +public class FactTagAgencyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 标签名称 标签名称 + */ + private String name; + + /** + * 使用改标签的数量 + */ + private Integer value; + + /** + * 固定值:文章数量 + */ + private String type="文章数量"; + + /** + * 机关Id + */ + private String agencyId; + + /** + * 标签Id + */ + private String tagId; + + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyDailyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyDailyDTO.java new file mode 100644 index 0000000000..f9bb58d4ed --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyDailyDTO.java @@ -0,0 +1,126 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.publicity.dto.result; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 文章引用标签阅读数量【机关】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Data +public class FactTagViewedAgencyDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 日期ID 天数ID eg:20200601 = 2020年6月1日、20200602 = 2020年6月2日 + */ + private String dateId; + + /** + * 周ID 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + + /** + * 删除状态 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyMonthlyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyMonthlyDTO.java new file mode 100644 index 0000000000..9e66642afb --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyMonthlyDTO.java @@ -0,0 +1,106 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.publicity.dto.result; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 文章引用标签阅读数量【机关】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Data +public class FactTagViewedAgencyMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 月份ID 月份ID eg:2020-06 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 删除状态 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyQuarterlyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyQuarterlyDTO.java new file mode 100644 index 0000000000..b5e845f6f8 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyQuarterlyDTO.java @@ -0,0 +1,106 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.publicity.dto.result; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 文章引用标签阅读数量【机关】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Data +public class FactTagViewedAgencyQuarterlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 删除状态 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyYearlyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyYearlyDTO.java new file mode 100644 index 0000000000..9f420f6b37 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyYearlyDTO.java @@ -0,0 +1,106 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.publicity.dto.result; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 文章引用标签阅读数量【机关】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Data +public class FactTagViewedAgencyYearlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + + /** + * 删除状态 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridDailyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridDailyDTO.java new file mode 100644 index 0000000000..d34da43745 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridDailyDTO.java @@ -0,0 +1,126 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.publicity.dto.result; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 文章引用标签阅读数量【网格】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Data +public class FactTagViewedGridDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 日期ID 天数ID eg:20200601 = 2020年6月1日、20200602 = 2020年6月2日 + */ + private String dateId; + + /** + * 周ID 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + + /** + * 删除状态 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridMonthlyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridMonthlyDTO.java new file mode 100644 index 0000000000..a1c6e3209d --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridMonthlyDTO.java @@ -0,0 +1,106 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.publicity.dto.result; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 文章引用标签阅读数量【网格】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Data +public class FactTagViewedGridMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 月份ID 月份ID eg:2020-06 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 删除状态 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridQuarterlyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridQuarterlyDTO.java new file mode 100644 index 0000000000..10b049d10f --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridQuarterlyDTO.java @@ -0,0 +1,106 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.publicity.dto.result; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 文章引用标签阅读数量【网格】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Data +public class FactTagViewedGridQuarterlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 删除状态 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridYearlyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridYearlyDTO.java new file mode 100644 index 0000000000..2864b508de --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridYearlyDTO.java @@ -0,0 +1,106 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.publicity.dto.result; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 文章引用标签阅读数量【网格】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Data +public class FactTagViewedGridYearlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + + /** + * 删除状态 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/pom.xml b/epmet-module/data-report/data-report-server/pom.xml index d6dd66a273..d0933af706 100644 --- a/epmet-module/data-report/data-report-server/pom.xml +++ b/epmet-module/data-report/data-report-server/pom.xml @@ -112,7 +112,7 @@ 123456 - false + true 122.152.200.70:8848 fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/aspect/RequestLogAspect.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/aspect/RequestLogAspect.java index 49581cf63c..7d4ff2d7d4 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/aspect/RequestLogAspect.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/aspect/RequestLogAspect.java @@ -21,7 +21,7 @@ import javax.servlet.http.HttpServletRequest; public class RequestLogAspect extends BaseRequestLogAspect { @Override - @Around(value = "execution(* com.epmet.controller.*Controller*.*(..)) ") + @Around(value = "execution(* com.epmet.controller.*.*Controller*.*(..)) ") public Object proceed(ProceedingJoinPoint point) throws Throwable { return super.proceed(point, getRequest()); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/controller/IssueController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/controller/IssueController.java new file mode 100644 index 0000000000..39b61b637a --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/controller/IssueController.java @@ -0,0 +1,95 @@ +package com.epmet.module.issue.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.issue.dto.form.IssueIncrtrendFormDTO; +import com.epmet.issue.dto.result.*; +import com.epmet.module.issue.service.IssueService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/22 13:47 + */ +@RestController +@RequestMapping("issue") +public class IssueController { + @Autowired + private IssueService issueService; + + /** + * 数据汇总 + * + * @param tokenDto + * @return com.epmet.commons.tools.utils.Result + * @author zhaoqifeng + * @date 2020/6/22 17:31 + */ + @PostMapping("summaryinfo") + public Result getSummaryInfo(@LoginUser TokenDto tokenDto) { + return new Result().ok(issueService.getSummaryInfo(tokenDto)); + } + + /** + * 数据汇总饼状图 + * + * @param tokenDto + * @return com.epmet.commons.tools.utils.Result> + * @author zhaoqifeng + * @date 2020/6/22 17:31 + */ + @PostMapping("summarypie") + public Result> getSummaryPie(@LoginUser TokenDto tokenDto) { + return new Result>().ok(issueService.getSummaryPie(tokenDto)); + } + + /** + * 下级机关议题统计 + * + * @param tokenDto + * @return com.epmet.commons.tools.utils.Result> + * @author zhaoqifeng + * @date 2020/6/22 17:31 + */ + @PostMapping("subagency") + public Result> getSubAgency(@LoginUser TokenDto tokenDto) { + return new Result>().ok(issueService.getSubAgency(tokenDto)); + } + + /** + * 网格议题统计 + * + * @param tokenDto + * @return com.epmet.commons.tools.utils.Result> + * @author zhaoqifeng + * @date 2020/6/22 17:31 + */ + @PostMapping("subgrid") + public Result> getSubGrid(@LoginUser TokenDto tokenDto) { + return new Result>().ok(issueService.getSubGrid(tokenDto)); + } + + /** + * 议题分析 + * + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + * @author zhaoqifeng + * @date 2020/6/22 17:31 + */ + @PostMapping("incrtrend") + public Result> getIncrtrend(@LoginUser TokenDto tokenDto, @RequestBody IssueIncrtrendFormDTO formDTO) { + return new Result>().ok(issueService.getIncrtrend(tokenDto, formDTO)); + } + + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/dao/IssueDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/dao/IssueDao.java new file mode 100644 index 0000000000..bd530dd616 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/dao/IssueDao.java @@ -0,0 +1,60 @@ +package com.epmet.module.issue.dao; + +import com.epmet.issue.dto.result.IssueDataDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/22 13:48 + */ +@Mapper +public interface IssueDao { + /** + * 获取当前机关统计信息 + * @author zhaoqifeng + * @date 2020/6/22 15:19 + * @param agencyId + * @return com.epmet.issue.dto.result.IssueDataDTO + */ + IssueDataDTO selectAgencyInfo(@Param("agencyId") String agencyId); + + /** + * 获取下级机关统计信息 + * @author zhaoqifeng + * @date 2020/6/22 15:20 + * @param agencyId + * @return java.util.List + */ + List selectSubAgencyList(@Param("agencyId") String agencyId); + + /** + * 获取机关下网格统计信息 + * @author zhaoqifeng + * @date 2020/6/22 15:21 + * @param agencyId + * @return java.util.List + */ + List selectGridList(@Param("agencyId") String agencyId); + + /** + * 获取当前机关日增量 + * @author zhaoqifeng + * @date 2020/6/22 15:22 + * @param agencyId + * @return java.util.List + */ + List selectAgencyIncDailyList(@Param("agencyId") String agencyId); + + /** + * 获取当前机关月增量 + * @author zhaoqifeng + * @date 2020/6/22 15:23 + * @param agencyId + * @return java.util.List + */ + List selectAgencyIncMonthlyList(@Param("agencyId") String agencyId); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/service/IssueService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/service/IssueService.java new file mode 100644 index 0000000000..410930bffe --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/service/IssueService.java @@ -0,0 +1,65 @@ +package com.epmet.module.issue.service; + +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.issue.dto.form.IssueIncrtrendFormDTO; +import com.epmet.issue.dto.result.*; + +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/22 13:48 + */ +public interface IssueService { + /** + * 议题汇总 + * + * @param tokenDto + * @return com.epmet.issue.dto.result.IssueSummaryInfoResultDTO + * @author zhaoqifeng + * @date 2020/6/22 16:40 + */ + IssueSummaryInfoResultDTO getSummaryInfo(TokenDto tokenDto); + + /** + * 议题汇总饼状图 + * + * @param tokenDto + * @return com.epmet.issue.dto.result.IssueSummaryPieResultDTO + * @author zhaoqifeng + * @date 2020/6/22 16:40 + */ + List getSummaryPie(TokenDto tokenDto); + + /** + * 下级机关 + * + * @param tokenDto + * @return java.util.List + * @author zhaoqifeng + * @date 2020/6/22 16:40 + */ + List getSubAgency(TokenDto tokenDto); + + /** + * 网格 + * + * @param tokenDto + * @return java.util.List + * @author zhaoqifeng + * @date 2020/6/22 16:41 + */ + List getSubGrid(TokenDto tokenDto); + + /** + * 议题分析 + * + * @param tokenDto + * @param formDTO + * @return java.util.List + * @author zhaoqifeng + * @date 2020/6/22 16:41 + */ + List getIncrtrend(TokenDto tokenDto, IssueIncrtrendFormDTO formDTO); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/service/impl/IssueServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/service/impl/IssueServiceImpl.java new file mode 100644 index 0000000000..562cfc25fc --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/service/impl/IssueServiceImpl.java @@ -0,0 +1,172 @@ +package com.epmet.module.issue.service.impl; + +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dto.form.LoginUserDetailsFormDTO; +import com.epmet.dto.result.LoginUserDetailsResultDTO; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.issue.constant.IssueConstant; +import com.epmet.issue.dto.form.IssueIncrtrendFormDTO; +import com.epmet.issue.dto.result.*; +import com.epmet.module.issue.dao.IssueDao; +import com.epmet.module.issue.service.IssueService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/22 13:49 + */ +@Service +public class IssueServiceImpl implements IssueService { + @Autowired + private IssueDao issueDao; + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + @Override + public IssueSummaryInfoResultDTO getSummaryInfo(TokenDto tokenDto) { + IssueSummaryInfoResultDTO result = new IssueSummaryInfoResultDTO(); + String agencyId = getAgencyId(tokenDto); + IssueDataDTO data = issueDao.selectAgencyInfo(agencyId); + result.setAgencyId(agencyId); + result.setDateName(data.getDateName()); + result.setIssueTotal(data.getIssueTotal()); + result.setVotingTotal(data.getVotingTotal()); + result.setShiftProjectTotal(data.getShiftProjectTotal()); + result.setClosedTotal(data.getClosedTotal()); + result.setVotingRatio(toRatio(data.getVotingPercent())); + result.setShiftProjectRatio(toRatio(data.getShiftProjectPercent())); + result.setClosedRatio(toRatio(data.getClosedPercent())); + return result; + } + + @Override + public List getSummaryPie(TokenDto tokenDto) { + List list = new ArrayList<>(); + String agencyId = getAgencyId(tokenDto); + IssueDataDTO data = issueDao.selectAgencyInfo(agencyId); + IssueSummaryPieResultDTO voting = new IssueSummaryPieResultDTO(); + voting.setName(IssueConstant.VOTING_NAME); + voting.setValue(data.getVotingTotal()); + voting.setRatio(toRatio(data.getVotingPercent())); + list.add(voting); + IssueSummaryPieResultDTO shift = new IssueSummaryPieResultDTO(); + shift.setName(IssueConstant.SHIFT_NAME); + shift.setValue(data.getShiftProjectTotal()); + shift.setRatio(toRatio(data.getShiftProjectPercent())); + list.add(shift); + IssueSummaryPieResultDTO closed = new IssueSummaryPieResultDTO(); + closed.setName(IssueConstant.CLOSED_NAME); + closed.setValue(data.getClosedTotal()); + closed.setRatio(toRatio(data.getClosedPercent())); + list.add(closed); + return list; + } + + @Override + public List getSubAgency(TokenDto tokenDto) { + List list = new ArrayList<>(); + String agencyId = getAgencyId(tokenDto); + List dataList = issueDao.selectSubAgencyList(agencyId); + if(null != dataList) { + dataList.forEach(data -> { + IssueSubAgencyResultDTO voting = new IssueSubAgencyResultDTO(); + voting.setAgencyId(data.getAgencyId()); + voting.setName(data.getAgencyName()); + voting.setType(IssueConstant.VOTING_NAME); + voting.setValue(data.getVotingTotal()); + list.add(voting); + IssueSubAgencyResultDTO shift = new IssueSubAgencyResultDTO(); + shift.setAgencyId(data.getAgencyId()); + shift.setName(data.getAgencyName()); + shift.setType(IssueConstant.SHIFT_NAME); + shift.setValue(data.getShiftProjectTotal()); + list.add(shift); + IssueSubAgencyResultDTO closed = new IssueSubAgencyResultDTO(); + closed.setAgencyId(data.getAgencyId()); + closed.setName(data.getAgencyName()); + closed.setType(IssueConstant.CLOSED_NAME); + closed.setValue(data.getClosedTotal()); + list.add(closed); + }); + } + return list; + } + + @Override + public List getSubGrid(TokenDto tokenDto) { + List list = new ArrayList<>(); + String agencyId = getAgencyId(tokenDto); + List dataList = issueDao.selectGridList(agencyId); + if(null != dataList) { + dataList.forEach(data -> { + IssueSubGridResultDTO voting = new IssueSubGridResultDTO(); + voting.setName(data.getGridName()); + voting.setType(IssueConstant.VOTING_NAME); + voting.setValue(data.getVotingTotal()); + list.add(voting); + IssueSubGridResultDTO shift = new IssueSubGridResultDTO(); + shift.setName(data.getGridName()); + shift.setType(IssueConstant.SHIFT_NAME); + shift.setValue(data.getShiftProjectTotal()); + list.add(shift); + IssueSubGridResultDTO closed = new IssueSubGridResultDTO(); + closed.setName(data.getGridName()); + closed.setType(IssueConstant.CLOSED_NAME); + closed.setValue(data.getClosedTotal()); + list.add(closed); + }); + } + return list; + } + + @Override + public List getIncrtrend(TokenDto tokenDto, IssueIncrtrendFormDTO formDTO) { + List list = new ArrayList<>(); + String agencyId = getAgencyId(tokenDto); + List dataList; + if (IssueConstant.DATE.equals(formDTO.getType())) { + dataList = issueDao.selectAgencyIncDailyList(agencyId); + } else { + dataList = issueDao.selectAgencyIncMonthlyList(agencyId); + } + if (null != dataList) { + dataList.forEach(data -> { + IssueIncrtrendResultDTO voting = new IssueIncrtrendResultDTO(); + voting.setDate(data.getDateName()); + voting.setType(IssueConstant.VOTING_NAME); + voting.setValue(data.getVotingIncr()); + list.add(voting); + IssueIncrtrendResultDTO shift = new IssueIncrtrendResultDTO(); + shift.setDate(data.getDateName()); + shift.setType(IssueConstant.SHIFT_NAME); + shift.setValue(data.getShiftProjectIncr()); + list.add(shift); + IssueIncrtrendResultDTO closed = new IssueIncrtrendResultDTO(); + closed.setDate(data.getDateName()); + closed.setType(IssueConstant.CLOSED_NAME); + closed.setValue(data.getClosedIncr()); + list.add(closed); + }); + } + return list; + } + + private String getAgencyId(TokenDto tokenDto) { + LoginUserDetailsFormDTO loginUserDetailsFormDTO = new LoginUserDetailsFormDTO(); + loginUserDetailsFormDTO.setApp(tokenDto.getApp()); + loginUserDetailsFormDTO.setClient(tokenDto.getClient()); + loginUserDetailsFormDTO.setUserId(tokenDto.getUserId()); + LoginUserDetailsResultDTO userInfo = epmetUserOpenFeignClient.getLoginUserDetails(loginUserDetailsFormDTO).getData(); + String[] orgIdPath = userInfo.getOrgIdPath().split(":"); + return orgIdPath[orgIdPath.length - 1]; + } + + private String toRatio(BigDecimal data) { + return data.stripTrailingZeros().toString().concat("%"); + } +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/controller/.gitignore b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/controller/.gitignore deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/controller/ProjectController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/controller/ProjectController.java new file mode 100644 index 0000000000..e0a1e26fb3 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/controller/ProjectController.java @@ -0,0 +1,76 @@ +package com.epmet.module.project.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.module.project.service.ProjectService; +import com.epmet.project.dto.form.ProjectIncrTrendFormDTO; +import com.epmet.project.dto.result.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * @Author sun + * @Description 数据-项目 + **/ +@RestController +@RequestMapping("project") +public class ProjectController { + + @Autowired + private ProjectService projectService; + + + /** + * @Author sun + * @Description 数据-项目-获取汇总数据 + **/ + @PostMapping("projectsummary") + public Result projectSummary(@LoginUser TokenDto tokenDto) { + return new Result().ok(projectService.getProjectSummary(tokenDto)); + } + + /** + * @Author sun + * @Description 数据-项目-获取组织下饼图数据 + **/ + @PostMapping("summaryinfo") + public Result> summaryInfo(@LoginUser TokenDto tokenDto) { + return new Result>().ok(projectService.getSummaryInfo(tokenDto)); + } + + /** + * @Author sun + * @Description 数据-项目-获取下级组织柱状图数据 + **/ + @PostMapping("subagency") + public Result> subAgency(@LoginUser TokenDto tokenDto) { + return new Result>().ok(projectService.getSubAgency(tokenDto)); + } + + /** + * @Author sun + * @Description 数据-项目-获取机关直属网格项目数据 + **/ + @PostMapping("subgrid") + public Result> subGrid(@LoginUser TokenDto tokenDto) { + return new Result>().ok(projectService.getSubGrid(tokenDto)); + } + + /** + * @Author sun + * @Description 数据-项目-日/月数据查询 + **/ + @PostMapping("incrtrend") + public Result> incrTrend(@LoginUser TokenDto tokenDto, @RequestBody ProjectIncrTrendFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, ProjectIncrTrendFormDTO.ProjectIncr.class); + return new Result>().ok(projectService.getProjectIncrTrend(tokenDto,formDTO)); + } + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/dao/.gitignore b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/dao/.gitignore deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/dao/ProjectDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/dao/ProjectDao.java new file mode 100644 index 0000000000..09bb4293f0 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/dao/ProjectDao.java @@ -0,0 +1,58 @@ +package com.epmet.module.project.dao; + +import com.epmet.project.dto.FactAgencyProjectDailyDTO; +import com.epmet.project.dto.result.*; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @Author sun + * @Description 数据-项目 + **/ +@Mapper +public interface ProjectDao { + + /** + * @Author sun + * @Description 数据-项目-获取汇总数据 + **/ + ProjectSummaryResultDTO selectProjectSummary(@Param("agencyId") String agencyId); + + /** + * @Author sun + * @Description 数据-项目-获取汇总数据 + **/ + List selectSummaryInfo(@Param("agencyId") String agencyId); + + /** + * @Author sun + * @Description 查询组织最近日期的日统计数据 + **/ + FactAgencyProjectDailyDTO selectAgencyProjectDaily(@Param("agencyId") String agencyId); + + /** + * @Author sun + * @Description 数据-项目-获取最近日期下级组织柱状图数据(按项目总量降序) + **/ + List selectSubAgency(FactAgencyProjectDailyDTO agencyProjectDailyDTO); + + /** + * @Author sun + * @Description 查询机关下直属网格最近一天的日统计数据,按项目总数降序 + **/ + List selectSubGrid(FactAgencyProjectDailyDTO agencyProjectDailyDTO); + + /** + * @Author sun + * @Description 查询机关日统计近九十天数据 + **/ + List selectIncrTrendDaily(@Param("agencyId") String agencyId); + + /** + * @Author sun + * @Description 查询机关月统计近十二个月数据 + **/ + List selectIncrTrendMonthly(@Param("agencyId") String agencyId); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/service/.gitignore b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/service/.gitignore deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/service/ProjectService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/service/ProjectService.java new file mode 100644 index 0000000000..baa6e664e0 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/service/ProjectService.java @@ -0,0 +1,44 @@ +package com.epmet.module.project.service; + +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.project.dto.form.ProjectIncrTrendFormDTO; +import com.epmet.project.dto.result.*; + +import java.util.List; + +/** + * @Author sun + * @Description 数据-项目 + **/ +public interface ProjectService { + + /** + * @Author sun + * @Description 数据-项目-获取汇总数据 + **/ + ProjectSummaryResultDTO getProjectSummary(TokenDto tokenDto); + + /** + * @Author sun + * @Description 数据-项目-获取组织下饼图数据 + **/ + List getSummaryInfo(TokenDto tokenDto); + + /** + * @Author sun + * @Description 数据-项目-获取下级组织柱状图数据 + **/ + List getSubAgency(TokenDto tokenDto); + + /** + * @Author sun + * @Description 数据-项目-获取机关直属网格项目数据 + **/ + List getSubGrid(TokenDto tokenDto); + + /** + * @Author sun + * @Description 数据-项目-日/月数据查询 + **/ + List getProjectIncrTrend(TokenDto tokenDto, ProjectIncrTrendFormDTO formDTO); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/service/impl/ProjectServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/service/impl/ProjectServiceImpl.java new file mode 100644 index 0000000000..502f613d1c --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/service/impl/ProjectServiceImpl.java @@ -0,0 +1,150 @@ +package com.epmet.module.project.service.impl; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dto.form.LoginUserDetailsFormDTO; +import com.epmet.dto.result.LoginUserDetailsResultDTO; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.module.project.dao.ProjectDao; +import com.epmet.module.project.service.ProjectService; +import com.epmet.project.constant.ProjectConstant; +import com.epmet.project.dto.FactAgencyProjectDailyDTO; +import com.epmet.project.dto.form.ProjectIncrTrendFormDTO; +import com.epmet.project.dto.result.*; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * @Author sun + * @Description 数据-项目 + **/ +@Service +public class ProjectServiceImpl implements ProjectService { + + @Autowired + private ProjectDao projectDao; + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + + /** + * @Author sun + * @Description 数据-项目-获取汇总数据 + **/ + @Override + public ProjectSummaryResultDTO getProjectSummary(TokenDto tokenDto) { + //1:根据token获取agencyId + String agencyId = getLoginUserDetails(tokenDto); + + //2:根据agencyId查询项目统计数据 + ProjectSummaryResultDTO resultDTO = projectDao.selectProjectSummary(agencyId); + if (null != resultDTO) { + resultDTO.setPendingRatio(resultDTO.getPendingRatio() + "%"); + resultDTO.setClosedRatio(resultDTO.getClosedRatio() + "%"); + } + return resultDTO; + } + + /** + * @Author sun + * @Description 数据-项目-获取组织下饼图数据 + **/ + @Override + public List getSummaryInfo(TokenDto tokenDto) { + List resultList = new ArrayList<>(); + //1:根据token获取agencyId + String agencyId = getLoginUserDetails(tokenDto); + + //2:根据agencyId查询各状态统计数据 + resultList = projectDao.selectSummaryInfo(agencyId); + if (null != resultList && resultList.size() > NumConstant.ZERO) { + resultList.forEach(sum -> { + sum.setRatio(sum.getRatio() + "%"); + }); + } + return resultList; + } + + /** + * @Author sun + * @Description 数据-项目-获取下级组织柱状图数据 + **/ + @Override + public List getSubAgency(TokenDto tokenDto) { + List resultList = new ArrayList<>(); + //1:根据token获取agencyId + String agencyId = getLoginUserDetails(tokenDto); + + //2:根据机关Id查询最近日期的日统计数据 + FactAgencyProjectDailyDTO agencyProjectDailyDTO = projectDao.selectAgencyProjectDaily(agencyId); + if (null == agencyProjectDailyDTO) { + return resultList; + } + //2:获取当前组织最近日期的直属下级组织项目统计数据,按项目总量降序 + resultList = projectDao.selectSubAgency(agencyProjectDailyDTO); + return resultList; + } + + /** + * @Author sun + * @Description 数据-项目-获取机关直属网格项目数据 + **/ + @Override + public List getSubGrid(TokenDto tokenDto) { + List resultList = new ArrayList<>(); + //1:根据token获取agencyId + String agencyId = getLoginUserDetails(tokenDto); + + //2:根据机关Id查询最近日期的日统计数据 + FactAgencyProjectDailyDTO agencyProjectDailyDTO = projectDao.selectAgencyProjectDaily(agencyId); + if (null == agencyProjectDailyDTO) { + return resultList; + } + //2:获取当前组织最近日期的直属下级组织项目统计数据,按项目总量降序 + resultList = projectDao.selectSubGrid(agencyProjectDailyDTO); + return resultList; + } + + /** + * @Author sun + * @Description 数据-项目-日/月数据查询(日查询进九十天数据,月查询进十二个月数据) + **/ + @Override + public List getProjectIncrTrend(TokenDto tokenDto, ProjectIncrTrendFormDTO formDTO) { + List resultList = new ArrayList<>(); + //1:根据token获取agencyId + String agencyId = getLoginUserDetails(tokenDto); + + //2:查询机关过去九十天日统计数据(sql降序取前九十条) + if (ProjectConstant.DATE.equals(formDTO.getType())){ + resultList = projectDao.selectIncrTrendDaily(agencyId); + } + + //3:查询机关过去十二个月月统计数据 + if (ProjectConstant.MONTH.equals(formDTO.getType())) { + resultList = projectDao.selectIncrTrendMonthly(agencyId); + } + + return null; + } + + /** + * @author sun + * @Description 获取机关ID + */ + private String getLoginUserDetails(TokenDto tokenDto) { + LoginUserDetailsFormDTO dto = new LoginUserDetailsFormDTO(); + BeanUtils.copyProperties(tokenDto, dto); + LoginUserDetailsResultDTO data = epmetUserOpenFeignClient.getLoginUserDetails(dto).getData(); + String agencyId = data.getAgencyId(); + if (null == agencyId || "".equals(agencyId)) { + throw new RenException(ProjectConstant.GET_AGENCYID); + } + return agencyId; + } + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/controller/PublicityController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/controller/PublicityController.java new file mode 100644 index 0000000000..3fea38b5f0 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/controller/PublicityController.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.module.publicity.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.module.publicity.service.PublicityService; +import com.epmet.publicity.dto.form.TagFormDTO; +import com.epmet.publicity.dto.result.FactArticlePublishedAgencyDailyDTO; +import com.epmet.publicity.dto.result.FactTagAgencyDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + + +/** + * 文章发布数量【机关】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@RestController +@RequestMapping("publicity") +public class PublicityController { + + + @Autowired + private PublicityService publicityService;// + + + /** + * @param tokenDTO + * @return + * @Author jyy + * @Description 宣传能力—工作端—当前机关累计发文和当前发文 + **/ + @PostMapping("summaryinfo") + public Result summaryInfo(@LoginUser TokenDto tokenDto) { + return new Result().ok(publicityService.summaryInfo(tokenDto)); + } + + /** + * @param tokenDto + * @Description 宣传能力—工作端—宣传能力-获取阅读最多的分类数据 + * @author jyy + */ + @PostMapping("tagviewed") + public Result> tagviewed(@LoginUser TokenDto tokenDto, @RequestBody TagFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, TagFormDTO.GroupJava.class); + + Integer pageSize = formDTO.getPageSize(); + if (pageSize == null) { + pageSize = NumConstant.TEN; + } + String type = formDTO.getType(); + return new Result>().ok(publicityService.tagviewed(tokenDto, pageSize, type)); + } + + /** + * @param tokenDto + * @Description 宣传能力—工作端—宣传能力-获取发表最多的分类数据 + * @author jyy + */ + @PostMapping("tagused") + public Result> tagused(@LoginUser TokenDto tokenDto, @RequestBody TagFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, TagFormDTO.GroupJava.class); + + Integer pageSize = formDTO.getPageSize(); + if (pageSize == null) { + pageSize = NumConstant.TEN; + } + String type = formDTO.getType(); + return new Result>().ok(publicityService.tagused(tokenDto, pageSize, type)); + } + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactArticlePublishedAgencyDailyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactArticlePublishedAgencyDailyDao.java new file mode 100644 index 0000000000..283613c4e5 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactArticlePublishedAgencyDailyDao.java @@ -0,0 +1,42 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.module.publicity.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.publicity.dto.result.FactArticlePublishedAgencyDailyDTO; +import com.epmet.entity.FactArticlePublishedAgencyDailyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 文章发布数量【机关】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Mapper +public interface FactArticlePublishedAgencyDailyDao extends BaseDao { + + /** + * @Description 宣传能力—工作端—当前机关累计发文和当前发文 + * @param agencyId + * @author jyy + */ + FactArticlePublishedAgencyDailyDTO summaryInfo(@Param("agencyId") String agencyId); + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactArticlePublishedDepartmentDailyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactArticlePublishedDepartmentDailyDao.java new file mode 100644 index 0000000000..15ada3b211 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactArticlePublishedDepartmentDailyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.module.publicity.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.FactArticlePublishedDepartmentDailyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 文章发布数量【部门】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Mapper +public interface FactArticlePublishedDepartmentDailyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactArticlePublishedGridDailyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactArticlePublishedGridDailyDao.java new file mode 100644 index 0000000000..d96cc5747a --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactArticlePublishedGridDailyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.module.publicity.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.FactArticlePublishedGridDailyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 文章发布数量【网格】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Mapper +public interface FactArticlePublishedGridDailyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagUsedAgencyMonthlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagUsedAgencyMonthlyDao.java new file mode 100644 index 0000000000..636ac8d8dc --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagUsedAgencyMonthlyDao.java @@ -0,0 +1,40 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.module.publicity.dao; + +import com.epmet.publicity.dto.result.FactTagAgencyDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 文章引用标签阅读数量【机关】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Mapper +public interface FactTagUsedAgencyMonthlyDao { + /** + * @param agencyId monthId + * @Description 根据标签分组,获取当月每个标签数量,按照数量降序,取前pagesize个 + * @author zxc + */ + List getMonthlyCountByTag(@Param("agencyId") String agencyId, @Param("monthId") String monthId, @Param("pageSize") Integer pageSize); +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagUsedAgencyQuarterlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagUsedAgencyQuarterlyDao.java new file mode 100644 index 0000000000..e849870793 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagUsedAgencyQuarterlyDao.java @@ -0,0 +1,40 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.module.publicity.dao; + +import com.epmet.publicity.dto.result.FactTagAgencyDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 文章引用标签阅读数量【机关】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Mapper +public interface FactTagUsedAgencyQuarterlyDao { + /** + * @param agencyId monthId + * @Description 根据标签分组,获取当月每个标签数量,按照数量降序,取前pagesize个 + * @author zxc + */ + List getQuarterlyCountByTag(@Param("agencyId") String agencyId, @Param("quarterId") String quarterId, @Param("pageSize") Integer pageSize); +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagUsedAgencyYearlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagUsedAgencyYearlyDao.java new file mode 100644 index 0000000000..9325b0d600 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagUsedAgencyYearlyDao.java @@ -0,0 +1,40 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.module.publicity.dao; + +import com.epmet.publicity.dto.result.FactTagAgencyDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 文章引用标签阅读数量【机关】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Mapper +public interface FactTagUsedAgencyYearlyDao { + /** + * @param agencyId monthId + * @Description 根据标签分组,获取当月每个标签数量,按照数量降序,取前pagesize个 + * @author zxc + */ + List getYearlyCountByTag(@Param("agencyId") String agencyId, @Param("yearId") String yearId, @Param("pageSize") Integer pageSize); +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedAgencyDailyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedAgencyDailyDao.java new file mode 100644 index 0000000000..d45797f0a1 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedAgencyDailyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.module.publicity.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.FactTagViewedAgencyDailyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 文章引用标签阅读数量【机关】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Mapper +public interface FactTagViewedAgencyDailyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedAgencyMonthlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedAgencyMonthlyDao.java new file mode 100644 index 0000000000..a5945654cf --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedAgencyMonthlyDao.java @@ -0,0 +1,40 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.module.publicity.dao; + +import com.epmet.publicity.dto.result.FactTagAgencyDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 文章引用标签阅读数量【机关】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Mapper +public interface FactTagViewedAgencyMonthlyDao { + /** + * @param agencyId monthId + * @Description 根据标签分组,获取当月每个标签数量,按照数量降序,取前pagesize个 + * @author zxc + */ + List getMonthlyCountByTag(@Param("agencyId") String agencyId, @Param("monthId") String monthId, @Param("pageSize") Integer pageSize); +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedAgencyQuarterlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedAgencyQuarterlyDao.java new file mode 100644 index 0000000000..f546706569 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedAgencyQuarterlyDao.java @@ -0,0 +1,40 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.module.publicity.dao; + +import com.epmet.publicity.dto.result.FactTagAgencyDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 文章引用标签阅读数量【机关】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Mapper +public interface FactTagViewedAgencyQuarterlyDao { + /** + * @param agencyId monthId + * @Description 根据标签分组,获取当月每个标签数量,按照数量降序,取前pagesize个 + * @author zxc + */ + List getQuarterlyCountByTag(@Param("agencyId") String agencyId, @Param("quarterId") String quarterId, @Param("pageSize") Integer pageSize); +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedAgencyYearlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedAgencyYearlyDao.java new file mode 100644 index 0000000000..de6bd638ca --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedAgencyYearlyDao.java @@ -0,0 +1,40 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.module.publicity.dao; + +import com.epmet.publicity.dto.result.FactTagAgencyDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 文章引用标签阅读数量【机关】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Mapper +public interface FactTagViewedAgencyYearlyDao { + /** + * @param agencyId monthId + * @Description 根据标签分组,获取当月每个标签数量,按照数量降序,取前pagesize个 + * @author zxc + */ + List getYearlyCountByTag(@Param("agencyId") String agencyId, @Param("yearId") String yearId, @Param("pageSize") Integer pageSize); +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedGridDailyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedGridDailyDao.java new file mode 100644 index 0000000000..eeac2a8100 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedGridDailyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.module.publicity.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.FactTagViewedGridDailyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 文章引用标签阅读数量【网格】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Mapper +public interface FactTagViewedGridDailyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedGridMonthlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedGridMonthlyDao.java new file mode 100644 index 0000000000..3336e1460b --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedGridMonthlyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.module.publicity.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.FactTagViewedGridMonthlyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 文章引用标签阅读数量【网格】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Mapper +public interface FactTagViewedGridMonthlyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedGridQuarterlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedGridQuarterlyDao.java new file mode 100644 index 0000000000..e91e66f5ef --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedGridQuarterlyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.module.publicity.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.FactTagViewedGridQuarterlyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 文章引用标签阅读数量【网格】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Mapper +public interface FactTagViewedGridQuarterlyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedGridYearlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedGridYearlyDao.java new file mode 100644 index 0000000000..380e7a4301 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedGridYearlyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.module.publicity.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.FactTagViewedGridYearlyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 文章引用标签阅读数量【网格】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Mapper +public interface FactTagViewedGridYearlyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactArticlePublishedAgencyDailyEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactArticlePublishedAgencyDailyEntity.java new file mode 100644 index 0000000000..680ae4d86a --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactArticlePublishedAgencyDailyEntity.java @@ -0,0 +1,91 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 文章发布数量【机关】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_article_published_agency_daily") +public class FactArticlePublishedAgencyDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 文章累计发文数量 文章数量 + */ + private Integer articleTotalCount; + + /** + * 当前发文数量 当前未下线的文章数量 + */ + private Integer articlePublishedCount; + + /** + * 日期ID 日期ID + */ + private String dateId; + + /** + * 周ID 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactArticlePublishedDepartmentDailyEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactArticlePublishedDepartmentDailyEntity.java new file mode 100644 index 0000000000..45d10f9b8d --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactArticlePublishedDepartmentDailyEntity.java @@ -0,0 +1,91 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 文章发布数量【部门】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_article_published_department_daily") +public class FactArticlePublishedDepartmentDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 发布文章单位所属机关ID 发布文章单位所属机关ID + */ + private String agencyId; + + /** + * 部门ID + */ + private String departmentId; + + /** + * 文章累计发文数量 文章数量 + */ + private Integer articleTotalCount; + + /** + * 当前发文数量 当前未下线的文章数量 + */ + private Integer articlePublishedCount; + + /** + * 日期ID 日期ID + */ + private String dateId; + + /** + * 周ID 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactArticlePublishedGridDailyEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactArticlePublishedGridDailyEntity.java new file mode 100644 index 0000000000..93f9a4568c --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactArticlePublishedGridDailyEntity.java @@ -0,0 +1,91 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 文章发布数量【网格】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_article_published_grid_daily") +public class FactArticlePublishedGridDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 发布单位所属机关ID 发布单位所属机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 文章累计发文数量 文章数量 + */ + private Integer articleTotalCount; + + /** + * 当前发文数量 当前未下线的文章数量 + */ + private Integer articlePublishedCount; + + /** + * 日期ID 日期ID + */ + private String dateId; + + /** + * 周ID 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedAgencyDailyEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedAgencyDailyEntity.java new file mode 100644 index 0000000000..b020f7454f --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedAgencyDailyEntity.java @@ -0,0 +1,96 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 文章引用标签阅读数量【机关】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_tag_viewed_agency_daily") +public class FactTagViewedAgencyDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 日期ID 天数ID eg:20200601 = 2020年6月1日、20200602 = 2020年6月2日 + */ + private String dateId; + + /** + * 周ID 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedAgencyMonthlyEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedAgencyMonthlyEntity.java new file mode 100644 index 0000000000..f0125e67c6 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedAgencyMonthlyEntity.java @@ -0,0 +1,76 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 文章引用标签阅读数量【机关】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_tag_viewed_agency_monthly") +public class FactTagViewedAgencyMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 月份ID 月份ID eg:2020-06 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedAgencyQuarterlyEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedAgencyQuarterlyEntity.java new file mode 100644 index 0000000000..de60b9198b --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedAgencyQuarterlyEntity.java @@ -0,0 +1,76 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 文章引用标签阅读数量【机关】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_tag_viewed_agency_quarterly") +public class FactTagViewedAgencyQuarterlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedAgencyYearlyEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedAgencyYearlyEntity.java new file mode 100644 index 0000000000..2cc0d5bfac --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedAgencyYearlyEntity.java @@ -0,0 +1,76 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 文章引用标签阅读数量【机关】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_tag_viewed_agency_yearly") +public class FactTagViewedAgencyYearlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedGridDailyEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedGridDailyEntity.java new file mode 100644 index 0000000000..16b6702ba1 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedGridDailyEntity.java @@ -0,0 +1,96 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 文章引用标签阅读数量【网格】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_tag_viewed_grid_daily") +public class FactTagViewedGridDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 日期ID 天数ID eg:20200601 = 2020年6月1日、20200602 = 2020年6月2日 + */ + private String dateId; + + /** + * 周ID 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedGridMonthlyEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedGridMonthlyEntity.java new file mode 100644 index 0000000000..36898a2ef7 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedGridMonthlyEntity.java @@ -0,0 +1,76 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 文章引用标签阅读数量【网格】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_tag_viewed_grid_monthly") +public class FactTagViewedGridMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 月份ID 月份ID eg:2020-06 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedGridQuarterlyEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedGridQuarterlyEntity.java new file mode 100644 index 0000000000..ea8fb00ce4 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedGridQuarterlyEntity.java @@ -0,0 +1,76 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 文章引用标签阅读数量【网格】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_tag_viewed_grid_quarterly") +public class FactTagViewedGridQuarterlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedGridYearlyEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedGridYearlyEntity.java new file mode 100644 index 0000000000..b4adaff236 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedGridYearlyEntity.java @@ -0,0 +1,76 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 文章引用标签阅读数量【网格】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_tag_viewed_grid_yearly") +public class FactTagViewedGridYearlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/service/PublicityService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/service/PublicityService.java new file mode 100644 index 0000000000..ad9114849b --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/service/PublicityService.java @@ -0,0 +1,56 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.module.publicity.service; + +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.publicity.dto.result.FactArticlePublishedAgencyDailyDTO; +import com.epmet.publicity.dto.result.FactTagAgencyDTO; + +import java.util.List; + +/** + * 文章引用标签阅读数量【机关】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +public interface PublicityService { + + /** + * @Description 宣传能力—工作端—当前机关累计发文和当前发文 + * @param tokenDto + * @author jyy + */ + FactArticlePublishedAgencyDailyDTO summaryInfo(TokenDto tokenDto); + + /** + * @Description 宣传能力—工作端—宣传能力-获取阅读最多的分类数据 + * @param tokenDto,formDTO + * @author jyy + */ + public List tagviewed(TokenDto tokenDto, Integer pageSize, String type) ; + + /** + * @Description 宣传能力—工作端—宣传能力-获取发表最多的分类数据 + * @param tokenDto,pageSize,type + * @author jyy + */ + public List tagused(TokenDto tokenDto, Integer pageSize, String type) ; + + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/service/impl/PublicityServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/service/impl/PublicityServiceImpl.java new file mode 100644 index 0000000000..6beebc0604 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/service/impl/PublicityServiceImpl.java @@ -0,0 +1,151 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.module.publicity.service.impl; + +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.dto.form.LoginUserDetailsFormDTO; +import com.epmet.dto.result.LoginUserDetailsResultDTO; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.module.publicity.dao.FactArticlePublishedAgencyDailyDao; +import com.epmet.module.publicity.dao.FactTagViewedAgencyMonthlyDao; +import com.epmet.module.publicity.dao.FactTagViewedAgencyQuarterlyDao; +import com.epmet.module.publicity.dao.FactTagViewedAgencyYearlyDao; + +import com.epmet.module.publicity.service.PublicityService; +import com.epmet.publicity.dto.result.FactArticlePublishedAgencyDailyDTO; + +import com.epmet.publicity.dto.result.FactTagAgencyDTO; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + + +import java.util.Date; +import java.util.List; + +/** + * 文章引用标签阅读数量【机关】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Service +public class PublicityServiceImpl implements PublicityService { + + @Autowired + private FactArticlePublishedAgencyDailyDao factArticlePublishedAgencyDailyDao;//机关每日发文 + @Autowired + private FactTagViewedAgencyMonthlyDao factTagViewedAgencyMonthlyDao;//机关-每月-阅读 + @Autowired + private FactTagViewedAgencyQuarterlyDao factTagViewedAgencyQuarterlyDao;//机关-每季度-阅读 + @Autowired + private FactTagViewedAgencyYearlyDao factTagViewedAgencyYearlyDao;//机关-每年-阅读 + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + + /** + * @param tokenDto + * @Description 宣传能力—工作端—当前机关累计发文和当前发文 + * @author jyy + */ + @Override + public FactArticlePublishedAgencyDailyDTO summaryInfo(TokenDto tokenDto) { + String agencyId = this.getLoginUserDetails(tokenDto); + return factArticlePublishedAgencyDailyDao.summaryInfo(agencyId); + } + + + /** + * @param tokenDto,formDTO + * @Description 宣传能力—工作端—宣传能力-获取阅读最多的分类数据 + * @author jyy + */ + @Override + public List tagviewed(TokenDto tokenDto, Integer pageSize, String type) { +// String agencyId = this.getLoginUserDetails(tokenDto); + String agencyId = "0d2ffe9fce682b602b9d451226d08fae"; + Date date = new Date(); + String strDate = DateUtils.format(date, DateUtils.DATE_PATTERN); + String yearId = strDate.substring(0, 4); + + if (StringUtils.equals("month", type)) {//当月 + String monthId = strDate.substring(0, 4) + strDate.substring(5, 7); + return factTagViewedAgencyMonthlyDao.getMonthlyCountByTag(agencyId, monthId, pageSize); + + } else if (StringUtils.equals("quarter", type)) {//当季 + String quarterId = strDate + "Q" + DateUtils.getQuarterIndex(date); + return factTagViewedAgencyQuarterlyDao.getQuarterlyCountByTag(agencyId, quarterId, pageSize); + + } else if (StringUtils.equals("year", type)) {//当年 + + return factTagViewedAgencyYearlyDao.getYearlyCountByTag(agencyId, yearId, pageSize); + + } else { + return null; + } + + + } + + /** + * @param tokenDto,pageSize,type + * @Description 宣传能力—工作端—宣传能力-获取发表最多的分类数据 + * @author jyy + */ + @Override + public List tagused(TokenDto tokenDto, Integer pageSize, String type) { +// String agencyId = this.getLoginUserDetails(tokenDto); + String agencyId = "0d2ffe9fce682b602b9d451226d08fae"; + Date date = new Date(); + String strDate = DateUtils.format(date, DateUtils.DATE_PATTERN); + String yearId = strDate.substring(0, 4); + + if (StringUtils.equals("month", type)) {//当月 + String monthId = strDate.substring(0, 4) + strDate.substring(5, 7); + return factTagViewedAgencyMonthlyDao.getMonthlyCountByTag(agencyId, monthId, pageSize); + + } else if (StringUtils.equals("quarter", type)) {//当季 + String quarterId = strDate + "Q" + DateUtils.getQuarterIndex(date); + return factTagViewedAgencyQuarterlyDao.getQuarterlyCountByTag(agencyId, quarterId, pageSize); + + } else if (StringUtils.equals("year", type)) {//当年 + + return factTagViewedAgencyYearlyDao.getYearlyCountByTag(agencyId, yearId, pageSize); + + } else { + return null; + } + + + } + + /** + * @param tokenDto + * @Description 获取机关ID + * @author zxc + */ + public String getLoginUserDetails(TokenDto tokenDto) { + LoginUserDetailsFormDTO dto = new LoginUserDetailsFormDTO(); + BeanUtils.copyProperties(tokenDto, dto); + LoginUserDetailsResultDTO data = epmetUserOpenFeignClient.getLoginUserDetails(dto).getData(); + return data.getAgencyId(); + } + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml b/epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml new file mode 100644 index 0000000000..cde009a097 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml @@ -0,0 +1,164 @@ + + + + + + + + + + ${appname} + + + + + + + + + debug + + + ${CONSOLE_LOG_PATTERN} + + UTF-8 + + + + + + + + ${log.path}/debug.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + + ${log.path}/debug-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + debug + ACCEPT + DENY + + + + + + + ${log.path}/info.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + + ${log.path}/info-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + info + ACCEPT + DENY + + + + + + + ${log.path}/warn.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/warn-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + warn + ACCEPT + DENY + + + + + + + ${log.path}/error.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/error-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + ERROR + ACCEPT + DENY + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/IssueDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/IssueDao.xml new file mode 100644 index 0000000000..d558e62d86 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/IssueDao.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml new file mode 100644 index 0000000000..ac9ecd9ad6 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml @@ -0,0 +1,228 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactArticlePublishedAgencyDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactArticlePublishedAgencyDailyDao.xml new file mode 100644 index 0000000000..a7ba0a5ed8 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactArticlePublishedAgencyDailyDao.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactArticlePublishedDepartmentDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactArticlePublishedDepartmentDailyDao.xml new file mode 100644 index 0000000000..fce52d3311 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactArticlePublishedDepartmentDailyDao.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactArticlePublishedGridDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactArticlePublishedGridDailyDao.xml new file mode 100644 index 0000000000..cace8fc645 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactArticlePublishedGridDailyDao.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagUsedAgencyMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagUsedAgencyMonthlyDao.xml new file mode 100644 index 0000000000..f4806e8e40 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagUsedAgencyMonthlyDao.xml @@ -0,0 +1,20 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagUsedAgencyQuarterlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagUsedAgencyQuarterlyDao.xml new file mode 100644 index 0000000000..9c10faf1b1 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagUsedAgencyQuarterlyDao.xml @@ -0,0 +1,22 @@ + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagUsedAgencyYearlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagUsedAgencyYearlyDao.xml new file mode 100644 index 0000000000..3384db1368 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagUsedAgencyYearlyDao.xml @@ -0,0 +1,23 @@ + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyDailyDao.xml new file mode 100644 index 0000000000..10653c3bb5 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyDailyDao.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyMonthlyDao.xml new file mode 100644 index 0000000000..937da74e63 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyMonthlyDao.xml @@ -0,0 +1,20 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyQuarterlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyQuarterlyDao.xml new file mode 100644 index 0000000000..5ff395280d --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyQuarterlyDao.xml @@ -0,0 +1,22 @@ + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyYearlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyYearlyDao.xml new file mode 100644 index 0000000000..e0b274080d --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyYearlyDao.xml @@ -0,0 +1,23 @@ + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridDailyDao.xml new file mode 100644 index 0000000000..b03b85f2bf --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridDailyDao.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridMonthlyDao.xml new file mode 100644 index 0000000000..870ed21e7d --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridMonthlyDao.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridQuarterlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridQuarterlyDao.xml new file mode 100644 index 0000000000..4e08735106 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridQuarterlyDao.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridYearlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridYearlyDao.xml new file mode 100644 index 0000000000..03bf9a4f3b --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridYearlyDao.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/topic/TopicDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/topic/TopicDao.xml index 93f146f299..78aca74a1c 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/topic/TopicDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/topic/TopicDao.xml @@ -42,7 +42,7 @@ WHEN topic_status_id = 'hidden' THEN '已屏蔽' WHEN topic_status_id = 'closed' THEN '已关闭' ELSE '无' END) AS name, - topic_proportion AS ratio + CONCAT(topic_proportion,'%') AS ratio FROM fact_topic_status_agency_daily WHERE diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DimAgencyConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DimAgencyConstant.java new file mode 100644 index 0000000000..b447c1f2da --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DimAgencyConstant.java @@ -0,0 +1,10 @@ +package com.epmet.constant; + +public interface DimAgencyConstant { + + String TYPE_ALL = "all"; + String TYPE_SELF = "self"; + + String TYPE_SELF_ID_SUFFIX = "-self"; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/AgencyMonthlyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/AgencyMonthlyFormDTO.java index 32c14a94a9..ec00bcc11f 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/AgencyMonthlyFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/AgencyMonthlyFormDTO.java @@ -19,6 +19,11 @@ public class AgencyMonthlyFormDTO implements Serializable { */ private String id; + /** + * 客户ID + */ + private String customerId; + /** * 机关ID */ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGroupDailyResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGroupDailyResultDTO.java index 3858767dda..139917240b 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGroupDailyResultDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGroupDailyResultDTO.java @@ -18,6 +18,11 @@ public class AgencyGroupDailyResultDTO implements Serializable { */ private String id; + /** + * 客户ID + */ + private String customerId; + /** * 机构ID */ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GroupGridDailyResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GroupGridDailyResultDTO.java index b33c9c38ad..b95bedeb9b 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GroupGridDailyResultDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GroupGridDailyResultDTO.java @@ -18,6 +18,11 @@ public class GroupGridDailyResultDTO implements Serializable { */ private String id; + /** + * 客户ID + */ + private String customerId; + /** * 机构ID 关联机关dim表 */ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/feign/StatsPublicityFeignClient.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/feign/DataStatisticalOpenFeignClient.java similarity index 60% rename from epmet-module/data-statistical/data-statistical-client/src/main/java/feign/StatsPublicityFeignClient.java rename to epmet-module/data-statistical/data-statistical-client/src/main/java/feign/DataStatisticalOpenFeignClient.java index f8a20e31cb..01c9953043 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/feign/StatsPublicityFeignClient.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/feign/DataStatisticalOpenFeignClient.java @@ -2,17 +2,19 @@ package feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; -import feign.impl.StatsPublicityFeignClientFallBack; +import feign.impl.DataStatisticalOpenFeignClientFallBack; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PostMapping; /** - * @Description 数据-宣传能力 -定时任务 - * @Author wangc - * @Date 2020/5/23 13:42 + * desc: 数据统计 对外feign client + * + * @return: + * @date: 2020/6/22 17:39 + * @author: jianjun liu */ -@FeignClient(name = ServiceConstant.DATA_STATISTICAL, fallback = StatsPublicityFeignClientFallBack.class) -public interface StatsPublicityFeignClient { +@FeignClient(name = ServiceConstant.DATA_STATISTICAL, fallback = DataStatisticalOpenFeignClientFallBack.class) +public interface DataStatisticalOpenFeignClient { /** * desc: 【日】统计文章总数及在线文章总数 包含 机关 部门 网格 @@ -34,13 +36,22 @@ public interface StatsPublicityFeignClient { Result tagUsedDailyStatsjob(); /** - * desc: 【月,季,年】 统计发表文章最多的分类 包含 机关 部门 网格 + * desc: 【月】 统计发表文章最多的分类 包含 机关 部门 网格 * * @date: 2020/6/22 9:09 * @author: jianjun liu */ - @PostMapping(value = "data/stats/statspublicity/tagUsedMonthStatsjob") - Result tagUsedMonthStatsjob(); + @PostMapping(value = "data/stats/statspublicity/tagUsedMonthlyStatsjob") + Result tagUsedMonthlyStatsjob(); + + /** + * desc: 【季,年】 统计发表文章最多的分类 包含 机关 部门 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @PostMapping(value = "data/stats/statspublicity/tagUsedQuarterlyStatsjob") + Result tagUsedQuarterlyStatsjob(); /** * desc: 【日】 统计阅读最多的标签 包含 机关 网格 @@ -49,16 +60,25 @@ public interface StatsPublicityFeignClient { * @author: jianjun liu */ @PostMapping(value = "data/stats/statspublicity/tagViewedDailyStatsjob") - Result tagViewedDayStatsjob(); + Result tagViewedDailyStatsjob(); + + /** + * desc: 【月】 统计阅读最多的标签 包含 机关 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @PostMapping(value = "data/stats/statspublicity/tagViewedMonthlyStatsjob") + Result tagViewedMonthlyStatsjob(); /** - * desc: 【月,季,年】 统计阅读最多的标签 包含 机关 网格 + * desc: 【季,年】 统计阅读最多的标签 包含 机关 网格 * * @date: 2020/6/22 9:09 * @author: jianjun liu */ - @PostMapping(value = "data/stats/statspublicity/tagViewedMonthStatsjob") - Result tagViewedMonthStatsjob(); + @PostMapping(value = "data/stats/statspublicity/tagViewedQuarterlyStatsjob") + Result tagViewedQuarterlyStatsjob(); /** * @Description 统计 “网格小组”, dim:【网格-日】 diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/feign/impl/StatsPublicityFeignClientFallBack.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/feign/impl/DataStatisticalOpenFeignClientFallBack.java similarity index 51% rename from epmet-module/data-statistical/data-statistical-client/src/main/java/feign/impl/StatsPublicityFeignClientFallBack.java rename to epmet-module/data-statistical/data-statistical-client/src/main/java/feign/impl/DataStatisticalOpenFeignClientFallBack.java index ec17c4a3e4..1ccec983eb 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/feign/impl/StatsPublicityFeignClientFallBack.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/feign/impl/DataStatisticalOpenFeignClientFallBack.java @@ -3,7 +3,7 @@ package feign.impl; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; -import feign.StatsPublicityFeignClient; +import feign.DataStatisticalOpenFeignClient; import org.springframework.stereotype.Component; /** @@ -15,7 +15,7 @@ import org.springframework.stereotype.Component; * email:liujianjun@git.elinkit.com.cn */ @Component -public class StatsPublicityFeignClientFallBack implements StatsPublicityFeignClient { +public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOpenFeignClient { /** * desc: 【日】统计文章总数及在线文章总数 包含 机关 部门 网格 @@ -25,7 +25,7 @@ public class StatsPublicityFeignClientFallBack implements StatsPublicityFeignCli */ @Override public Result articleSummaryDailyStatsjob() { - return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "articleSummaryDailyStatsjob"); + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "articleSummaryDailyStatsjob"); } /** @@ -37,18 +37,29 @@ public class StatsPublicityFeignClientFallBack implements StatsPublicityFeignCli */ @Override public Result tagUsedDailyStatsjob() { - return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "tagUsedDailyStatsjob"); + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "tagUsedDailyStatsjob"); } /** - * desc: 【月,季,年】 统计发表文章最多的分类 包含 机关 部门 网格 + * desc: 【月】 统计发表文章最多的分类 包含 机关 部门 网格 * * @date: 2020/6/22 9:09 * @author: jianjun liu */ @Override - public Result tagUsedMonthStatsjob() { - return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "tagUsedMonthStatsjob"); + public Result tagUsedMonthlyStatsjob() { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "tagUsedMonthlyStatsjob"); + } + + /** + * desc: 【季,年】 统计发表文章最多的分类 包含 机关 部门 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @Override + public Result tagUsedQuarterlyStatsjob() { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "tagUsedQuarterlyStatsjob"); } /** @@ -58,19 +69,30 @@ public class StatsPublicityFeignClientFallBack implements StatsPublicityFeignCli * @author: jianjun liu */ @Override - public Result tagViewedDayStatsjob() { - return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "tagViewedDayStatsjob"); + public Result tagViewedDailyStatsjob() { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "tagViewedDailyStatsjob"); + } + + /** + * desc: 【月】 统计阅读最多的标签 包含 机关 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @Override + public Result tagViewedMonthlyStatsjob() { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "tagViewedMonthlyStatsjob"); } /** - * desc: 【月,季,年】 统计阅读最多的标签 包含 机关 网格 + * desc: 【季,年】 统计阅读最多的标签 包含 机关 网格 * * @date: 2020/6/22 9:09 * @author: jianjun liu */ @Override - public Result tagViewedMonthStatsjob() { - return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "tagViewedMonthStatsjob"); + public Result tagViewedQuarterlyStatsjob() { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "tagViewedQuarterlyStatsjob"); } @Override diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index 74787dff5d..8bd8f152a9 100644 --- a/epmet-module/data-statistical/data-statistical-server/pom.xml +++ b/epmet-module/data-statistical/data-statistical-server/pom.xml @@ -62,6 +62,12 @@ epmet-commons-dynamic-datasource 2.0.0 + + com.epmet + epmet-user-client + 2.0.0 + compile + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsIssueController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsIssueController.java new file mode 100644 index 0000000000..850c3b7a75 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsIssueController.java @@ -0,0 +1,33 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.StatsIssueService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/22 14:26 + */ +@RequestMapping("statsissue") +@RestController +public class StatsIssueController { + @Autowired + private StatsIssueService statsIssueService; + + /** + * 议题统计 + * @author zhaoqifeng + * @date 2020/6/22 14:28 + * @param + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("issuestats") + public Result agencyGridIssueStats() { + statsIssueService.agencyGridIssueStats(); + return new Result(); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsPublicityController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsPublicityController.java index e55a29b36a..79ca1d0acf 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsPublicityController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsPublicityController.java @@ -56,6 +56,17 @@ public class StatsPublicityController { return new Result().ok(statsPublicityService.tagUsedMonthlyStatsjob(statsDate)); } + /** + * desc:【季,年】 统计发表文章最多的分类 包含 机关 部门 网格 + * + * @param statsDate 默认:为T-1天,如果传 则统计的是【statsDate】的数据 + * @return + */ + @PostMapping(value = "tagUsedQuarterlyStatsjob") + public Result tagUsedQuarterlyStatsjob(Date statsDate) { + return new Result().ok(statsPublicityService.tagUsedQuarterlyStatsjob(statsDate)); + } + /** * desc:【日】 统计阅读最多的标签 包含 机关 网格 * @@ -68,7 +79,7 @@ public class StatsPublicityController { } /** - * desc:【月,季,年】 统计阅读最多的标签 包含 机关 网格 + * desc:【月】 统计阅读最多的标签 包含 机关 网格 * * @param statsDate 默认:为T-1天,如果传 则统计的是【statsDate】的数据 * @return @@ -77,4 +88,15 @@ public class StatsPublicityController { public Result tagViewedMonthlyStatsjob(Date statsDate) { return new Result().ok(statsPublicityService.tagViewedMonthlyStatsjob(statsDate)); } + + /** + * desc:【季,年】 统计阅读最多的标签 包含 机关 网格 + * + * @param statsDate 默认:为T-1天,如果传 则统计的是【statsDate】的数据 + * @return + */ + @PostMapping(value = "tagViewedQuarterlyStatsjob") + public Result tagViewedQuarterlyStatsjob(Date statsDate) { + return new Result().ok(statsPublicityService.tagViewedQuarterlyStatsjob(statsDate)); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerGridDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerGridDao.java index 4b2c3621b3..846dde48e8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerGridDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerGridDao.java @@ -50,4 +50,12 @@ public interface CustomerGridDao extends BaseDao { * @author zxc */ List selectAgencyGridTotalCount(@Param("formDto") List formDto, @Param("dateId")String dateId); + + /** + * @Description 获取客户下某个时间点以前的网格ID + * @param customerId + * @param dateId + * @author zxc + */ + List getCustomerGridIdList(@Param("customerId") String customerId, @Param("dateId") String dateId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupAgencyDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupAgencyDailyDao.java index 853d8dea9d..4a41fe25a9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupAgencyDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupAgencyDailyDao.java @@ -62,6 +62,6 @@ public interface FactGroupAgencyDailyDao extends BaseDao * @param dateId * @author zxc */ - void deleteInsertDateId(@Param("dateId")String dateId); + void deleteInsertDateId(@Param("dateId")String dateId,@Param("customerId")String customerId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyDailyDao.java index 12569eb8cc..bb53792085 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyDailyDao.java @@ -19,7 +19,6 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.stats.FactTagUsedAgencyDailyEntity; -import com.epmet.entity.stats.FactTagUsedGridDailyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -43,5 +42,5 @@ public interface FactTagUsedAgencyDailyDao extends BaseDao getTagUsedCountByMonth(@Param("customerId") String customerId, @Param("monthId") String monthId); + List getTagUsedCountByMonth(@Param("customerId") String customerId, @Param("monthId") String monthId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimAgencyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimAgencyEntity.java index 2ca7c2a168..28b471f0a2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimAgencyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimAgencyEntity.java @@ -58,6 +58,11 @@ public class DimAgencyEntity extends BaseEpmetEntity { */ private String pids; + /** + * 机关维度类型。self:机关本身自己,all:机关自己+下级+网格+部门等 + */ + private String agencyDimType; + /** * 所有上级名称,以-连接 */ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsIssueService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsIssueService.java index 9f6884b829..5d0e6b4292 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsIssueService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsIssueService.java @@ -8,6 +8,15 @@ import java.util.Date; * @date 2020/6/17 16:51 */ public interface StatsIssueService { + /** + * 机关和网格议题统计 + * @author zhaoqifeng + * @date 2020/6/22 10:58 + * @param + * @return void + */ + void agencyGridIssueStats(); + /** * 机关下议题日统计 * @author zhaoqifeng diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsPublicityService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsPublicityService.java index 03b253a588..772d48e788 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsPublicityService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsPublicityService.java @@ -10,7 +10,6 @@ public interface StatsPublicityService { * @return: Boolean * @date: 2020/6/17 16:11 * @author: jianjun liu - * email:liujianjun@git.elinkit.com.cn */ Boolean articleSummaryDailyStatsjob(Date statsDate); @@ -20,7 +19,6 @@ public interface StatsPublicityService { * @return: Boolean * @date: 2020/6/17 16:11 * @author: jianjun liu - * email:liujianjun@git.elinkit.com.cn */ Boolean tagUsedDailyStatsjob(Date statsDate); @@ -31,10 +29,19 @@ public interface StatsPublicityService { * @return: * @date: 2020/6/19 18:44 * @author: jianjun liu - * email:liujianjun@git.elinkit.com.cn */ Boolean tagUsedMonthlyStatsjob(Date statsDate); + /** + * desc: 按季年统计标签被使用次数 + * + * @param statsDate + * @return: + * @date: 2020/6/20 10:44 + * @author: jianjun liu + */ + Boolean tagUsedQuarterlyStatsjob(Date statsDate); + /** * desc: 按日 统计每个标签的阅读数 * @@ -42,18 +49,26 @@ public interface StatsPublicityService { * @return: Boolean * @date: 2020/6/20 8:40 * @author: jianjun liu - * email:liujianjun@git.elinkit.com.cn */ Boolean tagViewedDailyStatsjob(Date statsDate); /** - * desc: + * desc: 按月统计标签被查看次数 * * @param statsDate * @return: * @date: 2020/6/20 10:44 * @author: jianjun liu - * email:liujianjun@git.elinkit.com.cn */ Boolean tagViewedMonthlyStatsjob(Date statsDate); + + /** + * desc: 按季年统计标签被查看次数 + * + * @param statsDate + * @return: + * @date: 2020/6/20 10:44 + * @author: jianjun liu + */ + Boolean tagViewedQuarterlyStatsjob(Date statsDate); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java index d938799b41..0aa22e72ec 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java @@ -47,6 +47,7 @@ public class GroupDataServiceImpl implements GroupDataService { BeanUtils.copyProperties(dimTime,dailyResult); dailyResult.setAgencyId(grid.getAgencyId()); dailyResult.setGridId(grid.getId()); + dailyResult.setCustomerId(customerId); result.add(dailyResult); }); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java index 4ba2b1492b..15ad3e0b3a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java @@ -9,6 +9,7 @@ import com.epmet.entity.stats.DimAgencyEntity; import com.epmet.entity.stats.DimGridEntity; import com.epmet.service.StatsGroupService; import com.epmet.service.group.GroupDataService; +import com.epmet.service.org.CustomerGridService; import com.epmet.service.stats.*; import com.epmet.util.DimIdGenerator; import com.epmet.util.ModuleConstant; @@ -21,6 +22,7 @@ import java.time.LocalDate; import java.time.ZoneId; import java.time.ZonedDateTime; import java.util.*; +import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; /** @@ -44,6 +46,8 @@ public class StatsGroupServiceImpl implements StatsGroupService { private FactGroupAgencyMonthlyService factGroupAgencyMonthlyService; @Autowired private DimCustomerService dimCustomerService; + @Autowired + private CustomerGridService customerGridService; /** * @Description 统计【网格-日】 @@ -62,7 +66,7 @@ public class StatsGroupServiceImpl implements StatsGroupService { DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(date); List gridsInfo = dimGridService.getGridListByCustomerId(customerId); List resultDTOS = groupDataService.groupGridDaily(customerId,dimIdBean,gridsInfo); - factGroupGridDailyService.statisticsGroupGridDaily(resultDTOS); + factGroupGridDailyService.statisticsGroupGridDaily(resultDTOS,customerId); }); } @@ -84,7 +88,7 @@ public class StatsGroupServiceImpl implements StatsGroupService { List customerAgencyInfos = dimAgencyService.getAgencyInfoByCustomerId(customerId); List agencyGroupDaily = this.getAgencyGroupDaily(customerAgencyInfos, dimIdBean, customerId); - factGroupAgencyDailyService.insertGroupAgencyDaily(agencyGroupDaily); + factGroupAgencyDailyService.insertGroupAgencyDaily(agencyGroupDaily,customerId); }); } @@ -125,13 +129,27 @@ public class StatsGroupServiceImpl implements StatsGroupService { AgencyGroupDailyResultDTO agencyResult = new AgencyGroupDailyResultDTO(); String agencyId = agency.getId(); agencyResult.setAgencyId(agencyId); + agencyResult.setCustomerId(customerId); BeanUtils.copyProperties(timeDim,agencyResult); //机关下的所有网格(包括直属网格) List allGrid = this.getAllGrid(agencyId); String pidByAgencyId = dimAgencyService.getPidByAgencyId(agencyId); agencyResult.setPid(StringUtils.isBlank(pidByAgencyId)?"0":pidByAgencyId); // TODO 1. 机关下有多少网格 - agencyResult.setGridTotal(allGrid.size()); + List customerGridIdList = customerGridService.getCustomerGridIdList(customerId, dateId); + AtomicReference gridSize = new AtomicReference<>(0); + if (customerGridIdList.size() != NumConstant.ZERO){ + customerGridIdList.forEach(gridId -> { + allGrid.forEach(allAgencyGrid -> { + if (gridId.equals(allAgencyGrid)){ + gridSize.updateAndGet(v -> v + NumConstant.ONE); + } + }); + }); + agencyResult.setGridTotal(gridSize.get()); + }else { + agencyResult.setGridTotal(NumConstant.ZERO); + } // TODO 2. 机关下有多少小组,只算 state = ‘approved’ List agencyGroupTotalCount = groupDataService.getAgencyGroupTotalCount(allGrid,dateId); @@ -157,9 +175,9 @@ public class StatsGroupServiceImpl implements StatsGroupService { agencyResult.setGroupMemberMinCount(sorted.get(NumConstant.ZERO).getGroupCount()); agencyResult.setMinMemberGroupId(sorted.get(NumConstant.ZERO).getGroupId()); }else if (sorted.size() >= NumConstant.TWO){ - groupPeopleMedian = sorted.size() % 2 == 0 ? - (sorted.get(sorted.size() / 2 - 1).getGroupCount() + sorted.get(sorted.size() / 2).getGroupCount()) / 2 : - sorted.get(sorted.size() / 2).getGroupCount(); + groupPeopleMedian = sorted.size() % NumConstant.TWO == NumConstant.ZERO ? + (sorted.get(sorted.size() / NumConstant.TWO - NumConstant.ONE).getGroupCount() + sorted.get(sorted.size() / 2).getGroupCount()) / 2 : + sorted.get(sorted.size() / NumConstant.TWO).getGroupCount(); agencyResult.setGroupMedian(groupPeopleMedian); agencyResult.setGroupMemberMaxCount(sorted.get(NumConstant.ZERO).getGroupCount()); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java index c300b22e46..6da113060e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java @@ -19,7 +19,9 @@ import com.epmet.service.project.ProjectService; import com.epmet.service.stats.*; import com.epmet.util.DimIdGenerator; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; import java.math.BigDecimal; import java.math.RoundingMode; @@ -33,6 +35,8 @@ import java.util.stream.Collectors; */ @Service public class StatsIssueServiceImpl implements StatsIssueService { + @Autowired + private DimCustomerService dimCustomerService; @Autowired private IssueService issueService; @Autowired @@ -46,8 +50,47 @@ public class StatsIssueServiceImpl implements StatsIssueService { @Autowired private FactIssueAgencyMonthlyService factIssueAgencyMonthlyService; @Autowired + private FactIssueGridDailyService factIssueGridDailyService; + @Autowired private FactIssueGridMonthlyService factIssueGridMonthlyService; + @Override + public void agencyGridIssueStats() { + int pageNo = 1; + int pageSize = 100; + List customerIdList = null; + do { + customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); + if (!CollectionUtils.isEmpty(customerIdList)) { + for (String customerId : customerIdList) { + //遍历统计每一个客户数据 + customerStats(customerId); + } + } + } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); + } + + /** + * 一个客户一个线程, 分别统计机关日/月数据和网格日/月数据 + * @author zhaoqifeng + * @date 2020/6/22 11:03 + * @param customerId + * @return void + */ + @Async + public void customerStats(String customerId) { + //获取当前日期前一天 + Date date = DateUtils.getBeforeDay(new Date()); + //机关议题日统计 + saveIssueAgencyDaily(customerId, date); + //机关议题月统计 + saveIssueAgencyMonthly(customerId, date); + //网格议题日统计 + saveIssueGridDaily(customerId, date); + //网格议题月统计 + saveIssueGridMonthly(customerId, date); + } + @Override public void saveIssueAgencyDaily(String customerId, Date date) { String dateString = DateUtils.format(date); @@ -216,9 +259,13 @@ public class StatsIssueServiceImpl implements StatsIssueService { totalList.stream().collect(Collectors.groupingBy(IssueProjectDTO::getStatus)); List resolveList = totalMap.get(IssueConstant.RESLOVED); List unResolveList = totalMap.get(IssueConstant.UNRESLOVED); - resolveMap = resolveList.stream().collect(Collectors.groupingBy(IssueProjectDTO:: getGridId, Collectors.counting())); - unResolveMap = unResolveList.stream().collect(Collectors.groupingBy(IssueProjectDTO:: getGridId, - Collectors.counting())); + if (null != resolveList) { + resolveMap = resolveList.stream().collect(Collectors.groupingBy(IssueProjectDTO:: getGridId, Collectors.counting())); + } + if (null != unResolveList) { + unResolveMap = unResolveList.stream().collect(Collectors.groupingBy(IssueProjectDTO:: getGridId, + Collectors.counting())); + } List incList = issueProjectList.stream().flatMap(ip -> closedProjectIncList.stream().filter(closed -> ip.getIssueId().equals(closed.getIssueId())).map(project -> { IssueProjectDTO dto = new IssueProjectDTO(); @@ -232,9 +279,13 @@ public class StatsIssueServiceImpl implements StatsIssueService { incList.stream().collect(Collectors.groupingBy(IssueProjectDTO::getStatus)); List resolveIncList = incMap.get(IssueConstant.RESLOVED); List unResolveIncList = incMap.get(IssueConstant.UNRESLOVED); - resolveIncMap = resolveIncList.stream().collect(Collectors.groupingBy(IssueProjectDTO:: getGridId, Collectors.counting())); - unResolveIncMap = unResolveIncList.stream().collect(Collectors.groupingBy(IssueProjectDTO:: getGridId, - Collectors.counting())); + if (null != resolveIncList) { + resolveIncMap = resolveIncList.stream().collect(Collectors.groupingBy(IssueProjectDTO:: getGridId, Collectors.counting())); + } + if (null != unResolveIncList) { + unResolveIncMap = unResolveIncList.stream().collect(Collectors.groupingBy(IssueProjectDTO:: getGridId, + Collectors.counting())); + } } List list = new ArrayList<>(); @@ -242,7 +293,8 @@ public class StatsIssueServiceImpl implements StatsIssueService { for (DimGridEntity grid : gridList) { FactIssueGridDailyEntity entity = initIssueGridDaily(dimId); entity.setCustomerId(grid.getCustomerId()); - entity.setAgencyId(grid.getId()); + entity.setAgencyId(grid.getAgencyId()); + entity.setGridId(grid.getId()); //总量统计 saveGridTotal(gridTotalList, grid, entity); //增量统计 @@ -259,8 +311,9 @@ public class StatsIssueServiceImpl implements StatsIssueService { } //已关闭项目已解决未解决统计 saveClosedProject(resolveMap, unResolveMap, resolveIncMap, unResolveIncMap, grid, entity); + list.add(entity); } - + factIssueGridDailyService.insertBatch(list); } @Override @@ -298,9 +351,13 @@ public class StatsIssueServiceImpl implements StatsIssueService { totalList.stream().collect(Collectors.groupingBy(IssueProjectDTO::getStatus)); List resolveList = totalMap.get(IssueConstant.RESLOVED); List unResolveList = totalMap.get(IssueConstant.UNRESLOVED); - resolveMap = resolveList.stream().collect(Collectors.groupingBy(IssueProjectDTO:: getGridId, Collectors.counting())); - unResolveMap = unResolveList.stream().collect(Collectors.groupingBy(IssueProjectDTO:: getGridId, - Collectors.counting())); + if (null != resolveList) { + resolveMap = resolveList.stream().collect(Collectors.groupingBy(IssueProjectDTO:: getGridId, Collectors.counting())); + } + if (null != unResolveList) { + unResolveMap = unResolveList.stream().collect(Collectors.groupingBy(IssueProjectDTO:: getGridId, + Collectors.counting())); + } } List list = new ArrayList<>(); @@ -325,12 +382,14 @@ public class StatsIssueServiceImpl implements StatsIssueService { monthly.setClosedCaseTotal(total); monthly.setClosedCaseResolvedTotal(resolve); monthly.setClosedCaseUnresolvedTotal(unResolve); - BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); - BigDecimal resolved = new BigDecimal(resolve); - BigDecimal unresolved = new BigDecimal(unResolve); - BigDecimal closed = new BigDecimal(total); - monthly.setClosedCaseResolvedPercent(resolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); - monthly.setClosedCaseUnresolvedPercent(unresolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); + if(total > NumConstant.ZERO) { + BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); + BigDecimal resolved = new BigDecimal(resolve); + BigDecimal unresolved = new BigDecimal(unResolve); + BigDecimal closed = new BigDecimal(total); + monthly.setClosedCaseResolvedPercent(resolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); + monthly.setClosedCaseUnresolvedPercent(unresolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); + } //各指标增量统计 for (int i = 0; i < gridMonthlyIncListList.size(); i++) { @@ -350,7 +409,7 @@ public class StatsIssueServiceImpl implements StatsIssueService { } monthly.setCustomerId(grid.getCustomerId()); - monthly.setAgencyId(grid.getId()); + monthly.setAgencyId(grid.getAgencyId()); monthly.setGridId(grid.getId()); list.add(monthly); } @@ -383,13 +442,14 @@ public class StatsIssueServiceImpl implements StatsIssueService { entity.setClosedCaseIncr(inc); entity.setClosedCaseResolvedIncr(resolveInc); entity.setClosedCaseUnresolvedIncr(unResolveInc); - - BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); - BigDecimal resolved = new BigDecimal(resolve); - BigDecimal unresolved = new BigDecimal(unResolve); - BigDecimal closed = new BigDecimal(total); - entity.setClosedCaseResolvedPercent(resolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); - entity.setClosedCaseUnresolvedPercent(unresolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); + if(total != NumConstant.ZERO) { + BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); + BigDecimal resolved = new BigDecimal(resolve); + BigDecimal unresolved = new BigDecimal(unResolve); + BigDecimal closed = new BigDecimal(total); + entity.setClosedCaseResolvedPercent(resolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); + entity.setClosedCaseUnresolvedPercent(unresolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); + } } /** @@ -452,13 +512,14 @@ public class StatsIssueServiceImpl implements StatsIssueService { } 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)); + if(entity.getClosedTotal() > NumConstant.ZERO) { + BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); + BigDecimal resolved = new BigDecimal(resolvedCount); + BigDecimal unresolved = new BigDecimal(unresolvedCount); + BigDecimal closed = new BigDecimal(entity.getClosedTotal()); + entity.setClosedResolvedPercent(resolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); + entity.setClosedUnresolvedPercent(unresolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); + } } /** @@ -744,13 +805,14 @@ public class StatsIssueServiceImpl implements StatsIssueService { } 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)); + if (entity.getClosedTotal() > NumConstant.ZERO) { + BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); + BigDecimal resolved = new BigDecimal(resolvedCount); + BigDecimal unresolved = new BigDecimal(unresolvedCount); + BigDecimal closed = new BigDecimal(entity.getClosedTotal()); + entity.setClosedResolvedPercent(resolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); + entity.setClosedUnresolvedPercent(unresolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); + } } /** diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java index c1c5505885..baadc98ac0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java @@ -13,7 +13,6 @@ import com.epmet.entity.voice.ArticleEntity; import com.epmet.entity.voice.ArticleTagsEntity; import com.epmet.service.StatsPublicityService; import com.epmet.service.stats.*; -import com.epmet.service.voice.ArticlePublishRangeService; import com.epmet.service.voice.ArticleService; import com.epmet.service.voice.ArticleTagsService; import com.epmet.service.voice.ArticleVisitRecordService; @@ -27,7 +26,6 @@ import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutorService; import java.util.stream.Collectors; @@ -44,16 +42,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { @Autowired private DimAgencyService dimAgencyService; @Autowired - private DimDateService dimDateService; - @Autowired - private DimWeekService dimWeekService; - @Autowired - private DimMonthService dimMonthService; - @Autowired - private DimQuarterService dimQuarterService; - @Autowired - private DimYearService dimYearService; - @Autowired private DimCustomerService dimCustomerService; @Autowired private DimGridService dimGridService; @@ -64,8 +52,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { @Autowired private ArticleService articleService; @Autowired - private ArticlePublishRangeService articlePublishRangeService; - @Autowired private ArticleVisitRecordService articleVisitRecordService; @Autowired private FactArticlePublishedGridDailyService factArticlePublishedGridDailyService; @@ -134,7 +120,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { if (!CollectionUtils.isEmpty(customerIdList)) { for (String customerId : customerIdList) { Date finalStatsDate = statsDate; - executorService.submit(() -> { + try { //key:所在机关Id Map agencySummaryMap = new HashMap<>(); @@ -144,7 +130,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { } catch (Exception e) { log.error("articlePublishedCountDayStats exception", e); } - }); + } } } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); @@ -193,7 +179,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { int pageNo = 1; int pageSize = 100; List customerIdList = null; - CountDownLatch countDownLatch = new CountDownLatch(1); do { customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); if (!CollectionUtils.isEmpty(customerIdList)) { @@ -201,29 +186,10 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { executorService.submit(() -> { try { statsTagUsedMonthly(dimIdBean.getMonthId(), customerId); - countDownLatch.countDown(); } catch (Exception e) { log.error("statsTagUsedMonthly exception", e); } }); - executorService.submit(() -> { - try { - countDownLatch.await(); - log.debug("start === statsTagUsedQuarterly "); - statsTagUsedQuarterly(dimIdBean.getQuarterId(), customerId); - } catch (Exception e) { - log.error("statsTagUsedQuarterly exception", e); - } - }); - executorService.submit(() -> { - try { - countDownLatch.await(); - log.debug("start === statsTagUsedQuarterly "); - statsTagUsedYearly(dimIdBean.getYearId(), customerId); - } catch (Exception e) { - log.error("statsTagUsedYearly exception", e); - } - }); } } } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); @@ -272,26 +238,81 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { int pageNo = 1; int pageSize = 100; List customerIdList = null; - CountDownLatch countDownLatch = new CountDownLatch(1); do { customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); if (!CollectionUtils.isEmpty(customerIdList)) { for (String customerId : customerIdList) { - if (!"6c8cfc2c14afeb6d3664b3e283fc9074".equals(customerId)) { - continue; - } executorService.submit(() -> { try { statsTagViewedMonthly(dimIdBean.getMonthId(), customerId); - countDownLatch.countDown(); } catch (Exception e) { log.error("statsTagViewedMonthly exception", e); } }); + } + } + } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); + return true; + } + @Override + public Boolean tagUsedQuarterlyStatsjob(Date statsDate) { + //如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和 + if (statsDate == null) { + //当天的凌晨时间 即为今天之前的数据 + statsDate = DateUtils.integrate(new Date(), DateUtils.DATE_PATTERN); + } else { + statsDate = DateUtils.integrate(DateUtils.addDateDays(statsDate, 1), DateUtils.DATE_PATTERN); + } + DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate); + int pageNo = 1; + int pageSize = 100; + List customerIdList = null; + do { + customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); + if (!CollectionUtils.isEmpty(customerIdList)) { + for (String customerId : customerIdList) { + executorService.submit(() -> { + try { + log.debug("start === statsTagUsedQuarterly "); + statsTagUsedQuarterly(dimIdBean.getQuarterId(), customerId); + } catch (Exception e) { + log.error("statsTagUsedQuarterly exception", e); + } + }); + executorService.submit(() -> { + try { + log.debug("start === statsTagUsedQuarterly "); + statsTagUsedYearly(dimIdBean.getYearId(), customerId); + } catch (Exception e) { + log.error("statsTagUsedYearly exception", e); + } + }); + } + } + } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); + return true; + } + + @Override + public Boolean tagViewedQuarterlyStatsjob(Date statsDate) { + //如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和 + if (statsDate == null) { + //当天的凌晨时间 即为今天之前的数据 + statsDate = DateUtils.integrate(new Date(), DateUtils.DATE_PATTERN); + } else { + statsDate = DateUtils.integrate(DateUtils.addDateDays(statsDate, 1), DateUtils.DATE_PATTERN); + } + DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate); + int pageNo = 1; + int pageSize = 100; + List customerIdList = null; + do { + customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); + if (!CollectionUtils.isEmpty(customerIdList)) { + for (String customerId : customerIdList) { executorService.submit(() -> { try { - countDownLatch.await(); log.debug("start === statsTagViewedQuarterly "); statsTagViewedQuarterly(dimIdBean.getQuarterId(), customerId); } catch (Exception e) { @@ -300,7 +321,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { }); executorService.submit(() -> { try { - countDownLatch.await(); log.debug("start === statsTagViewedYearly "); statsTagViewedYearly(dimIdBean.getYearId(), customerId); } catch (Exception e) { @@ -320,25 +340,27 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { log.warn("publicitySummary getDepartmentListByCustomerId return empty,customerId:{}", customerId); return; } - //转换为 需要插入的Entity - Map departmentDailyEntityMap = convertDepartmentDailyEntity(departmentDTOList, dimIdBean); - //获取当天的业务数据 - List publishedArticleCount = articleService.getAllDepartmentPublishedCount(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; + executorService.submit(()->{ + //转换为 需要插入的Entity + Map departmentDailyEntityMap = convertDepartmentDailyEntity(departmentDTOList, dimIdBean); + //获取当天的业务数据 + List publishedArticleCount = articleService.getAllDepartmentPublishedCount(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); } - gridDailyEntities.setArticleTotalCount(summaryDTO.getArticleTotalCount()); - gridDailyEntities.setArticlePublishedCount(summaryDTO.getArticlePublishedCount()); - //同一个机关下数据累加 - buildAgencySummaryData(agencySummaryMap, summaryDTO); } - } - boolean b = factArticlePublishedDepartmentDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), departmentDailyEntityMap.values()); + boolean b = factArticlePublishedDepartmentDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), departmentDailyEntityMap.values()); + }); } /** @@ -374,33 +396,33 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { * @param agencySummaryMap */ private void statsPublishedGridDaily(Date statsDate, DimIdGenerator.DimIdBean dimIdBean, String customerId, Map agencySummaryMap) { - //key:所在机关Id - Map result = new HashMap<>(); //获取所有网格 List gridDTOList = dimGridService.getGridListByCustomerId(customerId); if (CollectionUtils.isEmpty(gridDTOList)) { log.warn("publicitySummary getGridListByCustomerId return empty,customerId:{}", customerId); return; } - - //转换为 需要插入的Entity - Map gridDailyEntityMap = convertGridDailyEntity(gridDTOList, dimIdBean); - //获取当天的业务数据 - List publishedArticleCount = articleService.getAllGridPublishedCount(customerId, statsDate); - if (!CollectionUtils.isEmpty(publishedArticleCount)) { - for (ArticleGridPublishedSummaryDTO summaryDTO : publishedArticleCount) { - FactArticlePublishedGridDailyEntity gridDailyEntity = gridDailyEntityMap.get(summaryDTO.getGridId()); - if (gridDailyEntity == null) { - log.error("publicitySummary getAllGridPublishedCount gridId:{} not exist in dimGrid", summaryDTO.getGridId()); - continue; + executorService.submit(()->{ + //转换为 需要插入的Entity + Map gridDailyEntityMap = convertGridDailyEntity(gridDTOList, dimIdBean); + //获取当天的业务数据 + List publishedArticleCount = articleService.getAllGridPublishedCount(customerId, statsDate); + if (!CollectionUtils.isEmpty(publishedArticleCount)) { + for (ArticleGridPublishedSummaryDTO summaryDTO : publishedArticleCount) { + FactArticlePublishedGridDailyEntity gridDailyEntity = gridDailyEntityMap.get(summaryDTO.getGridId()); + if (gridDailyEntity == null) { + log.error("publicitySummary getAllGridPublishedCount gridId:{} not exist in dimGrid", summaryDTO.getGridId()); + continue; + } + gridDailyEntity.setArticleTotalCount(summaryDTO.getArticleTotalCount()); + gridDailyEntity.setArticlePublishedCount(summaryDTO.getArticlePublishedCount()); + //同一个机关下数据累加 + buildAgencySummaryData(agencySummaryMap, summaryDTO); } - gridDailyEntity.setArticleTotalCount(summaryDTO.getArticleTotalCount()); - gridDailyEntity.setArticlePublishedCount(summaryDTO.getArticlePublishedCount()); - //同一个机关下数据累加 - buildAgencySummaryData(agencySummaryMap, summaryDTO); } - } - boolean b = factArticlePublishedGridDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), gridDailyEntityMap.values()); + boolean b = factArticlePublishedGridDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), gridDailyEntityMap.values()); + }); + } private void statsPublishedAgencyDaily(Date statsDate, DimIdGenerator.DimIdBean dimIdBean, String customerId, Map agencySummaryMap) { @@ -410,40 +432,43 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { log.warn("publicitySummary getAgencyListByCustomerId return empty,customerId:{}", customerId); return; } - //转换为 需要插入的Entity - Map agencyDailyEntityMap = convertAgencyDailyEntity(agencyDTOList, dimIdBean); - //获取当天的业务数据 - List publishedArticleCount = articleService.getAllAgencyPublishedCount(customerId, statsDate); - Map haveDataAgencyDailyMap = new HashMap<>(); - if (!CollectionUtils.isEmpty(publishedArticleCount)) { - for (ArticleGridPublishedSummaryDTO summaryDTO : publishedArticleCount) { - FactArticlePublishedAgencyDailyEntity gridDailyEntities = agencyDailyEntityMap.get(summaryDTO.getPublisherId()); - if (gridDailyEntities == null) { - log.error("publicitySummary bizData departmentId:{} not exist in dimDepartment", summaryDTO.getGridId()); - continue; + executorService.submit(()->{ + //转换为 需要插入的Entity + Map agencyDailyEntityMap = convertAgencyDailyEntity(agencyDTOList, dimIdBean); + //获取当天的业务数据 + List publishedArticleCount = articleService.getAllAgencyPublishedCount(customerId, statsDate); + Map haveDataAgencyDailyMap = new HashMap<>(); + if (!CollectionUtils.isEmpty(publishedArticleCount)) { + for (ArticleGridPublishedSummaryDTO summaryDTO : publishedArticleCount) { + FactArticlePublishedAgencyDailyEntity gridDailyEntities = agencyDailyEntityMap.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); + haveDataAgencyDailyMap.put(summaryDTO.getAgencyId(), gridDailyEntities); } - gridDailyEntities.setArticleTotalCount(summaryDTO.getArticleTotalCount()); - gridDailyEntities.setArticlePublishedCount(summaryDTO.getArticlePublishedCount()); - //同一个机关下数据累加 - buildAgencySummaryData(agencySummaryMap, summaryDTO); - haveDataAgencyDailyMap.put(summaryDTO.getAgencyId(), gridDailyEntities); } - } - //数据向上级机关添加 - if (!CollectionUtils.isEmpty(haveDataAgencyDailyMap)) { - for (Map.Entry entry : haveDataAgencyDailyMap.entrySet()) { - String agencyId = entry.getKey(); - FactArticlePublishedAgencyDailyEntity summary = entry.getValue(); - FactArticlePublishedAgencyDailyEntity dailyEntity = agencyDailyEntityMap.get(agencyId); - if (dailyEntity == null) { - log.error("publicitySummary bizData agencyId:{} not exist in dimAgency", agencyId); - continue; + //数据向上级机关添加 + if (!CollectionUtils.isEmpty(haveDataAgencyDailyMap)) { + for (Map.Entry entry : haveDataAgencyDailyMap.entrySet()) { + String agencyId = entry.getKey(); + FactArticlePublishedAgencyDailyEntity summary = entry.getValue(); + FactArticlePublishedAgencyDailyEntity dailyEntity = agencyDailyEntityMap.get(agencyId); + if (dailyEntity == null) { + log.error("publicitySummary bizData agencyId:{} not exist in dimAgency", agencyId); + continue; + } + setPublishedData2ParentAgency(agencyDailyEntityMap, summary, dailyEntity); } - setPublishedData2ParentAgency(agencyDailyEntityMap, summary, dailyEntity); } - } - boolean b = factArticlePublishedAgencyDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), agencyDailyEntityMap.values()); + boolean b = factArticlePublishedAgencyDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), agencyDailyEntityMap.values()); + }); + } /** @@ -502,6 +527,9 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { case ProjectConstant.PUBLISHER_TYPE_DEPT: convertTagUsedDepartmentDailyEntity(tagUsedDeptDailyMap, articleEntity, tagEntity, dimIdBean); break; + case ProjectConstant.PUBLISHER_TYPE_AGENCY: + convertTagUsedAgencyDailyEntity(dimAgencyEntity.getPid(), tagUsedAgencyDailyMap, articleEntity, tagEntity, dimIdBean); + break; } } @@ -511,7 +539,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { Map finalTagUsedAgencyDailyMap = new HashMap<>(); finalTagUsedAgencyDailyMap.putAll(tagUsedAgencyDailyMap); for (Map.Entry entry : tagUsedAgencyDailyMap.entrySet()) { - String agencyId = entry.getKey(); + String agencyId = entry.getKey().split(StrConstant.UNDER_LINE)[0]; FactTagUsedAgencyDailyEntity currentEntity = entry.getValue(); DimAgencyEntity dimAgencyEntity = dimAgencyEntityMap.get(currentEntity.getAgencyId()); if (dimAgencyEntity == null) { @@ -616,7 +644,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { List gridMonthlyList = ConvertUtils.sourceToTarget(deptDailyList, FactTagUsedDepartmentMonthlyEntity.class); factTagUsedDepartmentMonthlyService.deleteAndInsertByMonthId(customerId, monthId, gridMonthlyList); } - List agencyDailyList = factTagUsedAgencyDailyService.getTagUsedCountByMonth(customerId, monthId); + List agencyDailyList = factTagUsedAgencyDailyService.getTagUsedCountByMonth(customerId, monthId); if (!CollectionUtils.isEmpty(agencyDailyList)) { List agencyMonthlyList = ConvertUtils.sourceToTarget(agencyDailyList, FactTagUsedAgencyMonthlyEntity.class); factTagUsedAgencyMonthlyService.deleteAndInsertByMonthId(customerId, monthId, (agencyMonthlyList)); @@ -923,15 +951,15 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { } private void convertTagUsedAgencyDailyEntity(String pid, Map result, ArticleEntity articleEntity, ArticleTagsEntity tagEntity, DimIdGenerator.DimIdBean dimIdBean) { - String publisherId = articleEntity.getPublisherId(); + String agencyId = articleEntity.getOrgId(); String tagId = tagEntity.getTagId(); - String key = publisherId.concat(StrConstant.UNDER_LINE).concat(tagId); + String key = agencyId.concat(StrConstant.UNDER_LINE).concat(tagId); FactTagUsedAgencyDailyEntity entity = result.get(key); if (entity == null) { entity = ConvertUtils.sourceToTarget(dimIdBean, FactTagUsedAgencyDailyEntity.class); entity.setPid(pid); entity.setCustomerId(articleEntity.getCustomerId()); - entity.setAgencyId(publisherId); + entity.setAgencyId(agencyId); entity.setTagId(tagId); entity.setTagName(tagEntity.getTagName()); entity.setUsedCount(1); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerGridService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerGridService.java index 2c7c0f523c..cd82c81628 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerGridService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerGridService.java @@ -23,4 +23,12 @@ public interface CustomerGridService { * @author zxc */ List selectAgencyGridTotalCount(List community, String dateId); + + /** + * @Description 获取客户下某个时间点以前的网格ID + * @param customerId + * @param dateId + * @author zxc + */ + List getCustomerGridIdList(String customerId,String dateId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerGridServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerGridServiceImpl.java index 3e2c071400..d3e7a51087 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerGridServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerGridServiceImpl.java @@ -34,4 +34,15 @@ public class CustomerGridServiceImpl implements CustomerGridService { public List selectAgencyGridTotalCount(List community, String dateId) { return customerGridDao.selectAgencyGridTotalCount(community,dateId); } + + /** + * @Description 获取客户下某个时间点以前的网格ID + * @param customerId + * @param dateId + * @author zxc + */ + @Override + public List getCustomerGridIdList(String customerId, String dateId) { + return customerGridDao.getCustomerGridIdList(customerId, dateId); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupAgencyDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupAgencyDailyService.java index ba2eced61e..913525715a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupAgencyDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupAgencyDailyService.java @@ -24,7 +24,6 @@ import com.epmet.dto.group.result.AgencyGroupDailyResultDTO; import com.epmet.dto.group.result.AgencyGroupMonthlyResultDTO; import com.epmet.dto.stats.FactGroupAgencyDailyDTO; import com.epmet.entity.stats.FactGroupAgencyDailyEntity; -import org.apache.ibatis.annotations.Param; import java.util.List; import java.util.Map; @@ -102,7 +101,7 @@ public interface FactGroupAgencyDailyService extends BaseService agencyList); + void insertGroupAgencyDaily(List agencyList,String customerId); /** * @Description 获取 网格小组【机关-日统计】的最后一天数据 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupGridDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupGridDailyService.java index b8e1ad06ab..bcf2157ecd 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupGridDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupGridDailyService.java @@ -99,5 +99,5 @@ public interface FactGroupGridDailyService extends BaseService formDto); + void statisticsGroupGridDaily(List formDto,String customerId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyDailyService.java index 1dfa4bd1f3..da57ca03b9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyDailyService.java @@ -46,5 +46,5 @@ public interface FactTagUsedAgencyDailyService extends BaseService getTagUsedCountByMonth(String customerId, String monthId); + List getTagUsedCountByMonth(String customerId, String monthId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java index 16e627c42c..ef1c918895 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java @@ -25,6 +25,7 @@ import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.constant.DimAgencyConstant; import com.epmet.constant.RobotConstant; import com.epmet.constant.StatsSubject; import com.epmet.dao.stats.DimAgencyDao; @@ -44,7 +45,6 @@ import java.util.Arrays; import java.util.Date; import java.util.List; import java.util.Map; -import java.util.stream.Collectors; /** * 机关维度 @@ -125,22 +125,47 @@ public class DimAgencyServiceImpl extends BaseServiceImpl agencies) { for (CustomerAgencyEntity agency : agencies) { - DimAgencyEntity dimAgencyEntity = new DimAgencyEntity(); - dimAgencyEntity.setAgencyName(agency.getOrganizationName()); - dimAgencyEntity.setAllParentName(agency.getAllParentName()); - dimAgencyEntity.setCustomerId(agency.getCustomerId()); - dimAgencyEntity.setLevel(agency.getLevel()); - dimAgencyEntity.setPid(agency.getPid()); - dimAgencyEntity.setPids(agency.getPids()); - dimAgencyEntity.setCreatedBy(RobotConstant.DIMENSION_ROBOT); - dimAgencyEntity.setUpdatedBy(RobotConstant.DIMENSION_ROBOT); - dimAgencyEntity.setId(agency.getId()); - baseDao.insert(dimAgencyEntity); + initAgencyAllDim(agency); + initAgencySelfDim(agency); } lastExecRecordDao.updateExecTimeBySubject(new Date(), StatsSubject.DIM_AGENCY); } + public void initAgencyAllDim(CustomerAgencyEntity agency) { + DimAgencyEntity dimAgencyEntity = new DimAgencyEntity(); + dimAgencyEntity.setAgencyName(agency.getOrganizationName()); + dimAgencyEntity.setAllParentName(agency.getAllParentName()); + dimAgencyEntity.setCustomerId(agency.getCustomerId()); + dimAgencyEntity.setLevel(agency.getLevel()); + dimAgencyEntity.setAgencyDimType(DimAgencyConstant.TYPE_ALL); + dimAgencyEntity.setPid(agency.getPid()); + dimAgencyEntity.setPids(agency.getPids()); + dimAgencyEntity.setCreatedBy(RobotConstant.DIMENSION_ROBOT); + dimAgencyEntity.setUpdatedBy(RobotConstant.DIMENSION_ROBOT); + dimAgencyEntity.setId(agency.getId()); + baseDao.insert(dimAgencyEntity); + } + + /** + * 初始化机关单位本身的维度(不包含本身) + * @param agency + */ + public void initAgencySelfDim(CustomerAgencyEntity agency) { + DimAgencyEntity dimAgencyEntity = new DimAgencyEntity(); + dimAgencyEntity.setAgencyName(agency.getOrganizationName()); + dimAgencyEntity.setAllParentName(agency.getAllParentName()); + dimAgencyEntity.setCustomerId(agency.getCustomerId()); + dimAgencyEntity.setLevel(agency.getLevel()); + dimAgencyEntity.setPid(agency.getId()); + dimAgencyEntity.setAgencyDimType(DimAgencyConstant.TYPE_SELF); + dimAgencyEntity.setPids(agency.getPids().concat(":").concat(agency.getId())); + dimAgencyEntity.setCreatedBy(RobotConstant.DIMENSION_ROBOT); + dimAgencyEntity.setUpdatedBy(RobotConstant.DIMENSION_ROBOT); + dimAgencyEntity.setId(agency.getId().concat(DimAgencyConstant.TYPE_SELF_ID_SUFFIX)); + baseDao.insert(dimAgencyEntity); + } + /** * @Description 查询所有机关以及它下级机关的信息 * @param diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyDailyServiceImpl.java index f04d3dfe83..6dd5a0705b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyDailyServiceImpl.java @@ -109,9 +109,9 @@ public class FactGroupAgencyDailyServiceImpl extends BaseServiceImpl agencyList) { + public void insertGroupAgencyDaily(List agencyList,String customerId) { if (agencyList.size() != NumConstant.ZERO){ - baseDao.deleteInsertAgencyDailyByDateId(agencyList.get(NumConstant.ZERO).getDateId()); + baseDao.deleteInsertAgencyDailyByDateId(agencyList.get(NumConstant.ZERO).getDateId(),customerId); baseDao.insertGroupAgencyDaily(agencyList); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupGridDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupGridDailyServiceImpl.java index 6e7fdaa64c..6556ba92b6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupGridDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupGridDailyServiceImpl.java @@ -111,12 +111,12 @@ public class FactGroupGridDailyServiceImpl extends BaseServiceImpl formDto) { + public void statisticsGroupGridDaily(List formDto,String customerId) { if (formDto.size() == NumConstant.ZERO){ return; } String dateId = formDto.get(NumConstant.ZERO).getDateId(); - baseDao.deleteInsertDateId(dateId); + baseDao.deleteInsertDateId(dateId,customerId); baseDao.insertGroupGridDaily(formDto); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyDailyServiceImpl.java index 97961d6b0b..7eef72f9d7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyDailyServiceImpl.java @@ -56,7 +56,7 @@ public class FactTagUsedAgencyDailyServiceImpl extends BaseServiceImpl getTagUsedCountByMonth(String customerId, String monthId) { + public List getTagUsedCountByMonth(String customerId, String monthId) { if (StringUtils.isBlank(customerId) || StringUtils.isBlank(monthId)){ throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.2__dim_ag_add_col_type.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.2__dim_ag_add_col_type.sql new file mode 100644 index 0000000000..9f1554015e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.2__dim_ag_add_col_type.sql @@ -0,0 +1 @@ +ALTER TABLE dim_agency ADD COLUMN AGENCY_DIM_TYPE VARCHAR(10) NOT NULL COMMENT '机关维度类型。self:机关本身自己,all:机关自己+下级+网格+部门等'; \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/data_statistical.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/data_statistical.sql index f188d95e6a..cd25dce6a9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/data_statistical.sql +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/data_statistical.sql @@ -3,17 +3,17 @@ /* Navicat Premium Data Transfer - Source Server : localhost + Source Server : 亿联 Source Server Type : MySQL - Source Server Version : 50720 - Source Host : localhost:3306 - Source Schema : pd + Source Server Version : 50728 + Source Host : 192.168.1.130:3306 + Source Schema : epmet_data_statistical Target Server Type : MySQL - Target Server Version : 50720 + Target Server Version : 50728 File Encoding : 65001 - Date: 16/06/2020 18:04:53 + Date: 22/06/2020 16:40:46 */ SET NAMES utf8mb4; @@ -44,10 +44,6 @@ CREATE TABLE `fact_article_published_agency_daily` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文章发布数量【机关】日统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_article_published_agency_daily --- ---------------------------- - -- ---------------------------- -- Table structure for fact_article_published_department_daily -- ---------------------------- @@ -73,10 +69,6 @@ CREATE TABLE `fact_article_published_department_daily` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文章发布数量【部门】日统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_article_published_department_daily --- ---------------------------- - -- ---------------------------- -- Table structure for fact_article_published_grid_daily -- ---------------------------- @@ -102,10 +94,6 @@ CREATE TABLE `fact_article_published_grid_daily` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文章发布数量【网格】日统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_article_published_grid_daily --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_used_agency_daily -- ---------------------------- @@ -132,10 +120,6 @@ CREATE TABLE `fact_tag_used_agency_daily` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【机关】日统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_used_agency_daily --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_used_agency_monthly -- ---------------------------- @@ -149,6 +133,8 @@ CREATE TABLE `fact_tag_used_agency_monthly` ( `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', `USED_COUNT` int(11) NULL DEFAULT NULL COMMENT '标签使用次数 标签的使用次数', `MONTH_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '月份ID 月份ID eg:202006 = 2020年6月、202007 = 2020年7月', + `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', @@ -158,10 +144,6 @@ CREATE TABLE `fact_tag_used_agency_monthly` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【机关】月统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_used_agency_monthly --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_used_agency_quarterly -- ---------------------------- @@ -175,6 +157,7 @@ CREATE TABLE `fact_tag_used_agency_quarterly` ( `TAG_NAME` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', `USED_COUNT` int(11) NULL DEFAULT NULL COMMENT '标签使用次数 标签的使用次数', `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', @@ -184,10 +167,6 @@ CREATE TABLE `fact_tag_used_agency_quarterly` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【机关】季度统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_used_agency_quarterly --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_used_agency_yearly -- ---------------------------- @@ -210,10 +189,6 @@ CREATE TABLE `fact_tag_used_agency_yearly` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【机关】年度统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_used_agency_yearly --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_used_department_daily -- ---------------------------- @@ -241,10 +216,6 @@ CREATE TABLE `fact_tag_used_department_daily` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【部门】日统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_used_department_daily --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_used_department_monthly -- ---------------------------- @@ -258,6 +229,8 @@ CREATE TABLE `fact_tag_used_department_monthly` ( `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', `USED_COUNT` int(11) NULL DEFAULT NULL COMMENT '标签使用次数 标签的使用次数', `MONTH_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '月份ID 月份ID eg:202006 = 2020年6月、202007 = 2020年7月', + `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', @@ -267,10 +240,6 @@ CREATE TABLE `fact_tag_used_department_monthly` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【部门】月统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_used_department_monthly --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_used_department_quarterly -- ---------------------------- @@ -284,6 +253,7 @@ CREATE TABLE `fact_tag_used_department_quarterly` ( `TAG_NAME` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', `USED_COUNT` int(11) NULL DEFAULT NULL COMMENT '标签使用次数 标签的使用次数', `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', @@ -293,10 +263,6 @@ CREATE TABLE `fact_tag_used_department_quarterly` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【部门】季度统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_used_department_quarterly --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_used_department_yearly -- ---------------------------- @@ -319,10 +285,6 @@ CREATE TABLE `fact_tag_used_department_yearly` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【部门】年度统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_used_department_yearly --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_used_grid_daily -- ---------------------------- @@ -349,10 +311,6 @@ CREATE TABLE `fact_tag_used_grid_daily` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【网格】日统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_used_grid_daily --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_used_grid_monthly -- ---------------------------- @@ -366,6 +324,8 @@ CREATE TABLE `fact_tag_used_grid_monthly` ( `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', `USED_COUNT` int(11) NULL DEFAULT NULL COMMENT '标签使用次数 标签的使用次数', `MONTH_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '月份ID 月份ID eg:2020-06 = 2020年6月、2020-07 = 2020年7月', + `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', @@ -375,10 +335,6 @@ CREATE TABLE `fact_tag_used_grid_monthly` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【网格】月统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_used_grid_monthly --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_used_grid_quarterly -- ---------------------------- @@ -392,6 +348,7 @@ CREATE TABLE `fact_tag_used_grid_quarterly` ( `TAG_NAME` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', `USED_COUNT` int(11) NULL DEFAULT NULL COMMENT '标签使用次数 标签的使用次数', `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', @@ -401,10 +358,6 @@ CREATE TABLE `fact_tag_used_grid_quarterly` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【网格】季度统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_used_grid_quarterly --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_used_grid_yearly -- ---------------------------- @@ -427,10 +380,6 @@ CREATE TABLE `fact_tag_used_grid_yearly` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【网格】年度统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_used_grid_yearly --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_viewed_agency_daily -- ---------------------------- @@ -457,10 +406,6 @@ CREATE TABLE `fact_tag_viewed_agency_daily` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文章引用标签阅读数量【机关】日统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_viewed_agency_daily --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_viewed_agency_monthly -- ---------------------------- @@ -474,6 +419,8 @@ CREATE TABLE `fact_tag_viewed_agency_monthly` ( `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', `TAG_READ_COUNT` int(11) NULL DEFAULT NULL COMMENT '文章引用标签阅读数 文章引用标签阅读数', `MONTH_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '月份ID 月份ID eg:2020-06 = 2020年6月、2020-07 = 2020年7月', + `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', @@ -483,10 +430,6 @@ CREATE TABLE `fact_tag_viewed_agency_monthly` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文章引用标签阅读数量【机关】月统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_viewed_agency_monthly --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_viewed_agency_quarterly -- ---------------------------- @@ -500,6 +443,7 @@ CREATE TABLE `fact_tag_viewed_agency_quarterly` ( `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', `TAG_READ_COUNT` int(11) NULL DEFAULT NULL COMMENT '文章引用标签阅读数 文章引用标签阅读数', `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', @@ -509,10 +453,6 @@ CREATE TABLE `fact_tag_viewed_agency_quarterly` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文章引用标签阅读数量【机关】季度统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_viewed_agency_quarterly --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_viewed_agency_yearly -- ---------------------------- @@ -535,10 +475,6 @@ CREATE TABLE `fact_tag_viewed_agency_yearly` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文章引用标签阅读数量【机关】年度统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_viewed_agency_yearly --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_viewed_grid_daily -- ---------------------------- @@ -565,10 +501,6 @@ CREATE TABLE `fact_tag_viewed_grid_daily` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文章引用标签阅读数量【网格】日统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_viewed_grid_daily --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_viewed_grid_monthly -- ---------------------------- @@ -582,6 +514,8 @@ CREATE TABLE `fact_tag_viewed_grid_monthly` ( `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', `TAG_READ_COUNT` int(11) NULL DEFAULT NULL COMMENT '文章引用标签阅读数 文章引用标签阅读数', `MONTH_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '月份ID 月份ID eg:2020-06 = 2020年6月、2020-07 = 2020年7月', + `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', @@ -591,10 +525,6 @@ CREATE TABLE `fact_tag_viewed_grid_monthly` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文章引用标签阅读数量【网格】月统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_viewed_grid_monthly --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_viewed_grid_quarterly -- ---------------------------- @@ -608,6 +538,7 @@ CREATE TABLE `fact_tag_viewed_grid_quarterly` ( `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', `TAG_READ_COUNT` int(11) NULL DEFAULT NULL COMMENT '文章引用标签阅读数 文章引用标签阅读数', `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', @@ -617,10 +548,6 @@ CREATE TABLE `fact_tag_viewed_grid_quarterly` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文章引用标签阅读数量【网格】季度统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_viewed_grid_quarterly --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_viewed_grid_yearly -- ---------------------------- @@ -643,8 +570,5 @@ CREATE TABLE `fact_tag_viewed_grid_yearly` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文章引用标签阅读数量【网格】年度统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_viewed_grid_yearly --- ---------------------------- - SET FOREIGN_KEY_CHECKS = 1; + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml index e31a36a40a..0eb2f74b45 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml @@ -34,4 +34,16 @@ AND DATE_FORMAT(CREATED_TIME,'%Y-%m-%d') #{dateId} + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyDailyDao.xml index 90bcc53b5d..d2ef1b2a30 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyDailyDao.xml @@ -32,13 +32,14 @@ INSERT INTO fact_group_agency_daily ( - ID, AGENCY_ID, PID, DATE_ID, WEEK_ID, MONTH_ID, QUARTER_ID, YEAR_ID, GRID_TOTAL, GROUP_TOTAL_COUNT, GROUP_MEMBER_TOTAL_COUNT, + ID, CUSTOMER_ID, AGENCY_ID, PID, DATE_ID, WEEK_ID, MONTH_ID, QUARTER_ID, YEAR_ID, GRID_TOTAL, GROUP_TOTAL_COUNT, GROUP_MEMBER_TOTAL_COUNT, GROUP_MEMBER_AVG_COUNT, GROUP_MEDIAN, GROUP_INCR, GROUP_MEMBER_MAX_COUNT, MAX_MEMBER_GROUP_ID, GROUP_MEMBER_MIN_COUNT, MIN_MEMBER_GROUP_ID, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME) values ( REPLACE(UUID(),'-',''), + #{agency.customerId}, #{agency.agencyId}, #{agency.pid}, #{agency.dateId}, @@ -70,6 +71,7 @@ - + DELETE FROM fact_group_agency_daily WHERE date_id = #{dateId} + AND customer_id = #{customerId} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyMonthlyDao.xml index 35242c9a0e..cb0187485f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyMonthlyDao.xml @@ -30,7 +30,7 @@ INSERT INTO fact_group_agency_monthly - (ID, AGENCY_ID, PID, MONTH_ID, QUARTER_ID, YEAR_ID, GRID_TOTAL, GROUP_TOTAL, GROUP_MEMBER_TOTAL, + (ID, CUSTOMER_ID, AGENCY_ID, PID, MONTH_ID, QUARTER_ID, YEAR_ID, GRID_TOTAL, GROUP_TOTAL, GROUP_MEMBER_TOTAL, GROUP_MEMBER_AVG_COUNT, GROUP_MEDIAN, GROUP_INCR, GROUP_MEMBER_MAX_COUNT, MAX_MEMBER_GROUP_ID, GROUP_MEMBER_MIN_COUNT, MIN_MEMBER_GROUP_ID, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME) @@ -38,6 +38,7 @@ ( REPLACE(UUID(),'-',''), + #{agency.customerId}, #{agency.agencyId}, #{agency.pid}, #{agency.monthId}, diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupGridDailyDao.xml index 0692607ad3..8c8ab22e50 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupGridDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupGridDailyDao.xml @@ -31,13 +31,14 @@ - INSERT INTO fact_group_grid_daily (ID, AGENCY_ID, GRID_ID, DATE_ID, WEEK_ID, MONTH_ID, YEAR_ID, QUARTER_ID, GRID_TOTAL, + INSERT INTO fact_group_grid_daily (ID, CUSTOMER_ID, AGENCY_ID, GRID_ID, DATE_ID, WEEK_ID, MONTH_ID, YEAR_ID, QUARTER_ID, GRID_TOTAL, GROUP_TOTAL, GROUP_MEMBER_TOTAL, GROUP_MEMBER_AVG_COUNT, GROUP_MEDIAN, GROUP_INCR, GROUP_MEMBER_MAX_COUNT, MAX_MEMBER_GROUP_ID, GROUP_MEMBER_MIN_COUNT, MIN_MEMBER_GROUP_ID, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME) VALUES ( REPLACE(UUID(),'-',''), + #{grid.customerId}, #{grid.agencyId}, #{grid.gridId}, #{grid.dateId}, @@ -66,12 +67,13 @@ - + DELETE FROM fact_group_grid_daily WHERE date_id = #{dateId} + AND customer_id = #{customerId} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyDailyDao.xml index bd19d31fd0..b99b5e409b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyDailyDao.xml @@ -6,7 +6,7 @@ DELETE FROM fact_tag_used_agency_daily WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND DATE_ID = #{dateId,jdbcType=VARCHAR} - SELECT CUSTOMER_ID, PID, diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyMonthlyDao.xml index ccbe4c211b..05d22a1a38 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyMonthlyDao.xml @@ -28,6 +28,7 @@