feige
2024-10-24 4215ced06b40268e9f3c8ef6915998fbe64013b4
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZfDoctorShareController.java
@@ -2,11 +2,19 @@
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.ServletUtils;
import com.ruoyi.domain.ShareMore;
import com.ruoyi.domain.ZfDownload;
import com.ruoyi.service.ZInfoUserService;
import com.ruoyi.service.ZfDoctorDownloadService;
import com.ruoyi.service.ZfDoctorService;
import com.ruoyi.service.ZfDoctorShareService;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import static com.ruoyi.common.core.page.TableSupport.*;
@RestController
@RequestMapping("/ZfDoctorShare")
@@ -14,21 +22,31 @@
    @Resource
    ZfDoctorShareService zfDoctorShareService;
    @Resource
    ZfDoctorService zfDoctorService;
    @Resource
    ZInfoUserService zInfoUserService;
    @Resource
    ZfDoctorDownloadService zfDoctorDownloadService;
    /**
     * 分享数据
     */
    @PostMapping("/share")
    public AjaxResult share(@RequestBody ShareMore zfDoctor){
        zfDoctor.setSysMenuId(2019L);
        return zfDoctorShareService.saveZa(zfDoctor);
    }
    /**
     * 根据UserId和分享人shareId查看已经授权给那些人那些数据
     */
    @PostMapping("/getInfoByUserId")
    public AjaxResult empowerGetInfo(@RequestBody ShareMore zfDoctor){
        return zfDoctorShareService.listByFidAid(zfDoctor);
        zfDoctor.setSysMenuId(2019L);
        Integer pageNo = Convert.toInt(ServletUtils.getParameter(PAGE_NO), 1);
        Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
        return  zfDoctorShareService.listByFidAid(zfDoctor,pageNo,pageSize) ;
    }
    /**
@@ -36,15 +54,37 @@
     */
    @GetMapping("/getInfoByShareId")
    public AjaxResult empowerGetInfo2(){
        return zfDoctorShareService.listByUserId();
        Integer pageNo = Convert.toInt(ServletUtils.getParameter(PAGE_NO), 1);
        Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
        return zfDoctorShareService.listUserId(pageNo ,pageSize);
    }
    /**
     * 根据userId和shareId收回已经授权给那些人
     */
    @PostMapping("/deleteInfoByUserId")
    public AjaxResult deleteEmpower(@RequestBody ShareMore zfDoctor){
        zfDoctor.setSysMenuId(2019L);
        return zfDoctorShareService.deleteZa(zfDoctor);
    }
    /**
     * 下载分享的数据
     */
    @PostMapping("/downloadDate")
    public AjaxResult ifDownLoad(@RequestBody ZfDownload zfDownload){
        zfDownload.setSysMenuId(2019L);
        return zfDoctorDownloadService.addData(zfDownload);
    }
    /**
     * 展示下载分享的数据
     */
    @GetMapping("/all")
    public AjaxResult data(ZfDownload zfDownload){
        zfDownload.setSysMenuId(2019L);
        Integer pageNo = Convert.toInt(ServletUtils.getParameter(PAGE_NO), 1);
        Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
      return zfDoctorDownloadService.selectDoctorList(zfDownload,pageNo ,pageSize);
    }
}