From df92ed4fa031ca86263caa3599e1bc54bdf25cec Mon Sep 17 00:00:00 2001 From: chen-xin-zhi <3588068430@qq.com> Date: Tue, 4 Mar 2025 08:57:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BA=86=E5=86=99=E7=9C=9F?= =?UTF-8?q?=E9=A2=84=E7=BA=A6=E7=89=B9=E6=AE=8A=E4=BA=A7=E5=93=81=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../order/PendingServiceGoodController.java | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/cultural/heritage/controller/order/PendingServiceGoodController.java b/src/main/java/com/cultural/heritage/controller/order/PendingServiceGoodController.java index b755167..5d6f373 100644 --- a/src/main/java/com/cultural/heritage/controller/order/PendingServiceGoodController.java +++ b/src/main/java/com/cultural/heritage/controller/order/PendingServiceGoodController.java @@ -73,13 +73,11 @@ public class PendingServiceGoodController { throw new BusinessException(ErrorCode.PARAMS_ERROR); } QueryWrapper queryWrapper = pendingServiceGoodService.getQueryWrapper(bookingOrderQueryRequest); - long current = bookingOrderQueryRequest.getCurrent(); - long pageSize = bookingOrderQueryRequest.getPageSize(); - Page page = pendingServiceGoodService.page(new Page<>(current, pageSize), queryWrapper); - List pendingServiceGoodList = page.getRecords(); + List pendingServiceGoodList = pendingServiceGoodService.list(queryWrapper); // 获取服务类待处理订单 List pendingServiceOrderList = commonService.findByFieldInTargetField(pendingServiceGoodList, pendingServiceOrderService, PendingServiceGood::getId, "pendingId"); + // 封装成服务类待处理订单VO List pendingServiceOrderVOS = commonService.convertList(pendingServiceOrderList, PendingServiceOrderVO.class); // 封装map集合(键:服务类商品待处理id,值:待处理服务类订单列表) @@ -105,12 +103,18 @@ public class PendingServiceGoodController { pendingServiceGoodVOList.add(pendingServiceGoodVO); } + + long current = bookingOrderQueryRequest.getCurrent(); + long pageSize = bookingOrderQueryRequest.getPageSize(); + long total = pendingServiceOrderList.size(); + long pages = (total + pageSize - 1) / pageSize; + Page voPage = new Page<>(); voPage.setRecords(pendingServiceGoodVOList); - voPage.setTotal(page.getTotal()); - voPage.setSize(page.getSize()); - voPage.setCurrent(page.getCurrent()); - voPage.setPages(page.getPages()); + voPage.setTotal(total); + voPage.setSize(pageSize); + voPage.setCurrent(current); + voPage.setPages(pages); return ResultUtils.success(voPage); }