zqy
2024-07-15 e0bf75fedccd21ae9f91e9a5e6a4934dc8a269dd
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和shareId收回已经授权给那些人
@@ -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);
    }
}