diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/PageFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/PageFormDTO.java new file mode 100644 index 0000000000..c3da303f4d --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/PageFormDTO.java @@ -0,0 +1,9 @@ +package com.epmet.dto; + +import lombok.Data; + +@Data +public class PageFormDTO { + private Integer pageNo = 1; + private Integer pageSize = 10; +} 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 a3f03120df..db794ca26b 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 @@ -4,9 +4,8 @@ import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; 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.dao.evaluationindex.screenkc.ScreenKcNewsSummaryDailyDao; import com.epmet.datareport.service.evaluationindex.screen.KcScreenService; -import com.epmet.dto.result.issue.IssueGridTotalRankDTO; +import com.epmet.dto.PageFormDTO; import com.epmet.dto.result.project.*; import com.epmet.dto.result.user.*; import com.epmet.evaluationindex.screen.dto.form.GroupTopicShiftIssueRatioRankFormDTO; @@ -99,7 +98,7 @@ public class KcScreenController { } /** - * 按照议题总数排名 + * 按照议题数量排名 * @param externalAppRequestParam * @return */ @@ -312,7 +311,7 @@ public class KcScreenController { } /** - * 网格用户排名 + * 网格用户数量排名 * @param externalAppRequestParam * @return */ @@ -342,9 +341,10 @@ public class KcScreenController { */ @ExternalAppRequestAuth @PostMapping("user/pointsrank") - public Result getUserPointsRank(ExternalAppRequestParam externalAppRequestParam){ + public Result getUserPointsRank(ExternalAppRequestParam externalAppRequestParam, + @RequestBody PageFormDTO form) { String customerId = externalAppRequestParam.getCustomerId(); - return new Result().ok(kcScreenService.getUserPointsRank(customerId)); + return new Result().ok(kcScreenService.getUserPointsRank(customerId, form.getPageNo(), form.getPageSize())); } /** @@ -402,9 +402,10 @@ public class KcScreenController { */ @ExternalAppRequestAuth @PostMapping("news/hotrank") - public Result> listNewsHotRank(ExternalAppRequestParam externalAppRequestParam){ + public Result> listNewsHotRank(ExternalAppRequestParam externalAppRequestParam, + @RequestBody PageFormDTO form){ String customerId = externalAppRequestParam.getCustomerId(); - return new Result>().ok(kcScreenService.getNewsHotRank(customerId)); + return new Result>().ok(kcScreenService.getNewsHotRank(customerId, form.getPageNo(), form.getPageSize())); } 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 f17e492904..f40e8517ae 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 @@ -123,7 +123,7 @@ public interface KcScreenService { KcUserPortrayalResultDTO getUserPortrayal(String customerId); - KcUserPointRankResultDTO getUserPointsRank(String customerId); + KcUserPointRankResultDTO getUserPointsRank(String customerId, Integer pageNo, Integer pageSize); ScreenKcNewsSummaryResultDTO getNewsSummary(String customerId); @@ -133,5 +133,5 @@ public interface KcScreenService { ScreenKcCategoryNewsRankResultDTO getNewsPartiCategoryRank(String customerId); - List getNewsHotRank(String customerId); + List getNewsHotRank(String customerId, Integer pageNo, Integer pageSize); } 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 b300d5d4c8..661a43306a 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 @@ -18,6 +18,7 @@ import com.epmet.evaluationindex.screen.dto.result.*; import com.epmet.evaluationindex.screen.dto.result.HomepageSummaryResultDTO; import com.epmet.dto.result.issue.KcIssueSummary; import com.epmet.dto.result.issue.KcPartiTrendResultDTO; +import com.github.pagehelper.PageHelper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -404,7 +405,10 @@ public class KcScreenServiceImpl implements KcScreenService { } @Override - public KcUserPointRankResultDTO getUserPointsRank(String customerId) { + public KcUserPointRankResultDTO getUserPointsRank(String customerId, Integer pageNo, Integer pageSize) { + if (pageNo != null && pageSize != null) { + PageHelper.startPage(pageNo, pageSize); + } List userPoints = partyUserRankDataDao.listUserPoints(customerId); KcUserPointRankResultDTO rank = new KcUserPointRankResultDTO(); userPoints.stream().forEach(p -> { @@ -451,7 +455,10 @@ public class KcScreenServiceImpl implements KcScreenService { } @Override - public List getNewsHotRank(String customerId) { + public List getNewsHotRank(String customerId, Integer pageNo, Integer pageSize) { + if (pageNo != null && pageSize != null) { + PageHelper.startPage(pageNo, pageSize); + } return screenKcNewsRankDao.getNewsHotRank(customerId); } } diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml index 983ced249a..9366bc90f7 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml @@ -42,6 +42,6 @@ from screen_party_user_rank_data ur where ur.DEL_FLAG = 0 and ur.CUSTOMER_ID = #{customerId} - order by ur.POINT_TOTAL asc + order by ur.POINT_TOTAL desc \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcNewsCategoryAnalysisDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcNewsCategoryAnalysisDao.xml index da547c9ba0..a93bd0d439 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcNewsCategoryAnalysisDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcNewsCategoryAnalysisDao.xml @@ -31,6 +31,6 @@ and DEL_FLAG = 0 ) latest on (pcd.CUSTOMER_ID = latest.CUSTOMER_ID and pcd.DATE_ID = latest.MAX_DATE_ID) where pcd.DEL_FLAG = 0 - order by convert(pcd.CATEGORY_NAME using gbk) + order by partiCount desc diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcUserSummaryDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcUserSummaryDailyDao.xml index 48e8bc1604..5e27540bb9 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcUserSummaryDailyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcUserSummaryDailyDao.xml @@ -28,7 +28,7 @@ where DEL_FLAG = 0 and CUSTOMER_ID = #{customerId} ) latest on (usd.DATE_ID = latest.MAX_DATE_ID and usd.CUSTOMER_ID = latest.CUSTOMER_ID) - order by viewUserCount asc + order by viewUserCount desc limit 7 diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java index caa9bd6301..a3e26a5d80 100644 --- a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java @@ -19,8 +19,8 @@ import java.util.List; * @author yinzuomei@elink-cn.com * @date 2020/6/4 10:28 */ -@FeignClient(name = ServiceConstant.EPMET_COMMON_SERVICE, fallback = EpmetCommonServiceOpenFeignClientFallback.class) -//@FeignClient(name = ServiceConstant.EPMET_COMMON_SERVICE, fallback = EpmetCommonServiceOpenFeignClientFallback.class, url = "http://localhost:8103") +//@FeignClient(name = ServiceConstant.EPMET_COMMON_SERVICE, fallback = EpmetCommonServiceOpenFeignClientFallback.class) +@FeignClient(name = ServiceConstant.EPMET_COMMON_SERVICE, fallback = EpmetCommonServiceOpenFeignClientFallback.class, url = "http://localhost:8103") public interface EpmetCommonServiceOpenFeignClient { /** * @param formDTO