Browse Source

修改:增加部分接口的分页

修改:调整部分接口的排序
master
wxz 5 years ago
parent
commit
2af96ddbc1
  1. 9
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/PageFormDTO.java
  2. 17
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/KcScreenController.java
  3. 4
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/KcScreenService.java
  4. 11
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/KcScreenServiceImpl.java
  5. 2
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml
  6. 2
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcNewsCategoryAnalysisDao.xml
  7. 2
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcUserSummaryDailyDao.xml
  8. 4
      epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java

9
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;
}

17
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<KcUserPointRankResultDTO> getUserPointsRank(ExternalAppRequestParam externalAppRequestParam){
public Result<KcUserPointRankResultDTO> getUserPointsRank(ExternalAppRequestParam externalAppRequestParam,
@RequestBody PageFormDTO form) {
String customerId = externalAppRequestParam.getCustomerId();
return new Result<KcUserPointRankResultDTO>().ok(kcScreenService.getUserPointsRank(customerId));
return new Result<KcUserPointRankResultDTO>().ok(kcScreenService.getUserPointsRank(customerId, form.getPageNo(), form.getPageSize()));
}
/**
@ -402,9 +402,10 @@ public class KcScreenController {
*/
@ExternalAppRequestAuth
@PostMapping("news/hotrank")
public Result<List<ScreenKcNewsHotRankResultDTO>> listNewsHotRank(ExternalAppRequestParam externalAppRequestParam){
public Result<List<ScreenKcNewsHotRankResultDTO>> listNewsHotRank(ExternalAppRequestParam externalAppRequestParam,
@RequestBody PageFormDTO form){
String customerId = externalAppRequestParam.getCustomerId();
return new Result<List<ScreenKcNewsHotRankResultDTO>>().ok(kcScreenService.getNewsHotRank(customerId));
return new Result<List<ScreenKcNewsHotRankResultDTO>>().ok(kcScreenService.getNewsHotRank(customerId, form.getPageNo(), form.getPageSize()));
}

4
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<ScreenKcNewsHotRankResultDTO> getNewsHotRank(String customerId);
List<ScreenKcNewsHotRankResultDTO> getNewsHotRank(String customerId, Integer pageNo, Integer pageSize);
}

11
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<KcUserPointRankResultDTO.KcUserPoint> userPoints = partyUserRankDataDao.listUserPoints(customerId);
KcUserPointRankResultDTO rank = new KcUserPointRankResultDTO();
userPoints.stream().forEach(p -> {
@ -451,7 +455,10 @@ public class KcScreenServiceImpl implements KcScreenService {
}
@Override
public List<ScreenKcNewsHotRankResultDTO> getNewsHotRank(String customerId) {
public List<ScreenKcNewsHotRankResultDTO> getNewsHotRank(String customerId, Integer pageNo, Integer pageSize) {
if (pageNo != null && pageSize != null) {
PageHelper.startPage(pageNo, pageSize);
}
return screenKcNewsRankDao.getNewsHotRank(customerId);
}
}

2
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
</select>
</mapper>

2
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
</select>
</mapper>

2
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
</select>

4
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

Loading…
Cancel
Save