From 780fa6d4016c6e616bbb4b3d29d33dbf3a40cbd6 Mon Sep 17 00:00:00 2001
From: zqy <2522236926@qq.com>
Date: 星期日, 07 七月 2024 10:22:12 +0800
Subject: [PATCH] 修改bug&新加配偶接口

---
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZfDoctorShareController.java |   52 ++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 50 insertions(+), 2 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 1cb8036..cab2981 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
@@ -2,11 +2,23 @@
 
 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.ZfDoctor;
+import com.ruoyi.domain.ZfDoctorDownload;
+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 java.util.ArrayList;
+import java.util.List;
+
+import static com.ruoyi.common.core.page.TableSupport.PAGE_NUM;
+import static com.ruoyi.common.core.page.TableSupport.PAGE_SIZE;
 
 @RestController
 @RequestMapping("/ZfDoctorShare")
@@ -14,6 +26,14 @@
     @Resource
     ZfDoctorShareService zfDoctorShareService;
 
+    @Resource
+    ZfDoctorService zfDoctorService;
+
+    @Resource
+    ZInfoUserService zInfoUserService;
+
+    @Resource
+    ZfDoctorDownloadService zfDoctorDownloadService;
     /**
      * 鍒嗕韩鏁版嵁
      */
@@ -27,8 +47,10 @@
      */
     @PostMapping("/getInfoByUserId")
     public AjaxResult empowerGetInfo(@RequestBody ShareMore zfDoctor){
+        Integer pageNum = Convert.toInt(ServletUtils.getParameter(PAGE_NUM), 1);
+        Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
 
-        return zfDoctorShareService.listByFidAid(zfDoctor);
+        return zfDoctorService.selectListById(zfDoctorShareService.listByFidAid(zfDoctor),pageNum,pageSize);
     }
 
     /**
@@ -36,7 +58,7 @@
      */
     @GetMapping("/getInfoByShareId")
     public AjaxResult empowerGetInfo2(){
-        return zfDoctorShareService.listByUserId();
+        return zfDoctorShareService.listUserId();
     }
     /**
      * 鏍规嵁userId鍜宻hareId鏀跺洖宸茬粡鎺堟潈缁欓偅浜涗汉
@@ -46,5 +68,31 @@
         return zfDoctorShareService.deleteZa(zfDoctor);
     }
 
+    /**
+     * 涓嬭浇鍒嗕韩鐨勬暟鎹�
+     */
+    @PostMapping("/downloadDate")
+    public AjaxResult ifDownLoad(@RequestBody ZfDoctorDownload zfDoctorDownload){
+        return zfDoctorDownloadService.addData(zfDoctorDownload);
+    }
+
+    /**
+     * 灞曠ず涓嬭浇鍒嗕韩鐨勬暟鎹�
+     */
+    @GetMapping("/all")
+    public List<ZfDoctor> data(ZfDoctorDownload zfDoctorDownload){
+        Integer pageNum = Convert.toInt(ServletUtils.getParameter(PAGE_NUM), 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;
+    }
 
 }

--
Gitblit v1.9.1