From e0bf75fedccd21ae9f91e9a5e6a4934dc8a269dd Mon Sep 17 00:00:00 2001 From: zqy <2522236926@qq.com> Date: 星期一, 15 七月 2024 12:43:18 +0800 Subject: [PATCH] 分页查看分享&下载 --- ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZfDoctorShareController.java | 33 ++++++++++++++------------------- 1 files changed, 14 insertions(+), 19 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZfDoctorShareController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZfDoctorShareController.java index cab2981..ea95f3a 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZfDoctorShareController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZfDoctorShareController.java @@ -1,8 +1,10 @@ package com.ruoyi.web.controller.zhang; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.text.Convert; +import com.ruoyi.common.utils.MapUtils; import com.ruoyi.common.utils.ServletUtils; import com.ruoyi.domain.ShareMore; import com.ruoyi.domain.ZfDoctor; @@ -15,10 +17,11 @@ import javax.annotation.Resource; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.stream.Collectors; -import static com.ruoyi.common.core.page.TableSupport.PAGE_NUM; -import static com.ruoyi.common.core.page.TableSupport.PAGE_SIZE; +import static com.ruoyi.common.core.page.TableSupport.*; @RestController @RequestMapping("/ZfDoctorShare") @@ -47,18 +50,19 @@ */ @PostMapping("/getInfoByUserId") public AjaxResult empowerGetInfo(@RequestBody ShareMore zfDoctor){ - Integer pageNum = Convert.toInt(ServletUtils.getParameter(PAGE_NUM), 1); + Integer pageNo = Convert.toInt(ServletUtils.getParameter(PAGE_NO), 1); Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10); - - return zfDoctorService.selectListById(zfDoctorShareService.listByFidAid(zfDoctor),pageNum,pageSize); + return zfDoctorShareService.listByFidAid(zfDoctor,pageNo,pageSize) ; } /** * 鐢ㄦ埛鑷繁鏌ョ湅鍒汉鍒嗕韩鐨勬暟鎹拰鍒嗕韩浜� */ @GetMapping("/getInfoByShareId") - public AjaxResult empowerGetInfo2(){ - return zfDoctorShareService.listUserId(); + public AjaxResult empowerGetInfo2(@RequestBody ShareMore zfDoctor){ + Integer pageNo = Convert.toInt(ServletUtils.getParameter(PAGE_NO), 1); + Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10); + return zfDoctorShareService.listUserId(zfDoctor,pageNo ,pageSize); } /** * 鏍规嵁userId鍜宻hareId鏀跺洖宸茬粡鎺堟潈缁欓偅浜涗汉 @@ -80,19 +84,10 @@ * 灞曠ず涓嬭浇鍒嗕韩鐨勬暟鎹� */ @GetMapping("/all") - public List<ZfDoctor> data(ZfDoctorDownload zfDoctorDownload){ - Integer pageNum = Convert.toInt(ServletUtils.getParameter(PAGE_NUM), 1); + public AjaxResult data(ZfDoctorDownload zfDoctorDownload){ + Integer pageNo = Convert.toInt(ServletUtils.getParameter(PAGE_NO), 1); Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10); - List<ZfDoctorDownload> as = zfDoctorDownloadService.selectDoctorList(zfDoctorDownload,pageNum,pageSize); - List<ZfDoctor> bs = new ArrayList<>(); - for (ZfDoctorDownload a: as) { - if (zfDoctorService.getById(a.getDownloadContent()) != null) { - ZfDoctor ds = zfDoctorService.getById(a.getDownloadContent()); - ds.setShareId(a.getShareId()); - bs.add(ds); - } - } - return bs; + return zfDoctorDownloadService.selectDoctorList(zfDoctorDownload,pageNo ,pageSize); } } -- Gitblit v1.9.1