Ver Fonte

分页接口封装

raojiang há 3 semanas atrás
pai
commit
3fbc69b453

+ 5 - 4
services/load-transfer-bf/src/main/java/com/hdkj/lt/bf/controller/FhzgReconController.java

@@ -2,6 +2,7 @@ package com.hdkj.lt.bf.controller;
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.hdkj.hussar.ApiResponse;
+import com.hdkj.lt.base.model.response.PageVO;
 import com.hdkj.lt.bf.entity.dto.ReconDetailReqDTO;
 import com.hdkj.lt.bf.entity.dto.ReconListReqDTO;
 import com.hdkj.lt.bf.entity.dto.ReconPageReqDTO;
@@ -52,7 +53,7 @@ public class FhzgReconController {
      */
     @PostMapping("/switch-seq/page")
     @ApiOperation(value = "查询开关动作顺序")
-    public ApiResponse<Page<ReconSwitchSeqVO>> getSwitchSeqPage(@RequestBody ReconPageReqDTO reqDTO) {
+    public ApiResponse<PageVO<ReconSwitchSeqVO>> getSwitchSeqPage(@RequestBody ReconPageReqDTO reqDTO) {
         return ApiResponse.success(reconQueryService.getSwitchSeqPage(reqDTO));
     }
 
@@ -61,7 +62,7 @@ public class FhzgReconController {
      */
     @PostMapping("/feeder-compare/page")
     @ApiOperation(value = "查询馈线重构前后对比")
-    public ApiResponse<Page<ReconFeederCompareVO>> getFeederComparePage(@RequestBody ReconPageReqDTO reqDTO) {
+    public ApiResponse<PageVO<ReconFeederCompareVO>> getFeederComparePage(@RequestBody ReconPageReqDTO reqDTO) {
         return ApiResponse.success(reconQueryService.getFeederComparePage(reqDTO));
     }
 
@@ -70,7 +71,7 @@ public class FhzgReconController {
      */
     @PostMapping("/loadpoint-compare/page")
     @ApiOperation(value = "查询负荷点电压对比")
-    public ApiResponse<Page<ReconLoadpointCompareVO>> getLoadpointComparePage(@RequestBody ReconPageReqDTO reqDTO) {
+    public ApiResponse<PageVO<ReconLoadpointCompareVO>> getLoadpointComparePage(@RequestBody ReconPageReqDTO reqDTO) {
         return ApiResponse.success(reconQueryService.getLoadpointComparePage(reqDTO));
     }
 
@@ -79,7 +80,7 @@ public class FhzgReconController {
      */
     @PostMapping("/switch-compare/page")
     @ApiOperation(value = "查询开关状态对比")
-    public ApiResponse<Page<ReconSwitchCompareVO>> getSwitchComparePage(@RequestBody ReconPageReqDTO reqDTO) {
+    public ApiResponse<PageVO<ReconSwitchCompareVO>> getSwitchComparePage(@RequestBody ReconPageReqDTO reqDTO) {
         return ApiResponse.success(reconQueryService.getSwitchComparePage(reqDTO));
     }
 }

+ 5 - 4
services/load-transfer-bf/src/main/java/com/hdkj/lt/bf/service/ReconQueryService.java

@@ -1,6 +1,7 @@
 package com.hdkj.lt.bf.service;
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.hdkj.lt.base.model.response.PageVO;
 import com.hdkj.lt.bf.entity.dto.ReconDetailReqDTO;
 import com.hdkj.lt.bf.entity.dto.ReconListReqDTO;
 import com.hdkj.lt.bf.entity.dto.ReconPageReqDTO;
@@ -24,20 +25,20 @@ public interface ReconQueryService {
     /**
      * 查询开关动作顺序(分页)
      */
-    Page<ReconSwitchSeqVO> getSwitchSeqPage(ReconPageReqDTO reqDTO);
+    PageVO<ReconSwitchSeqVO> getSwitchSeqPage(ReconPageReqDTO reqDTO);
 
     /**
      * 查询馈线重构前后对比(分页)
      */
-    Page<ReconFeederCompareVO> getFeederComparePage(ReconPageReqDTO reqDTO);
+    PageVO<ReconFeederCompareVO> getFeederComparePage(ReconPageReqDTO reqDTO);
 
     /**
      * 查询负荷点电压对比(分页)
      */
-    Page<ReconLoadpointCompareVO> getLoadpointComparePage(ReconPageReqDTO reqDTO);
+    PageVO<ReconLoadpointCompareVO> getLoadpointComparePage(ReconPageReqDTO reqDTO);
 
     /**
      * 查询开关状态对比(分页)
      */
-    Page<ReconSwitchCompareVO> getSwitchComparePage(ReconPageReqDTO reqDTO);
+    PageVO<ReconSwitchCompareVO> getSwitchComparePage(ReconPageReqDTO reqDTO);
 }

+ 17 - 16
services/load-transfer-bf/src/main/java/com/hdkj/lt/bf/service/impl/ReconQueryServiceImpl.java

@@ -3,6 +3,7 @@ package com.hdkj.lt.bf.service.impl;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.hdkj.lt.base.exception.BusinessException;
+import com.hdkj.lt.base.model.response.PageVO;
 import com.hdkj.lt.bf.entity.dto.ReconDetailReqDTO;
 import com.hdkj.lt.bf.entity.dto.ReconListReqDTO;
 import com.hdkj.lt.bf.entity.dto.ReconPageReqDTO;
@@ -94,7 +95,7 @@ public class ReconQueryServiceImpl implements ReconQueryService {
     }
 
     @Override
-    public Page<ReconSwitchSeqVO> getSwitchSeqPage(ReconPageReqDTO reqDTO) {
+    public PageVO<ReconSwitchSeqVO> getSwitchSeqPage(ReconPageReqDTO reqDTO) {
         validatePageParam(reqDTO);
 
         // 安全校验从主表获取
@@ -108,10 +109,10 @@ public class ReconQueryServiceImpl implements ReconQueryService {
                         .orderByAsc(FhzgReconSwitchSeq::getSeqNo)
         );
 
-        Page<ReconSwitchSeqVO> voPage = new Page<>();
+        PageVO<ReconSwitchSeqVO> voPage = new PageVO<>();
         voPage.setTotal(resultPage.getTotal());
-        voPage.setCurrent(resultPage.getCurrent());
-        voPage.setSize(resultPage.getSize());
+        voPage.setPageNum(resultPage.getCurrent());
+        voPage.setPageSize(resultPage.getSize());
         voPage.setRecords(resultPage.getRecords().stream()
                 .map(seq -> buildSwitchSeqVO(seq, safetyCheckPassed))
                 .collect(Collectors.toList()));
@@ -119,7 +120,7 @@ public class ReconQueryServiceImpl implements ReconQueryService {
     }
 
     @Override
-    public Page<ReconFeederCompareVO> getFeederComparePage(ReconPageReqDTO reqDTO) {
+    public PageVO<ReconFeederCompareVO> getFeederComparePage(ReconPageReqDTO reqDTO) {
         validatePageParam(reqDTO);
 
         Page<FhzgReconFeederResult> page = new Page<>(reqDTO.getPageNum(), reqDTO.getPageSize());
@@ -129,16 +130,16 @@ public class ReconQueryServiceImpl implements ReconQueryService {
                         .orderByAsc(FhzgReconFeederResult::getFeederNo)
         );
 
-        Page<ReconFeederCompareVO> voPage = new Page<>();
+        PageVO<ReconFeederCompareVO> voPage = new PageVO<>();
         voPage.setTotal(resultPage.getTotal());
-        voPage.setCurrent(resultPage.getCurrent());
-        voPage.setSize(resultPage.getSize());
+        voPage.setPageNum(resultPage.getCurrent());
+        voPage.setPageSize(resultPage.getSize());
         voPage.setRecords(resultPage.getRecords().stream().map(this::buildFeederCompareVO).collect(Collectors.toList()));
         return voPage;
     }
 
     @Override
-    public Page<ReconLoadpointCompareVO> getLoadpointComparePage(ReconPageReqDTO reqDTO) {
+    public PageVO<ReconLoadpointCompareVO> getLoadpointComparePage(ReconPageReqDTO reqDTO) {
         validatePageParam(reqDTO);
 
         Page<FhzgReconVolDetail> page = new Page<>(reqDTO.getPageNum(), reqDTO.getPageSize());
@@ -148,16 +149,16 @@ public class ReconQueryServiceImpl implements ReconQueryService {
                         .orderByAsc(FhzgReconVolDetail::getDetailNo)
         );
 
-        Page<ReconLoadpointCompareVO> voPage = new Page<>();
+        PageVO<ReconLoadpointCompareVO> voPage = new PageVO<>();
         voPage.setTotal(resultPage.getTotal());
-        voPage.setCurrent(resultPage.getCurrent());
-        voPage.setSize(resultPage.getSize());
+        voPage.setPageNum(resultPage.getCurrent());
+        voPage.setPageSize(resultPage.getSize());
         voPage.setRecords(resultPage.getRecords().stream().map(this::buildLoadpointCompareVO).collect(Collectors.toList()));
         return voPage;
     }
 
     @Override
-    public Page<ReconSwitchCompareVO> getSwitchComparePage(ReconPageReqDTO reqDTO) {
+    public PageVO<ReconSwitchCompareVO> getSwitchComparePage(ReconPageReqDTO reqDTO) {
         validatePageParam(reqDTO);
 
         Page<FhzgReconSwitchResultDetail> page = new Page<>(reqDTO.getPageNum(), reqDTO.getPageSize());
@@ -167,10 +168,10 @@ public class ReconQueryServiceImpl implements ReconQueryService {
                         .orderByAsc(FhzgReconSwitchResultDetail::getDetailNo)
         );
 
-        Page<ReconSwitchCompareVO> voPage = new Page<>();
+        PageVO<ReconSwitchCompareVO> voPage = new PageVO<>();
         voPage.setTotal(resultPage.getTotal());
-        voPage.setCurrent(resultPage.getCurrent());
-        voPage.setSize(resultPage.getSize());
+        voPage.setPageNum(resultPage.getCurrent());
+        voPage.setPageSize(resultPage.getSize());
         voPage.setRecords(resultPage.getRecords().stream().map(this::buildSwitchCompareVO).collect(Collectors.toList()));
         return voPage;
     }