From 1199124ccefd61a009a6f6d23fb35f228ea93097 Mon Sep 17 00:00:00 2001 From: wxz Date: Tue, 15 Sep 2020 15:42:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E5=AD=94=E6=9D=91=E8=AE=AE?= =?UTF-8?q?=E9=A2=98=E5=A4=A7=E5=B1=8F=E7=9B=B8=E5=85=B3=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../result/issue/IssueAvgAuditTimeDTO.java | 15 ++++++ .../result/issue/IssueEffectResultDTO.java | 11 +++++ .../result/issue/IssueGridTotalRankDTO.java | 18 ++++++++ .../controller/screen/KcScreenController.java | 46 +++++++++++++++++-- .../ScreenKcIssueSummaryGridDailyDao.java | 11 +++++ .../screen/KcScreenService.java | 10 +++- .../screen/impl/KcScreenServiceImpl.java | 28 +++++++++-- .../ScreenKcIssueSummaryGridDailyDao.xml | 40 +++++++++++++++- 8 files changed, 168 insertions(+), 11 deletions(-) create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/issue/IssueAvgAuditTimeDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/issue/IssueEffectResultDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/issue/IssueGridTotalRankDTO.java diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/issue/IssueAvgAuditTimeDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/issue/IssueAvgAuditTimeDTO.java new file mode 100644 index 0000000000..9e1b9c346b --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/issue/IssueAvgAuditTimeDTO.java @@ -0,0 +1,15 @@ +package com.epmet.dto.result.issue; + +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +@Data +public class IssueAvgAuditTimeDTO { + + private String gridName; + private Integer avgAuditTime; + + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/issue/IssueEffectResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/issue/IssueEffectResultDTO.java new file mode 100644 index 0000000000..655df79505 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/issue/IssueEffectResultDTO.java @@ -0,0 +1,11 @@ +package com.epmet.dto.result.issue; + +import lombok.Data; + +@Data +public class IssueEffectResultDTO { + + private Double reportEffectiveRatio; + private Double conversionRatio; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/issue/IssueGridTotalRankDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/issue/IssueGridTotalRankDTO.java new file mode 100644 index 0000000000..0ddfcfbf80 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/issue/IssueGridTotalRankDTO.java @@ -0,0 +1,18 @@ +package com.epmet.dto.result.issue; + +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +@Data +public class IssueGridTotalRankDTO { + + private String gridId; + private String gridName; + private Integer issueCount; + + private List gridNameDataList = new ArrayList<>(); + private List issueCountDataList = 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 46d86bb709..1b605c16ba 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 @@ -5,6 +5,7 @@ import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.datareport.service.evaluationindex.screen.KcScreenService; +import com.epmet.dto.result.issue.IssueGridTotalRankDTO; import com.epmet.evaluationindex.screen.dto.form.HeartVolunteerrankFormDTO; import com.epmet.evaluationindex.screen.dto.result.*; import com.epmet.dto.result.issue.KcIssueSummary; @@ -83,15 +84,54 @@ public class KcScreenController { * @param externalAppRequestParam * @return */ - //@ExternalAppRequestAuth + @ExternalAppRequestAuth @PostMapping("issue/partitrend") public Result getIssuePartiTrend(ExternalAppRequestParam externalAppRequestParam) { - //String customerId = externalAppRequestParam.getCustomerId(); - String customerId = "b09527201c4409e19d1dbc5e3c3429a1"; + String customerId = externalAppRequestParam.getCustomerId(); + //String customerId = "b09527201c4409e19d1dbc5e3c3429a1"; KcPartiTrendResultDTO trendResultDTO = kcScreenService.getIssuePartiTrend(customerId); return new Result().ok(trendResultDTO); } + /** + * 按照议题总数排名 + * @param externalAppRequestParam + * @return + */ + @ExternalAppRequestAuth + @PostMapping("issue/gridtotalrank") + public Result getIssueGridTotalRank(ExternalAppRequestParam externalAppRequestParam) { + String customerId = externalAppRequestParam.getCustomerId(); + //String customerId = "2fe0065f70ca0e23ce4c26fca5f1d933"; + return new Result().ok(kcScreenService.getIssueGridTotalRank(customerId)); + } + + /** + * 议题分析-审核效率排名 + * @param externalAppRequestParam + * @return + */ + @ExternalAppRequestAuth + @PostMapping("issue/avgaudittimerank") + public Result getAvgAuditTimeRank(ExternalAppRequestParam externalAppRequestParam) { + String customerId = externalAppRequestParam.getCustomerId(); + //String customerId = "2fe0065f70ca0e23ce4c26fca5f1d933"; + return new Result().ok(kcScreenService.getAvgAuditTimeRank(customerId)); + } + + /** + * 议题分析-审核效率 + * @param externalAppRequestParam + * @return + */ + @ExternalAppRequestAuth + @PostMapping("issue/effective") + public Result getIssueEffective(ExternalAppRequestParam externalAppRequestParam) { + String customerId = externalAppRequestParam.getCustomerId(); + //String customerId = "2fe0065f70ca0e23ce4c26fca5f1d933"; + return new Result().ok(kcScreenService.getIssueEffective(customerId)); + } + /** * @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 efc949d2fe..8693d6b52e 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,10 +17,15 @@ package com.epmet.datareport.dao.evaluationindex.screenkc; +import com.epmet.dto.result.issue.IssueAvgAuditTimeDTO; +import com.epmet.dto.result.issue.IssueEffectResultDTO; +import com.epmet.dto.result.issue.IssueGridTotalRankDTO; import com.epmet.dto.result.issue.KcIssueSummary; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.util.List; + /** * KC-议题分析(各类总数) * @@ -31,4 +36,10 @@ import org.apache.ibatis.annotations.Param; public interface ScreenKcIssueSummaryGridDailyDao { KcIssueSummary getIssueSummary(@Param("customerId") String customerId); + + List getIssueGridTotalRank(@Param("customerId") String customerId); + + List getAvgAuditTimeRank(@Param("customerId") String customerId); + + IssueEffectResultDTO getIssueEffective(@Param("customerId") String customerId); } 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 3dce8b8545..d9e391b3f1 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 @@ -1,12 +1,12 @@ package com.epmet.datareport.service.evaluationindex.screen; import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; +import com.epmet.dto.result.issue.*; 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; /** @@ -54,4 +54,10 @@ public interface KcScreenService { KcIssueSummary getIssueSummary(String customerId); KcPartiTrendResultDTO getIssuePartiTrend(String customerId); + + IssueGridTotalRankDTO getIssueGridTotalRank(String customerId); + + List getAvgAuditTimeRank(String customerId); + + IssueEffectResultDTO getIssueEffective(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 94bc4dcd55..41cd4dc4a5 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 @@ -10,10 +10,9 @@ import com.epmet.datareport.dao.evaluationindex.screenkc.ScreenKcIssueTrendGridM 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.dto.result.issue.*; 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; @@ -21,8 +20,6 @@ import org.springframework.stereotype.Service; import java.util.LinkedList; import java.util.List; -import java.util.List; - /** * 孔村大屏api * @@ -150,4 +147,27 @@ public class KcScreenServiceImpl implements KcScreenService { return result; } + @Override + public IssueGridTotalRankDTO getIssueGridTotalRank(String customerId) { + List issueGridTotals = screenKcIssueSummaryGridDailyDao.getIssueGridTotalRank(customerId); + + IssueGridTotalRankDTO resultDTO = new IssueGridTotalRankDTO(); + issueGridTotals.stream().forEach(igt -> { + resultDTO.getGridNameDataList().add(igt.getGridName()); + resultDTO.getIssueCountDataList().add(igt.getIssueCount()); + }); + + return resultDTO; + } + + @Override + public List getAvgAuditTimeRank(String customerId) { + return screenKcIssueSummaryGridDailyDao.getAvgAuditTimeRank(customerId); + } + + @Override + public IssueEffectResultDTO getIssueEffective(String customerId) { + return screenKcIssueSummaryGridDailyDao.getIssueEffective(customerId); + } + } 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 8dfcc4e8a4..1c12b7c53c 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 @@ -15,8 +15,44 @@ sum(VOTE_COUNT) voteCount from screen_kc_issue_summary_grid_daily t1 inner join ( - select t21.CUSTOMER_ID as customerId, max(t21.DATE_ID) max_date_id from screen_kc_issue_summary_grid_daily t21) t2 + select t21.CUSTOMER_ID as customerId, max(t21.DATE_ID) max_date_id from screen_kc_issue_summary_grid_daily t21 where t21.CUSTOMER_ID=#{customerId}) t2 on (t1.CUSTOMER_ID = t2.customerId and t1.DATE_ID = t2.max_date_id) - where t1.CUSTOMER_ID = #{customerId} + + + + + + +