From d5ee8b7da8ad2c90b405a3bd761457c0df04e98c Mon Sep 17 00:00:00 2001 From: wxz Date: Tue, 15 Sep 2020 14:31:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=EF=BC=9A=E8=AE=AE=E9=A2=98su?= =?UTF-8?q?mmary+=E8=AE=AE=E9=A2=98=E8=B6=8B=E5=8A=BF=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application.yml | 2 +- .../dto/result/issue/KcIssueSummary.java | 18 ++ .../result/issue/KcPartiTrendResultDTO.java | 16 ++ .../controller/screen/KcScreenController.java | 31 ++++ .../ScreenKcIssueSummaryGridDailyDao.java | 3 + .../ScreenKcIssueTrendGridMonthlyDao.java | 6 + .../ScreenKcIssueSummaryGridDailyDTO.java | 156 ++++++++++++++++++ .../ScreenKcIssueTrendGridMonthlyDTO.java | 106 ++++++++++++ .../screen/KcScreenService.java | 6 + .../screen/impl/KcScreenServiceImpl.java | 32 ++++ .../ScreenKcIssueSummaryGridDailyDao.xml | 8 + .../ScreenKcIssueTrendGridMonthlyDao.xml | 8 + .../ScreenKcIssueSummaryGridDailyDao.xml | 17 +- .../ScreenKcIssueTrendGridMonthlyDao.xml | 10 +- 14 files changed, 415 insertions(+), 4 deletions(-) create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/issue/KcIssueSummary.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/issue/KcPartiTrendResultDTO.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/issue/ScreenKcIssueSummaryGridDailyDTO.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/issue/ScreenKcIssueTrendGridMonthlyDTO.java create mode 100644 epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/ScreenKcIssueSummaryGridDailyDao.xml create mode 100644 epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/ScreenKcIssueTrendGridMonthlyDao.xml diff --git a/epmet-cloud-generator/src/main/resources/application.yml b/epmet-cloud-generator/src/main/resources/application.yml index 8e526e2a73..49dbbb94d5 100644 --- a/epmet-cloud-generator/src/main/resources/application.yml +++ b/epmet-cloud-generator/src/main/resources/application.yml @@ -9,7 +9,7 @@ spring: type: com.alibaba.druid.pool.DruidDataSource #MySQL配置 driverClassName: com.mysql.jdbc.Driver - url: jdbc:mysql://192.168.1.130:3306/epmet_gov_voice?useUnicode=true&characterEncoding=UTF-8&useSSL=false + url: jdbc:mysql://192.168.1.130:3306/epmet_evaluation_index?useUnicode=true&characterEncoding=UTF-8&useSSL=false username: epmet_dba password: EpmEt-dbA-UsEr #oracle配置 diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/issue/KcIssueSummary.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/issue/KcIssueSummary.java new file mode 100644 index 0000000000..9ae403b1c2 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/issue/KcIssueSummary.java @@ -0,0 +1,18 @@ +package com.epmet.dto.result.issue; + +import lombok.Data; + +@Data +public class KcIssueSummary { + + private String dateId; + private Integer reportCount; + private Integer issueCount; + private Integer pendingCount; + private Integer rejectedCount; + private Integer processingCount; + private Integer closedCount; + private Integer issueViewCount; + private Integer voteCount; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/issue/KcPartiTrendResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/issue/KcPartiTrendResultDTO.java new file mode 100644 index 0000000000..5b7db61bbb --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/issue/KcPartiTrendResultDTO.java @@ -0,0 +1,16 @@ +package com.epmet.dto.result.issue; + +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +@Data +public class KcPartiTrendResultDTO { + + private String monthId; + private Integer reportCount; + + private List xAxis = new ArrayList<>(); + private List reportCountDataList = new ArrayList<>(); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/KcScreenController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/KcScreenController.java index f945c8c43f..46d86bb709 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/KcScreenController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/KcScreenController.java @@ -7,6 +7,9 @@ import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.datareport.service.evaluationindex.screen.KcScreenService; import com.epmet.evaluationindex.screen.dto.form.HeartVolunteerrankFormDTO; import com.epmet.evaluationindex.screen.dto.result.*; +import com.epmet.dto.result.issue.KcIssueSummary; +import com.epmet.dto.result.issue.KcPartiTrendResultDTO; +import com.epmet.evaluationindex.screen.dto.result.HomepageSummaryResultDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -61,6 +64,34 @@ public class KcScreenController { public Result heartActcounttrend(ExternalAppRequestParam externalAppRequestParam){ return new Result().ok(kcScreenService.heartActcounttrend(externalAppRequestParam)); } + /** + * 议题分析-各类总数 + * @param externalAppRequestParam + * @return + */ + @ExternalAppRequestAuth + @PostMapping("issue/summary") + public Result getIssueSummary(ExternalAppRequestParam externalAppRequestParam) { + String customerId = externalAppRequestParam.getCustomerId(); + //String customerId = "b09527201c4409e19d1dbc5e3c3429a1"; + KcIssueSummary issueSummary = kcScreenService.getIssueSummary(customerId); + return new Result().ok(issueSummary); + } + + /** + * 参与趋势 + * @param externalAppRequestParam + * @return + */ + //@ExternalAppRequestAuth + @PostMapping("issue/partitrend") + public Result getIssuePartiTrend(ExternalAppRequestParam externalAppRequestParam) { + //String customerId = externalAppRequestParam.getCustomerId(); + String customerId = "b09527201c4409e19d1dbc5e3c3429a1"; + KcPartiTrendResultDTO trendResultDTO = kcScreenService.getIssuePartiTrend(customerId); + return new Result().ok(trendResultDTO); + } + /** * @param externalAppRequestParam diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcIssueSummaryGridDailyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcIssueSummaryGridDailyDao.java index 2ec71f1d79..efc949d2fe 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcIssueSummaryGridDailyDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcIssueSummaryGridDailyDao.java @@ -17,7 +17,9 @@ package com.epmet.datareport.dao.evaluationindex.screenkc; +import com.epmet.dto.result.issue.KcIssueSummary; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * KC-议题分析(各类总数) @@ -28,4 +30,5 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface ScreenKcIssueSummaryGridDailyDao { + KcIssueSummary getIssueSummary(@Param("customerId") String customerId); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcIssueTrendGridMonthlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcIssueTrendGridMonthlyDao.java index 37edac5861..fb9d9918ba 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcIssueTrendGridMonthlyDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcIssueTrendGridMonthlyDao.java @@ -17,7 +17,11 @@ package com.epmet.datareport.dao.evaluationindex.screenkc; +import com.epmet.dto.result.issue.KcPartiTrendResultDTO; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * KC-议题参与趋势(每天上报当前月)customerId+monthId先删后增 @@ -28,4 +32,6 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface ScreenKcIssueTrendGridMonthlyDao { + List getIssuePartiTrend(@Param("customerId") String customerId); + } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/issue/ScreenKcIssueSummaryGridDailyDTO.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/issue/ScreenKcIssueSummaryGridDailyDTO.java new file mode 100644 index 0000000000..605b75cf34 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/issue/ScreenKcIssueSummaryGridDailyDTO.java @@ -0,0 +1,156 @@ +/** + * 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.datareport.dao.issue; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * KC-议题分析(各类总数) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-14 + */ +@Data +public class ScreenKcIssueSummaryGridDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID 主键(先根据customerId+dateId删除,后插入) + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 数据更新至:yyyyMMdd + */ + private String dateId; + + /** + * 网格id + */ + private String gridId; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 网格所属的组织id + */ + private String parentAgencyId; + + /** + * 所有上级ID,用英文逗号分开 ? + */ + private String allParentIds; + + /** + * 上报总数 + */ + private Integer reportCount; + + /** + * 议题总数 + */ + private Integer issueCount; + + /** + * 待审核数 + */ + private Integer pendingCount; + + /** + * 已驳回数 + */ + private Integer rejectedCount; + + /** + * 处理中数 + */ + private Integer processingCount; + + /** + * 已关闭数 + */ + private Integer closedCount; + + /** + * 议题浏览数 + */ + private Integer issueViewCount; + + /** + * 表态数 + */ + private Integer voteCount; + + /** + * 审核通过数 ?为了算议题效率 + */ + private Integer passedCount; + + /** + * 转化成项目数 ?为了算议题效率 + */ + private Integer shiftToProjectCount; + + /** + * 平均审核时间单位分钟 ? + */ + private Integer avgAuditTime; + + /** + * 删除标识 0未删除;1已删除 + */ + private String 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/src/main/java/com/epmet/datareport/dao/issue/ScreenKcIssueTrendGridMonthlyDTO.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/issue/ScreenKcIssueTrendGridMonthlyDTO.java new file mode 100644 index 0000000000..527aaa443c --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/issue/ScreenKcIssueTrendGridMonthlyDTO.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.datareport.dao.issue; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * KC-议题参与趋势(每天上报当前月)customerId+monthId先删后增 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-14 + */ +@Data +public class ScreenKcIssueTrendGridMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID 主键(每天上报当前月),按照customerId+monthId先删除记录,再插入 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 月id :yyyyMM + */ + private String monthId; + + /** + * 网格id + */ + private String gridId; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 网格所属的组织id + */ + private String parentAgencyId; + + /** + * 所有上级ID,用英文逗号分开 ? + */ + private String allParentIds; + + /** + * 议题上报数(本月内上报的议题数量) + */ + private Integer reportCount; + + /** + * 删除标识 0未删除;1已删除 + */ + private String 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/src/main/java/com/epmet/datareport/service/evaluationindex/screen/KcScreenService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/KcScreenService.java index 448b032c21..3dce8b8545 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/KcScreenService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/KcScreenService.java @@ -5,6 +5,9 @@ import com.epmet.evaluationindex.screen.dto.form.HeartVolunteerrankFormDTO; import com.epmet.evaluationindex.screen.dto.result.*; import java.util.List; +import com.epmet.dto.result.issue.KcIssueSummary; +import com.epmet.dto.result.issue.KcPartiTrendResultDTO; +import com.epmet.evaluationindex.screen.dto.result.HomepageSummaryResultDTO; /** * 孔村大屏api @@ -48,4 +51,7 @@ public interface KcScreenService { * @author sun */ List heartVolunteerrank(HeartVolunteerrankFormDTO formDTO); + KcIssueSummary getIssueSummary(String customerId); + + KcPartiTrendResultDTO getIssuePartiTrend(String customerId); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/KcScreenServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/KcScreenServiceImpl.java index e86c1d7353..94bc4dcd55 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/KcScreenServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/KcScreenServiceImpl.java @@ -5,16 +5,24 @@ import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.constant.DataSourceConstant; import com.epmet.datareport.dao.evaluationindex.screenkc.*; +import com.epmet.datareport.dao.evaluationindex.screenkc.ScreenKcIssueSummaryGridDailyDao; +import com.epmet.datareport.dao.evaluationindex.screenkc.ScreenKcIssueTrendGridMonthlyDao; +import com.epmet.datareport.dao.evaluationindex.screenkc.ScreenKcPlatformSummaryDailyDao; import com.epmet.datareport.service.evaluationindex.screen.KcScreenService; import com.epmet.datareport.utils.DateUtils; import com.epmet.evaluationindex.screen.dto.form.HeartVolunteerrankFormDTO; import com.epmet.evaluationindex.screen.dto.result.*; +import com.epmet.dto.result.issue.KcIssueSummary; +import com.epmet.dto.result.issue.KcPartiTrendResultDTO; +import com.epmet.evaluationindex.screen.dto.result.HomepageSummaryResultDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.LinkedList; import java.util.List; +import java.util.List; + /** * 孔村大屏api * @@ -27,6 +35,7 @@ public class KcScreenServiceImpl implements KcScreenService { @Autowired private DateUtils dateUtils; + @Autowired private ScreenKcPlatformSummaryDailyDao screenKcPlatformSummaryDailyDao; @Autowired @@ -38,6 +47,12 @@ public class KcScreenServiceImpl implements KcScreenService { @Autowired private ScreenKcVolunteerHeatRankGridDailyDao screenKcVolunteerHeatRankGridDailyDao; + @Autowired + private ScreenKcIssueSummaryGridDailyDao screenKcIssueSummaryGridDailyDao; + + @Autowired + private ScreenKcIssueTrendGridMonthlyDao trendGridMonthlyDao; + /** * @param externalAppRequestParam * @Description 首页-平台各类总数 @@ -118,4 +133,21 @@ public class KcScreenServiceImpl implements KcScreenService { return list; } + @Override + public KcIssueSummary getIssueSummary(String customerId) { + return screenKcIssueSummaryGridDailyDao.getIssueSummary(customerId); + } + + @Override + public KcPartiTrendResultDTO getIssuePartiTrend(String customerId) { + List trend = trendGridMonthlyDao.getIssuePartiTrend(customerId); + KcPartiTrendResultDTO result = new KcPartiTrendResultDTO(); + trend.stream().forEach(t -> { + String month = t.getMonthId().substring(4); + result.getXAxis().add(new Integer(month).toString().concat("月")); + result.getReportCountDataList().add(t.getReportCount()); + }); + return result; + } + } diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/ScreenKcIssueSummaryGridDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/ScreenKcIssueSummaryGridDailyDao.xml new file mode 100644 index 0000000000..607ea18a04 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/ScreenKcIssueSummaryGridDailyDao.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/ScreenKcIssueTrendGridMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/ScreenKcIssueTrendGridMonthlyDao.xml new file mode 100644 index 0000000000..889b92ae59 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/ScreenKcIssueTrendGridMonthlyDao.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcIssueSummaryGridDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcIssueSummaryGridDailyDao.xml index 98b91d3ee3..8dfcc4e8a4 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcIssueSummaryGridDailyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcIssueSummaryGridDailyDao.xml @@ -3,5 +3,20 @@ - + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcIssueTrendGridMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcIssueTrendGridMonthlyDao.xml index e9298902f1..731c8b8083 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcIssueTrendGridMonthlyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcIssueTrendGridMonthlyDao.xml @@ -3,6 +3,12 @@ - - +