From ffbf5aeb0804d37ed53a43701981c535102e06c0 Mon Sep 17 00:00:00 2001
From: zqy <2522236926@qq.com>
Date: 星期一, 12 八月 2024 21:32:17 +0800
Subject: [PATCH] 个人模块分享
---
zhang-content/src/main/java/com/ruoyi/service/ZCertificateDownloadService.java | 13
zhang-content/src/main/java/com/ruoyi/service/ZCertificateShareService.java | 25
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZIdeaShareController.java | 81 +
zhang-content/src/main/java/com/ruoyi/service/impl/ZAutobiographyDownloadServiceImpl.java | 145 +
zhang-content/src/main/java/com/ruoyi/service/ZSecretShareService.java | 25
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZSecretShareController.java | 82 +
zhang-content/src/main/java/com/ruoyi/service/ZExperienceDownloadService.java | 13
zhang-content/src/main/java/com/ruoyi/service/ZSecretDownloadService.java | 13
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZCertificateShareController.java | 81 +
zhang-content/src/main/java/com/ruoyi/domain/ZSecret.java | 5
zhang-content/src/main/java/com/ruoyi/service/impl/ZPropertyShareServiceImpl.java | 193 ++
zhang-content/src/main/java/com/ruoyi/service/impl/ZExperienceDownloadServiceImpl.java | 144 +
zhang-content/src/main/java/com/ruoyi/service/impl/ZExperienceShareServiceImpl.java | 194 ++
zhang-content/src/main/java/com/ruoyi/service/impl/ZfRelationDownloadServiceImpl.java | 144 +
zhang-content/src/main/java/com/ruoyi/service/ZHonorDownloadService.java | 13
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZAbroadShareController.java | 81 +
zhang-content/src/main/java/com/ruoyi/domain/ZIdea.java | 4
zhang-content/src/main/java/com/ruoyi/service/ZAbroadDownloadService.java | 13
zhang-content/src/main/java/com/ruoyi/service/impl/ZSecretDownloadServiceImpl.java | 144 +
zhang-content/src/main/java/com/ruoyi/service/impl/ZSelfNoteDownloadServiceImpl.java | 144 +
zhang-content/src/main/java/com/ruoyi/domain/ZAbroad.java | 5
zhang-content/src/main/java/com/ruoyi/service/impl/ZCertificateShareServiceImpl.java | 194 ++
zhang-content/src/main/java/com/ruoyi/service/ZIdeaDownloadService.java | 13
zhang-content/src/main/java/com/ruoyi/domain/ZExperience.java | 5
zhang-content/src/main/java/com/ruoyi/service/ZfRelationShareService.java | 25
zhang-content/src/main/java/com/ruoyi/service/ZPropertyShareService.java | 25
zhang-content/src/main/java/com/ruoyi/service/ZAbroadShareService.java | 25
zhang-content/src/main/java/com/ruoyi/service/ZPropertyDownloadService.java | 13
zhang-content/src/main/java/com/ruoyi/service/ZExperienceShareService.java | 25
zhang-content/src/main/java/com/ruoyi/service/ZIdeaShareService.java | 25
zhang-content/src/main/java/com/ruoyi/service/impl/ZHonorDownloadServiceImpl.java | 145 +
zhang-content/src/main/java/com/ruoyi/service/ZHonorShareService.java | 25
zhang-content/src/main/java/com/ruoyi/service/ZfRelationDownloadService.java | 13
zhang-content/src/main/java/com/ruoyi/service/impl/ZfEquipDownloadServiceImpl.java | 2
zhang-content/src/main/java/com/ruoyi/service/impl/ZAbroadDownloadServiceImpl.java | 144 +
zhang-content/src/main/java/com/ruoyi/domain/ZAutobiography.java | 5
zhang-content/src/main/java/com/ruoyi/service/impl/ZfRelationShareServiceImpl.java | 193 ++
zhang-content/src/main/java/com/ruoyi/domain/ZProperty.java | 5
zhang-content/src/main/java/com/ruoyi/domain/ZCertificate.java | 5
zhang-content/src/main/java/com/ruoyi/service/ZAutobiographyShareService.java | 25
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZSelfNoteShareController.java | 81 +
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZExperienceShareController.java | 81 +
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZPropertyShareController.java | 81 +
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZfCleanShareController.java | 8
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZAutobiographyShareController.java | 81 +
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZHonorShareController.java | 81 +
zhang-content/src/main/java/com/ruoyi/domain/ZfRelation.java | 5
zhang-content/src/main/java/com/ruoyi/service/ZAutobiographyDownloadService.java | 13
zhang-content/src/main/java/com/ruoyi/service/impl/ZPropertyDownloadServiceImpl.java | 144 +
zhang-content/src/main/java/com/ruoyi/service/impl/ZCertificateDownloadServiceImpl.java | 144 +
zhang-content/src/main/java/com/ruoyi/service/impl/ZIdeaDownloadServiceImpl.java | 144 +
zhang-content/src/main/java/com/ruoyi/service/impl/ZAutobiographyShareServiceImpl.java | 194 ++
zhang-content/src/main/java/com/ruoyi/service/ZSelfNoteDownloadService.java | 13
zhang-content/src/main/java/com/ruoyi/service/ZSelfNoteShareService.java | 25
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZfRelationShareController.java | 82 +
zhang-content/src/main/java/com/ruoyi/service/impl/ZSelfNoteShareServiceImpl.java | 194 ++
zhang-content/src/main/java/com/ruoyi/service/impl/ZSecretShareServiceImpl.java | 193 ++
zhang-content/src/main/java/com/ruoyi/service/impl/ZAbroadShareServiceImpl.java | 191 ++
zhang-content/src/main/java/com/ruoyi/service/impl/ZHonorShareServiceImpl.java | 191 ++
zhang-content/src/main/java/com/ruoyi/domain/ZSelfNote.java | 4
zhang-content/src/main/java/com/ruoyi/service/impl/ZIdeaShareServiceImpl.java | 193 ++
zhang-content/src/main/java/com/ruoyi/domain/ZHonor.java | 5
62 files changed, 4,611 insertions(+), 11 deletions(-)
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZAbroadShareController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZAbroadShareController.java
new file mode 100644
index 0000000..a6cb3a5
--- /dev/null
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZAbroadShareController.java
@@ -0,0 +1,81 @@
+package com.ruoyi.web.controller.zhang;
+
+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.ZAbroadDownloadService;
+import com.ruoyi.service.ZAbroadShareService;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+
+import static com.ruoyi.common.core.page.TableSupport.PAGE_NO;
+import static com.ruoyi.common.core.page.TableSupport.PAGE_SIZE;
+
+@RestController
+@RequestMapping("/zAbroadShare")
+public class ZAbroadShareController extends BaseController {
+ @Resource
+ ZAbroadDownloadService zAbroadDownloadService;
+
+ @Resource
+ ZAbroadShareService zAbroadShareService;
+
+ @PostMapping("/share")
+ public AjaxResult share(@RequestBody ShareMore zfDoctor){
+ zfDoctor.setSysMenuId(20105L);
+ return zAbroadShareService.saveZa(zfDoctor);
+ }
+
+ /**
+ * 鏍规嵁UserId鍜屽垎浜汉shareId鏌ョ湅宸茬粡鎺堟潈缁欓偅浜涗汉閭d簺鏁版嵁
+ */
+ @PostMapping("/getInfoByUserId")
+ public AjaxResult empowerGetInfo(@RequestBody ShareMore zfDoctor){
+ zfDoctor.setSysMenuId(20105L);
+ Integer pageNo = Convert.toInt(ServletUtils.getParameter(PAGE_NO), 1);
+ Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
+ return zAbroadShareService.listByFidAid(zfDoctor,pageNo,pageSize) ;
+ }
+
+ /**
+ * 鐢ㄦ埛鑷繁鏌ョ湅鍒汉鍒嗕韩鐨勬暟鎹拰鍒嗕韩浜�
+ */
+ @GetMapping("/getInfoByShareId")
+ public AjaxResult empowerGetInfo2(){
+ Integer pageNo = Convert.toInt(ServletUtils.getParameter(PAGE_NO), 1);
+ Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
+ return zAbroadShareService.listUserId(pageNo ,pageSize);
+ }
+ /**
+ * 鏍规嵁userId鍜宻hareId鏀跺洖宸茬粡鎺堟潈缁欓偅浜涗汉
+ */
+ @PostMapping("/deleteInfoByUserId")
+ public AjaxResult deleteEmpower(@RequestBody ShareMore zfDoctor){
+ zfDoctor.setSysMenuId(20105L);
+ return zAbroadShareService.deleteZa(zfDoctor);
+ }
+
+ /**
+ * 涓嬭浇鍒嗕韩鐨勬暟鎹�
+ */
+ @PostMapping("/downloadDate")
+ public AjaxResult ifDownLoad(@RequestBody ZfDownload zfDownload){
+ zfDownload.setSysMenuId(20105L);
+ return zAbroadDownloadService.addData(zfDownload);
+ }
+
+ /**
+ * 灞曠ず涓嬭浇鍒嗕韩鐨勬暟鎹�
+ */
+ @GetMapping("/all")
+ public AjaxResult data(ZfDownload zfDownload){
+ zfDownload.setSysMenuId(20105L);
+ Integer pageNo = Convert.toInt(ServletUtils.getParameter(PAGE_NO), 1);
+ Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
+ return zAbroadDownloadService.selectDoctorList(zfDownload,pageNo ,pageSize);
+ }
+}
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZAutobiographyShareController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZAutobiographyShareController.java
new file mode 100644
index 0000000..3a343be
--- /dev/null
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZAutobiographyShareController.java
@@ -0,0 +1,81 @@
+package com.ruoyi.web.controller.zhang;
+
+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.ZAutobiographyDownloadService;
+import com.ruoyi.service.ZAutobiographyShareService;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+
+import static com.ruoyi.common.core.page.TableSupport.PAGE_NO;
+import static com.ruoyi.common.core.page.TableSupport.PAGE_SIZE;
+
+@RestController
+@RequestMapping("/zAutobiographyShare")
+public class ZAutobiographyShareController extends BaseController {
+ @Resource
+ ZAutobiographyDownloadService zAutobiographyDownloadService;
+
+ @Resource
+ ZAutobiographyShareService zAutobiographyShareService;
+
+ @PostMapping("/share")
+ public AjaxResult share(@RequestBody ShareMore zfDoctor){
+ zfDoctor.setSysMenuId(20106L);
+ return zAutobiographyShareService.saveZa(zfDoctor);
+ }
+
+ /**
+ * 鏍规嵁UserId鍜屽垎浜汉shareId鏌ョ湅宸茬粡鎺堟潈缁欓偅浜涗汉閭d簺鏁版嵁
+ */
+ @PostMapping("/getInfoByUserId")
+ public AjaxResult empowerGetInfo(@RequestBody ShareMore zfDoctor){
+ zfDoctor.setSysMenuId(20106L);
+ Integer pageNo = Convert.toInt(ServletUtils.getParameter(PAGE_NO), 1);
+ Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
+ return zAutobiographyShareService.listByFidAid(zfDoctor,pageNo,pageSize) ;
+ }
+
+ /**
+ * 鐢ㄦ埛鑷繁鏌ョ湅鍒汉鍒嗕韩鐨勬暟鎹拰鍒嗕韩浜�
+ */
+ @GetMapping("/getInfoByShareId")
+ public AjaxResult empowerGetInfo2(){
+ Integer pageNo = Convert.toInt(ServletUtils.getParameter(PAGE_NO), 1);
+ Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
+ return zAutobiographyShareService.listUserId(pageNo ,pageSize);
+ }
+ /**
+ * 鏍规嵁userId鍜宻hareId鏀跺洖宸茬粡鎺堟潈缁欓偅浜涗汉
+ */
+ @PostMapping("/deleteInfoByUserId")
+ public AjaxResult deleteEmpower(@RequestBody ShareMore zfDoctor){
+ zfDoctor.setSysMenuId(20106L);
+ return zAutobiographyShareService.deleteZa(zfDoctor);
+ }
+
+ /**
+ * 涓嬭浇鍒嗕韩鐨勬暟鎹�
+ */
+ @PostMapping("/downloadDate")
+ public AjaxResult ifDownLoad(@RequestBody ZfDownload zfDownload){
+ zfDownload.setSysMenuId(20106L);
+ return zAutobiographyDownloadService.addData(zfDownload);
+ }
+
+ /**
+ * 灞曠ず涓嬭浇鍒嗕韩鐨勬暟鎹�
+ */
+ @GetMapping("/all")
+ public AjaxResult data(ZfDownload zfDownload){
+ zfDownload.setSysMenuId(20106L);
+ Integer pageNo = Convert.toInt(ServletUtils.getParameter(PAGE_NO), 1);
+ Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
+ return zAutobiographyDownloadService.selectDoctorList(zfDownload,pageNo ,pageSize);
+ }
+}
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZCertificateShareController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZCertificateShareController.java
new file mode 100644
index 0000000..38bff46
--- /dev/null
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZCertificateShareController.java
@@ -0,0 +1,81 @@
+package com.ruoyi.web.controller.zhang;
+
+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.ZCertificateDownloadService;
+import com.ruoyi.service.ZCertificateShareService;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+
+import static com.ruoyi.common.core.page.TableSupport.PAGE_NO;
+import static com.ruoyi.common.core.page.TableSupport.PAGE_SIZE;
+
+@RestController
+@RequestMapping("/zCertificateShare")
+public class ZCertificateShareController extends BaseController {
+ @Resource
+ ZCertificateDownloadService zCertificateDownloadService;
+
+ @Resource
+ ZCertificateShareService zCertificateShareService;
+
+ @PostMapping("/share")
+ public AjaxResult share(@RequestBody ShareMore zfDoctor){
+ zfDoctor.setSysMenuId(20104L);
+ return zCertificateShareService.saveZa(zfDoctor);
+ }
+
+ /**
+ * 鏍规嵁UserId鍜屽垎浜汉shareId鏌ョ湅宸茬粡鎺堟潈缁欓偅浜涗汉閭d簺鏁版嵁
+ */
+ @PostMapping("/getInfoByUserId")
+ public AjaxResult empowerGetInfo(@RequestBody ShareMore zfDoctor){
+ zfDoctor.setSysMenuId(20104L);
+ Integer pageNo = Convert.toInt(ServletUtils.getParameter(PAGE_NO), 1);
+ Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
+ return zCertificateShareService.listByFidAid(zfDoctor,pageNo,pageSize) ;
+ }
+
+ /**
+ * 鐢ㄦ埛鑷繁鏌ョ湅鍒汉鍒嗕韩鐨勬暟鎹拰鍒嗕韩浜�
+ */
+ @GetMapping("/getInfoByShareId")
+ public AjaxResult empowerGetInfo2(){
+ Integer pageNo = Convert.toInt(ServletUtils.getParameter(PAGE_NO), 1);
+ Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
+ return zCertificateShareService.listUserId(pageNo ,pageSize);
+ }
+ /**
+ * 鏍规嵁userId鍜宻hareId鏀跺洖宸茬粡鎺堟潈缁欓偅浜涗汉
+ */
+ @PostMapping("/deleteInfoByUserId")
+ public AjaxResult deleteEmpower(@RequestBody ShareMore zfDoctor){
+ zfDoctor.setSysMenuId(20104L);
+ return zCertificateShareService.deleteZa(zfDoctor);
+ }
+
+ /**
+ * 涓嬭浇鍒嗕韩鐨勬暟鎹�
+ */
+ @PostMapping("/downloadDate")
+ public AjaxResult ifDownLoad(@RequestBody ZfDownload zfDownload){
+ zfDownload.setSysMenuId(20104L);
+ return zCertificateDownloadService.addData(zfDownload);
+ }
+
+ /**
+ * 灞曠ず涓嬭浇鍒嗕韩鐨勬暟鎹�
+ */
+ @GetMapping("/all")
+ public AjaxResult data(ZfDownload zfDownload){
+ zfDownload.setSysMenuId(20104L);
+ Integer pageNo = Convert.toInt(ServletUtils.getParameter(PAGE_NO), 1);
+ Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
+ return zCertificateDownloadService.selectDoctorList(zfDownload,pageNo ,pageSize);
+ }
+}
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZExperienceShareController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZExperienceShareController.java
new file mode 100644
index 0000000..8325129
--- /dev/null
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZExperienceShareController.java
@@ -0,0 +1,81 @@
+package com.ruoyi.web.controller.zhang;
+
+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.ZExperienceDownloadService;
+import com.ruoyi.service.ZExperienceShareService;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+
+import static com.ruoyi.common.core.page.TableSupport.PAGE_NO;
+import static com.ruoyi.common.core.page.TableSupport.PAGE_SIZE;
+
+@RestController
+@RequestMapping("/zExperienceShare")
+public class ZExperienceShareController extends BaseController {
+ @Resource
+ ZExperienceDownloadService zExperienceDownloadService;
+
+ @Resource
+ ZExperienceShareService zExperienceShareService;
+
+ @PostMapping("/share")
+ public AjaxResult share(@RequestBody ShareMore zfDoctor){
+ zfDoctor.setSysMenuId(20102L);
+ return zExperienceShareService.saveZa(zfDoctor);
+ }
+
+ /**
+ * 鏍规嵁UserId鍜屽垎浜汉shareId鏌ョ湅宸茬粡鎺堟潈缁欓偅浜涗汉閭d簺鏁版嵁
+ */
+ @PostMapping("/getInfoByUserId")
+ public AjaxResult empowerGetInfo(@RequestBody ShareMore zfDoctor){
+ zfDoctor.setSysMenuId(20102L);
+ Integer pageNo = Convert.toInt(ServletUtils.getParameter(PAGE_NO), 1);
+ Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
+ return zExperienceShareService.listByFidAid(zfDoctor,pageNo,pageSize) ;
+ }
+
+ /**
+ * 鐢ㄦ埛鑷繁鏌ョ湅鍒汉鍒嗕韩鐨勬暟鎹拰鍒嗕韩浜�
+ */
+ @GetMapping("/getInfoByShareId")
+ public AjaxResult empowerGetInfo2(){
+ Integer pageNo = Convert.toInt(ServletUtils.getParameter(PAGE_NO), 1);
+ Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
+ return zExperienceShareService.listUserId(pageNo ,pageSize);
+ }
+ /**
+ * 鏍规嵁userId鍜宻hareId鏀跺洖宸茬粡鎺堟潈缁欓偅浜涗汉
+ */
+ @PostMapping("/deleteInfoByUserId")
+ public AjaxResult deleteEmpower(@RequestBody ShareMore zfDoctor){
+ zfDoctor.setSysMenuId(20102L);
+ return zExperienceShareService.deleteZa(zfDoctor);
+ }
+
+ /**
+ * 涓嬭浇鍒嗕韩鐨勬暟鎹�
+ */
+ @PostMapping("/downloadDate")
+ public AjaxResult ifDownLoad(@RequestBody ZfDownload zfDownload){
+ zfDownload.setSysMenuId(20102L);
+ return zExperienceDownloadService.addData(zfDownload);
+ }
+
+ /**
+ * 灞曠ず涓嬭浇鍒嗕韩鐨勬暟鎹�
+ */
+ @GetMapping("/all")
+ public AjaxResult data(ZfDownload zfDownload){
+ zfDownload.setSysMenuId(20102L);
+ Integer pageNo = Convert.toInt(ServletUtils.getParameter(PAGE_NO), 1);
+ Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
+ return zExperienceDownloadService.selectDoctorList(zfDownload,pageNo ,pageSize);
+ }
+}
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZHonorShareController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZHonorShareController.java
new file mode 100644
index 0000000..86e55ee
--- /dev/null
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZHonorShareController.java
@@ -0,0 +1,81 @@
+package com.ruoyi.web.controller.zhang;
+
+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.ZHonorDownloadService;
+import com.ruoyi.service.ZHonorShareService;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+
+import static com.ruoyi.common.core.page.TableSupport.PAGE_NO;
+import static com.ruoyi.common.core.page.TableSupport.PAGE_SIZE;
+
+@RestController
+@RequestMapping("/zHonorShare")
+public class ZHonorShareController extends BaseController {
+ @Resource
+ ZHonorDownloadService zHonorDownloadService;
+
+ @Resource
+ ZHonorShareService zHonorShareService;
+
+ @PostMapping("/share")
+ public AjaxResult share(@RequestBody ShareMore zfDoctor){
+ zfDoctor.setSysMenuId(2053L);
+ return zHonorShareService.saveZa(zfDoctor);
+ }
+
+ /**
+ * 鏍规嵁UserId鍜屽垎浜汉shareId鏌ョ湅宸茬粡鎺堟潈缁欓偅浜涗汉閭d簺鏁版嵁
+ */
+ @PostMapping("/getInfoByUserId")
+ public AjaxResult empowerGetInfo(@RequestBody ShareMore zfDoctor){
+ zfDoctor.setSysMenuId(2053L);
+ Integer pageNo = Convert.toInt(ServletUtils.getParameter(PAGE_NO), 1);
+ Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
+ return zHonorShareService.listByFidAid(zfDoctor,pageNo,pageSize) ;
+ }
+
+ /**
+ * 鐢ㄦ埛鑷繁鏌ョ湅鍒汉鍒嗕韩鐨勬暟鎹拰鍒嗕韩浜�
+ */
+ @GetMapping("/getInfoByShareId")
+ public AjaxResult empowerGetInfo2(){
+ Integer pageNo = Convert.toInt(ServletUtils.getParameter(PAGE_NO), 1);
+ Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
+ return zHonorShareService.listUserId(pageNo ,pageSize);
+ }
+ /**
+ * 鏍规嵁userId鍜宻hareId鏀跺洖宸茬粡鎺堟潈缁欓偅浜涗汉
+ */
+ @PostMapping("/deleteInfoByUserId")
+ public AjaxResult deleteEmpower(@RequestBody ShareMore zfDoctor){
+ zfDoctor.setSysMenuId(2053L);
+ return zHonorShareService.deleteZa(zfDoctor);
+ }
+
+ /**
+ * 涓嬭浇鍒嗕韩鐨勬暟鎹�
+ */
+ @PostMapping("/downloadDate")
+ public AjaxResult ifDownLoad(@RequestBody ZfDownload zfDownload){
+ zfDownload.setSysMenuId(2053L);
+ return zHonorDownloadService.addData(zfDownload);
+ }
+
+ /**
+ * 灞曠ず涓嬭浇鍒嗕韩鐨勬暟鎹�
+ */
+ @GetMapping("/all")
+ public AjaxResult data(ZfDownload zfDownload){
+ zfDownload.setSysMenuId(2053L);
+ Integer pageNo = Convert.toInt(ServletUtils.getParameter(PAGE_NO), 1);
+ Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
+ return zHonorDownloadService.selectDoctorList(zfDownload,pageNo ,pageSize);
+ }
+}
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZIdeaShareController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZIdeaShareController.java
new file mode 100644
index 0000000..e39734d
--- /dev/null
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZIdeaShareController.java
@@ -0,0 +1,81 @@
+package com.ruoyi.web.controller.zhang;
+
+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.ZIdeaDownloadService;
+import com.ruoyi.service.ZIdeaShareService;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+
+import static com.ruoyi.common.core.page.TableSupport.PAGE_NO;
+import static com.ruoyi.common.core.page.TableSupport.PAGE_SIZE;
+
+@RestController
+@RequestMapping("/zIdeaShare")
+public class ZIdeaShareController extends BaseController {
+ @Resource
+ ZIdeaDownloadService zIdeaDownloadService;
+
+ @Resource
+ ZIdeaShareService zIdeaShareService;
+
+ @PostMapping("/share")
+ public AjaxResult share(@RequestBody ShareMore zfDoctor){
+ zfDoctor.setSysMenuId(2027L);
+ return zIdeaShareService.saveZa(zfDoctor);
+ }
+
+ /**
+ * 鏍规嵁UserId鍜屽垎浜汉shareId鏌ョ湅宸茬粡鎺堟潈缁欓偅浜涗汉閭d簺鏁版嵁
+ */
+ @PostMapping("/getInfoByUserId")
+ public AjaxResult empowerGetInfo(@RequestBody ShareMore zfDoctor){
+ zfDoctor.setSysMenuId(2027L);
+ Integer pageNo = Convert.toInt(ServletUtils.getParameter(PAGE_NO), 1);
+ Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
+ return zIdeaShareService.listByFidAid(zfDoctor,pageNo,pageSize) ;
+ }
+
+ /**
+ * 鐢ㄦ埛鑷繁鏌ョ湅鍒汉鍒嗕韩鐨勬暟鎹拰鍒嗕韩浜�
+ */
+ @GetMapping("/getInfoByShareId")
+ public AjaxResult empowerGetInfo2(){
+ Integer pageNo = Convert.toInt(ServletUtils.getParameter(PAGE_NO), 1);
+ Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
+ return zIdeaShareService.listUserId(pageNo ,pageSize);
+ }
+ /**
+ * 鏍规嵁userId鍜宻hareId鏀跺洖宸茬粡鎺堟潈缁欓偅浜涗汉
+ */
+ @PostMapping("/deleteInfoByUserId")
+ public AjaxResult deleteEmpower(@RequestBody ShareMore zfDoctor){
+ zfDoctor.setSysMenuId(2027L);
+ return zIdeaShareService.deleteZa(zfDoctor);
+ }
+
+ /**
+ * 涓嬭浇鍒嗕韩鐨勬暟鎹�
+ */
+ @PostMapping("/downloadDate")
+ public AjaxResult ifDownLoad(@RequestBody ZfDownload zfDownload){
+ zfDownload.setSysMenuId(2027L);
+ return zIdeaDownloadService.addData(zfDownload);
+ }
+
+ /**
+ * 灞曠ず涓嬭浇鍒嗕韩鐨勬暟鎹�
+ */
+ @GetMapping("/all")
+ public AjaxResult data(ZfDownload zfDownload){
+ zfDownload.setSysMenuId(2027L);
+ Integer pageNo = Convert.toInt(ServletUtils.getParameter(PAGE_NO), 1);
+ Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
+ return zIdeaDownloadService.selectDoctorList(zfDownload,pageNo ,pageSize);
+ }
+}
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZPropertyShareController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZPropertyShareController.java
new file mode 100644
index 0000000..acd10ec
--- /dev/null
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZPropertyShareController.java
@@ -0,0 +1,81 @@
+package com.ruoyi.web.controller.zhang;
+
+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.ZPropertyDownloadService;
+import com.ruoyi.service.ZPropertyShareService;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+
+import static com.ruoyi.common.core.page.TableSupport.PAGE_NO;
+import static com.ruoyi.common.core.page.TableSupport.PAGE_SIZE;
+
+@RestController
+@RequestMapping("/zPropertyShare")
+public class ZPropertyShareController extends BaseController {
+ @Resource
+ ZPropertyDownloadService zPropertyDownloadService;
+
+ @Resource
+ ZPropertyShareService zPropertyShareService;
+
+ @PostMapping("/share")
+ public AjaxResult share(@RequestBody ShareMore zfDoctor){
+ zfDoctor.setSysMenuId(2026L);
+ return zPropertyShareService.saveZa(zfDoctor);
+ }
+
+ /**
+ * 鏍规嵁UserId鍜屽垎浜汉shareId鏌ョ湅宸茬粡鎺堟潈缁欓偅浜涗汉閭d簺鏁版嵁
+ */
+ @PostMapping("/getInfoByUserId")
+ public AjaxResult empowerGetInfo(@RequestBody ShareMore zfDoctor){
+ zfDoctor.setSysMenuId(2026L);
+ Integer pageNo = Convert.toInt(ServletUtils.getParameter(PAGE_NO), 1);
+ Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
+ return zPropertyShareService.listByFidAid(zfDoctor,pageNo,pageSize) ;
+ }
+
+ /**
+ * 鐢ㄦ埛鑷繁鏌ョ湅鍒汉鍒嗕韩鐨勬暟鎹拰鍒嗕韩浜�
+ */
+ @GetMapping("/getInfoByShareId")
+ public AjaxResult empowerGetInfo2(){
+ Integer pageNo = Convert.toInt(ServletUtils.getParameter(PAGE_NO), 1);
+ Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
+ return zPropertyShareService.listUserId(pageNo ,pageSize);
+ }
+ /**
+ * 鏍规嵁userId鍜宻hareId鏀跺洖宸茬粡鎺堟潈缁欓偅浜涗汉
+ */
+ @PostMapping("/deleteInfoByUserId")
+ public AjaxResult deleteEmpower(@RequestBody ShareMore zfDoctor){
+ zfDoctor.setSysMenuId(2026L);
+ return zPropertyShareService.deleteZa(zfDoctor);
+ }
+
+ /**
+ * 涓嬭浇鍒嗕韩鐨勬暟鎹�
+ */
+ @PostMapping("/downloadDate")
+ public AjaxResult ifDownLoad(@RequestBody ZfDownload zfDownload){
+ zfDownload.setSysMenuId(2026L);
+ return zPropertyDownloadService.addData(zfDownload);
+ }
+
+ /**
+ * 灞曠ず涓嬭浇鍒嗕韩鐨勬暟鎹�
+ */
+ @GetMapping("/all")
+ public AjaxResult data(ZfDownload zfDownload){
+ zfDownload.setSysMenuId(2026L);
+ Integer pageNo = Convert.toInt(ServletUtils.getParameter(PAGE_NO), 1);
+ Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
+ return zPropertyDownloadService.selectDoctorList(zfDownload,pageNo ,pageSize);
+ }
+}
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZSecretShareController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZSecretShareController.java
new file mode 100644
index 0000000..1ea6ad1
--- /dev/null
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZSecretShareController.java
@@ -0,0 +1,82 @@
+package com.ruoyi.web.controller.zhang;
+
+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.ZSecretDownloadService;
+import com.ruoyi.service.ZfCleanDownloadService;
+import com.ruoyi.service.ZSecretShareService;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+
+import static com.ruoyi.common.core.page.TableSupport.PAGE_NO;
+import static com.ruoyi.common.core.page.TableSupport.PAGE_SIZE;
+
+@RestController
+@RequestMapping("/zSecretShare")
+public class ZSecretShareController extends BaseController {
+ @Resource
+ ZSecretDownloadService zSecretDownloadService;
+
+ @Resource
+ ZSecretShareService zSecretShareService;
+
+ @PostMapping("/share")
+ public AjaxResult share(@RequestBody ShareMore zfDoctor){
+ zfDoctor.setSysMenuId(2031L);
+ return zSecretShareService.saveZa(zfDoctor);
+ }
+
+ /**
+ * 鏍规嵁UserId鍜屽垎浜汉shareId鏌ョ湅宸茬粡鎺堟潈缁欓偅浜涗汉閭d簺鏁版嵁
+ */
+ @PostMapping("/getInfoByUserId")
+ public AjaxResult empowerGetInfo(@RequestBody ShareMore zfDoctor){
+ zfDoctor.setSysMenuId(2031L);
+ Integer pageNo = Convert.toInt(ServletUtils.getParameter(PAGE_NO), 1);
+ Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
+ return zSecretShareService.listByFidAid(zfDoctor,pageNo,pageSize) ;
+ }
+
+ /**
+ * 鐢ㄦ埛鑷繁鏌ョ湅鍒汉鍒嗕韩鐨勬暟鎹拰鍒嗕韩浜�
+ */
+ @GetMapping("/getInfoByShareId")
+ public AjaxResult empowerGetInfo2(){
+ Integer pageNo = Convert.toInt(ServletUtils.getParameter(PAGE_NO), 1);
+ Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
+ return zSecretShareService.listUserId(pageNo ,pageSize);
+ }
+ /**
+ * 鏍规嵁userId鍜宻hareId鏀跺洖宸茬粡鎺堟潈缁欓偅浜涗汉
+ */
+ @PostMapping("/deleteInfoByUserId")
+ public AjaxResult deleteEmpower(@RequestBody ShareMore zfDoctor){
+ zfDoctor.setSysMenuId(2031L);
+ return zSecretShareService.deleteZa(zfDoctor);
+ }
+
+ /**
+ * 涓嬭浇鍒嗕韩鐨勬暟鎹�
+ */
+ @PostMapping("/downloadDate")
+ public AjaxResult ifDownLoad(@RequestBody ZfDownload zfDownload){
+ zfDownload.setSysMenuId(2031L);
+ return zSecretDownloadService.addData(zfDownload);
+ }
+
+ /**
+ * 灞曠ず涓嬭浇鍒嗕韩鐨勬暟鎹�
+ */
+ @GetMapping("/all")
+ public AjaxResult data(ZfDownload zfDownload){
+ zfDownload.setSysMenuId(2031L);
+ Integer pageNo = Convert.toInt(ServletUtils.getParameter(PAGE_NO), 1);
+ Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
+ return zSecretDownloadService.selectDoctorList(zfDownload,pageNo ,pageSize);
+ }
+}
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZSelfNoteShareController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZSelfNoteShareController.java
new file mode 100644
index 0000000..a472284
--- /dev/null
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZSelfNoteShareController.java
@@ -0,0 +1,81 @@
+package com.ruoyi.web.controller.zhang;
+
+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.ZSelfNoteDownloadService;
+import com.ruoyi.service.ZSelfNoteShareService;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+
+import static com.ruoyi.common.core.page.TableSupport.PAGE_NO;
+import static com.ruoyi.common.core.page.TableSupport.PAGE_SIZE;
+
+@RestController
+@RequestMapping("/zSelfNoteShare")
+public class ZSelfNoteShareController extends BaseController {
+ @Resource
+ ZSelfNoteDownloadService zSelfNoteDownloadService;
+
+ @Resource
+ ZSelfNoteShareService zSelfNoteShareService;
+
+ @PostMapping("/share")
+ public AjaxResult share(@RequestBody ShareMore zfDoctor){
+ zfDoctor.setSysMenuId(2010L);
+ return zSelfNoteShareService.saveZa(zfDoctor);
+ }
+
+ /**
+ * 鏍规嵁UserId鍜屽垎浜汉shareId鏌ョ湅宸茬粡鎺堟潈缁欓偅浜涗汉閭d簺鏁版嵁
+ */
+ @PostMapping("/getInfoByUserId")
+ public AjaxResult empowerGetInfo(@RequestBody ShareMore zfDoctor){
+ zfDoctor.setSysMenuId(2010L);
+ Integer pageNo = Convert.toInt(ServletUtils.getParameter(PAGE_NO), 1);
+ Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
+ return zSelfNoteShareService.listByFidAid(zfDoctor,pageNo,pageSize) ;
+ }
+
+ /**
+ * 鐢ㄦ埛鑷繁鏌ョ湅鍒汉鍒嗕韩鐨勬暟鎹拰鍒嗕韩浜�
+ */
+ @GetMapping("/getInfoByShareId")
+ public AjaxResult empowerGetInfo2(){
+ Integer pageNo = Convert.toInt(ServletUtils.getParameter(PAGE_NO), 1);
+ Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
+ return zSelfNoteShareService.listUserId(pageNo ,pageSize);
+ }
+ /**
+ * 鏍规嵁userId鍜宻hareId鏀跺洖宸茬粡鎺堟潈缁欓偅浜涗汉
+ */
+ @PostMapping("/deleteInfoByUserId")
+ public AjaxResult deleteEmpower(@RequestBody ShareMore zfDoctor){
+ zfDoctor.setSysMenuId(2010L);
+ return zSelfNoteShareService.deleteZa(zfDoctor);
+ }
+
+ /**
+ * 涓嬭浇鍒嗕韩鐨勬暟鎹�
+ */
+ @PostMapping("/downloadDate")
+ public AjaxResult ifDownLoad(@RequestBody ZfDownload zfDownload){
+ zfDownload.setSysMenuId(2010L);
+ return zSelfNoteDownloadService.addData(zfDownload);
+ }
+
+ /**
+ * 灞曠ず涓嬭浇鍒嗕韩鐨勬暟鎹�
+ */
+ @GetMapping("/all")
+ public AjaxResult data(ZfDownload zfDownload){
+ zfDownload.setSysMenuId(2010L);
+ Integer pageNo = Convert.toInt(ServletUtils.getParameter(PAGE_NO), 1);
+ Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
+ return zSelfNoteDownloadService.selectDoctorList(zfDownload,pageNo ,pageSize);
+ }
+}
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZfCleanShareController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZfCleanShareController.java
index 25e88f6..977da13 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZfCleanShareController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZfCleanShareController.java
@@ -18,10 +18,10 @@
import static com.ruoyi.common.core.page.TableSupport.PAGE_SIZE;
@RestController
-@RequestMapping("/zfCleanShare")
+@RequestMapping("/zfHonorShare")
public class ZfCleanShareController extends BaseController {
@Resource
- ZfCleanDownloadService zfCleanDownloadController;
+ ZfCleanDownloadService zfCleanDownloadService;
@Resource
ZfCleanShareService zfCleanShareService;
@@ -67,7 +67,7 @@
@PostMapping("/downloadDate")
public AjaxResult ifDownLoad(@RequestBody ZfDownload zfDownload){
zfDownload.setSysMenuId(2020L);
- return zfCleanDownloadController.addData(zfDownload);
+ return zfCleanDownloadService.addData(zfDownload);
}
/**
@@ -78,6 +78,6 @@
zfDownload.setSysMenuId(2020L);
Integer pageNo = Convert.toInt(ServletUtils.getParameter(PAGE_NO), 1);
Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
- return zfCleanDownloadController.selectDoctorList(zfDownload,pageNo ,pageSize);
+ return zfCleanDownloadService.selectDoctorList(zfDownload,pageNo ,pageSize);
}
}
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZfRelationShareController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZfRelationShareController.java
new file mode 100644
index 0000000..02424cc
--- /dev/null
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZfRelationShareController.java
@@ -0,0 +1,82 @@
+package com.ruoyi.web.controller.zhang;
+
+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.ZfRelationDownloadService;
+import com.ruoyi.service.ZfRelationShareService;
+
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+
+import static com.ruoyi.common.core.page.TableSupport.PAGE_NO;
+import static com.ruoyi.common.core.page.TableSupport.PAGE_SIZE;
+
+@RestController
+@RequestMapping("/zfRelationShare")
+public class ZfRelationShareController extends BaseController {
+ @Resource
+ ZfRelationDownloadService zfrelationDownloadService;
+
+ @Resource
+ ZfRelationShareService zfRelationShareService;
+
+ @PostMapping("/share")
+ public AjaxResult share(@RequestBody ShareMore zfDoctor){
+ zfDoctor.setSysMenuId(20103L);
+ return zfRelationShareService.saveZa(zfDoctor);
+ }
+
+ /**
+ * 鏍规嵁UserId鍜屽垎浜汉shareId鏌ョ湅宸茬粡鎺堟潈缁欓偅浜涗汉閭d簺鏁版嵁
+ */
+ @PostMapping("/getInfoByUserId")
+ public AjaxResult empowerGetInfo(@RequestBody ShareMore zfDoctor){
+ zfDoctor.setSysMenuId(20103L);
+ Integer pageNo = Convert.toInt(ServletUtils.getParameter(PAGE_NO), 1);
+ Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
+ return zfRelationShareService.listByFidAid(zfDoctor,pageNo,pageSize) ;
+ }
+
+ /**
+ * 鐢ㄦ埛鑷繁鏌ョ湅鍒汉鍒嗕韩鐨勬暟鎹拰鍒嗕韩浜�
+ */
+ @GetMapping("/getInfoByShareId")
+ public AjaxResult empowerGetInfo2(){
+ Integer pageNo = Convert.toInt(ServletUtils.getParameter(PAGE_NO), 1);
+ Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
+ return zfRelationShareService.listUserId(pageNo ,pageSize);
+ }
+ /**
+ * 鏍规嵁userId鍜宻hareId鏀跺洖宸茬粡鎺堟潈缁欓偅浜涗汉
+ */
+ @PostMapping("/deleteInfoByUserId")
+ public AjaxResult deleteEmpower(@RequestBody ShareMore zfDoctor){
+ zfDoctor.setSysMenuId(20103L);
+ return zfRelationShareService.deleteZa(zfDoctor);
+ }
+
+ /**
+ * 涓嬭浇鍒嗕韩鐨勬暟鎹�
+ */
+ @PostMapping("/downloadDate")
+ public AjaxResult ifDownLoad(@RequestBody ZfDownload zfDownload){
+ zfDownload.setSysMenuId(20103L);
+ return zfrelationDownloadService.addData(zfDownload);
+ }
+
+ /**
+ * 灞曠ず涓嬭浇鍒嗕韩鐨勬暟鎹�
+ */
+ @GetMapping("/all")
+ public AjaxResult data(ZfDownload zfDownload){
+ zfDownload.setSysMenuId(20103L);
+ Integer pageNo = Convert.toInt(ServletUtils.getParameter(PAGE_NO), 1);
+ Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
+ return zfrelationDownloadService.selectDoctorList(zfDownload,pageNo ,pageSize);
+ }
+}
diff --git a/zhang-content/src/main/java/com/ruoyi/domain/ZAbroad.java b/zhang-content/src/main/java/com/ruoyi/domain/ZAbroad.java
index 10c8719..9a3433a 100644
--- a/zhang-content/src/main/java/com/ruoyi/domain/ZAbroad.java
+++ b/zhang-content/src/main/java/com/ruoyi/domain/ZAbroad.java
@@ -61,5 +61,8 @@
@Excel(name="缁撴潫鏃ユ湡",dateFormat = "yyyy-MM-dd")
private Date endTime;
-
+ /**
+ * 鍒嗕韩浜�
+ */
+ private Integer shareId;
}
diff --git a/zhang-content/src/main/java/com/ruoyi/domain/ZAutobiography.java b/zhang-content/src/main/java/com/ruoyi/domain/ZAutobiography.java
index e4c2731..5a294c6 100644
--- a/zhang-content/src/main/java/com/ruoyi/domain/ZAutobiography.java
+++ b/zhang-content/src/main/java/com/ruoyi/domain/ZAutobiography.java
@@ -49,5 +49,8 @@
*/
private String ageEnd;
-
+ /**
+ * 鍒嗕韩浜�
+ */
+ private Integer shareId;
}
diff --git a/zhang-content/src/main/java/com/ruoyi/domain/ZCertificate.java b/zhang-content/src/main/java/com/ruoyi/domain/ZCertificate.java
index f010cb8..fc15942 100644
--- a/zhang-content/src/main/java/com/ruoyi/domain/ZCertificate.java
+++ b/zhang-content/src/main/java/com/ruoyi/domain/ZCertificate.java
@@ -73,6 +73,9 @@
@Excel(name = "鎸佹湁鎯呭喌")
private String ownStatus;
-
+ /**
+ * 鍒嗕韩浜�
+ */
+ private Integer shareId;
}
diff --git a/zhang-content/src/main/java/com/ruoyi/domain/ZExperience.java b/zhang-content/src/main/java/com/ruoyi/domain/ZExperience.java
index cd48c2e..8d817cc 100644
--- a/zhang-content/src/main/java/com/ruoyi/domain/ZExperience.java
+++ b/zhang-content/src/main/java/com/ruoyi/domain/ZExperience.java
@@ -63,5 +63,8 @@
@Excel(name = "璇佹槑浜哄悕瀛�")
private String witness;
-
+ /**
+ * 鍒嗕韩浜�
+ */
+ private Integer shareId;
}
diff --git a/zhang-content/src/main/java/com/ruoyi/domain/ZHonor.java b/zhang-content/src/main/java/com/ruoyi/domain/ZHonor.java
index b6565b2..0a2967c 100644
--- a/zhang-content/src/main/java/com/ruoyi/domain/ZHonor.java
+++ b/zhang-content/src/main/java/com/ruoyi/domain/ZHonor.java
@@ -96,5 +96,10 @@
*/
private String url;
+ /**
+ * 鍒嗕韩浜�
+ */
+ private Integer shareId;
+
}
diff --git a/zhang-content/src/main/java/com/ruoyi/domain/ZIdea.java b/zhang-content/src/main/java/com/ruoyi/domain/ZIdea.java
index 529eb44..5973cc8 100644
--- a/zhang-content/src/main/java/com/ruoyi/domain/ZIdea.java
+++ b/zhang-content/src/main/java/com/ruoyi/domain/ZIdea.java
@@ -91,4 +91,8 @@
private Date createTime;
+ /**
+ * 鍒嗕韩浜�
+ */
+ private Integer shareId;
}
diff --git a/zhang-content/src/main/java/com/ruoyi/domain/ZProperty.java b/zhang-content/src/main/java/com/ruoyi/domain/ZProperty.java
index d7a94eb..812b71f 100644
--- a/zhang-content/src/main/java/com/ruoyi/domain/ZProperty.java
+++ b/zhang-content/src/main/java/com/ruoyi/domain/ZProperty.java
@@ -103,5 +103,8 @@
@JsonFormat(pattern = "yyyy-MM-dd")
private Date happenEndTime;
-
+ /**
+ * 鍒嗕韩浜�
+ */
+ private Integer shareId;
}
diff --git a/zhang-content/src/main/java/com/ruoyi/domain/ZSecret.java b/zhang-content/src/main/java/com/ruoyi/domain/ZSecret.java
index adadbe6..bd669b7 100644
--- a/zhang-content/src/main/java/com/ruoyi/domain/ZSecret.java
+++ b/zhang-content/src/main/java/com/ruoyi/domain/ZSecret.java
@@ -114,5 +114,8 @@
@JsonFormat(pattern = "yyyy-MM-dd")
private Date happenEndTime;
-
+ /**
+ * 鍒嗕韩浜�
+ */
+ private Integer shareId;
}
diff --git a/zhang-content/src/main/java/com/ruoyi/domain/ZSelfNote.java b/zhang-content/src/main/java/com/ruoyi/domain/ZSelfNote.java
index 90d792f..b9174ac 100644
--- a/zhang-content/src/main/java/com/ruoyi/domain/ZSelfNote.java
+++ b/zhang-content/src/main/java/com/ruoyi/domain/ZSelfNote.java
@@ -85,4 +85,8 @@
@JsonFormat(pattern = "yyyy-MM-dd")
private Date happenEndTime;
+ /**
+ * 鍒嗕韩浜�
+ */
+ private Integer shareId;
}
diff --git a/zhang-content/src/main/java/com/ruoyi/domain/ZfRelation.java b/zhang-content/src/main/java/com/ruoyi/domain/ZfRelation.java
index 5e4f54f..af14ed8 100644
--- a/zhang-content/src/main/java/com/ruoyi/domain/ZfRelation.java
+++ b/zhang-content/src/main/java/com/ruoyi/domain/ZfRelation.java
@@ -31,4 +31,9 @@
private String otherPosition;
private String otherPolitical;
+
+ /**
+ * 鍒嗕韩浜�
+ */
+ private Integer shareId;
}
diff --git a/zhang-content/src/main/java/com/ruoyi/service/ZAbroadDownloadService.java b/zhang-content/src/main/java/com/ruoyi/service/ZAbroadDownloadService.java
new file mode 100644
index 0000000..b31a993
--- /dev/null
+++ b/zhang-content/src/main/java/com/ruoyi/service/ZAbroadDownloadService.java
@@ -0,0 +1,13 @@
+package com.ruoyi.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.domain.ZfDownload;
+
+public interface ZAbroadDownloadService extends IService<ZfDownload> {
+ AjaxResult addData(ZfDownload zfDownload);
+
+ AjaxResult deleteData(Long[] ids);
+
+ AjaxResult selectDoctorList(ZfDownload zfDownload, Integer pageNo , Integer pageSize);
+}
diff --git a/zhang-content/src/main/java/com/ruoyi/service/ZAbroadShareService.java b/zhang-content/src/main/java/com/ruoyi/service/ZAbroadShareService.java
new file mode 100644
index 0000000..1ff3ab6
--- /dev/null
+++ b/zhang-content/src/main/java/com/ruoyi/service/ZAbroadShareService.java
@@ -0,0 +1,25 @@
+package com.ruoyi.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.domain.ShareMore;
+import com.ruoyi.domain.ZfDownload;
+import com.ruoyi.domain.ZfShare;
+
+import java.util.List;
+
+public interface ZAbroadShareService extends IService<ZfShare> {
+ List<ZfShare> getAuthority();
+
+ AjaxResult saveZa(ShareMore shareMore);
+
+ AjaxResult listByFidAid(ShareMore shareMore,Integer pageNo ,Integer pageSize);
+
+ AjaxResult deleteZa(ShareMore shareMore);
+
+ AjaxResult listByUserId();
+
+ AjaxResult listUserId(Integer pageNo ,Integer pageSize);
+
+ Long getShareId(ZfDownload zfDownload);
+}
diff --git a/zhang-content/src/main/java/com/ruoyi/service/ZAutobiographyDownloadService.java b/zhang-content/src/main/java/com/ruoyi/service/ZAutobiographyDownloadService.java
new file mode 100644
index 0000000..2d79c05
--- /dev/null
+++ b/zhang-content/src/main/java/com/ruoyi/service/ZAutobiographyDownloadService.java
@@ -0,0 +1,13 @@
+package com.ruoyi.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.domain.ZfDownload;
+
+public interface ZAutobiographyDownloadService extends IService<ZfDownload> {
+ AjaxResult addData(ZfDownload zfDownload);
+
+ AjaxResult deleteData(Long[] ids);
+
+ AjaxResult selectDoctorList(ZfDownload zfDownload, Integer pageNo , Integer pageSize);
+}
diff --git a/zhang-content/src/main/java/com/ruoyi/service/ZAutobiographyShareService.java b/zhang-content/src/main/java/com/ruoyi/service/ZAutobiographyShareService.java
new file mode 100644
index 0000000..dd51b50
--- /dev/null
+++ b/zhang-content/src/main/java/com/ruoyi/service/ZAutobiographyShareService.java
@@ -0,0 +1,25 @@
+package com.ruoyi.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.domain.ShareMore;
+import com.ruoyi.domain.ZfDownload;
+import com.ruoyi.domain.ZfShare;
+
+import java.util.List;
+
+public interface ZAutobiographyShareService extends IService<ZfShare> {
+ List<ZfShare> getAuthority();
+
+ AjaxResult saveZa(ShareMore shareMore);
+
+ AjaxResult listByFidAid(ShareMore shareMore,Integer pageNo ,Integer pageSize);
+
+ AjaxResult deleteZa(ShareMore shareMore);
+
+ AjaxResult listByUserId();
+
+ AjaxResult listUserId(Integer pageNo ,Integer pageSize);
+
+ Long getShareId(ZfDownload zfDownload);
+}
diff --git a/zhang-content/src/main/java/com/ruoyi/service/ZCertificateDownloadService.java b/zhang-content/src/main/java/com/ruoyi/service/ZCertificateDownloadService.java
new file mode 100644
index 0000000..a70347b
--- /dev/null
+++ b/zhang-content/src/main/java/com/ruoyi/service/ZCertificateDownloadService.java
@@ -0,0 +1,13 @@
+package com.ruoyi.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.domain.ZfDownload;
+
+public interface ZCertificateDownloadService extends IService<ZfDownload> {
+ AjaxResult addData(ZfDownload zfDownload);
+
+ AjaxResult deleteData(Long[] ids);
+
+ AjaxResult selectDoctorList(ZfDownload zfDownload, Integer pageNo , Integer pageSize);
+}
diff --git a/zhang-content/src/main/java/com/ruoyi/service/ZCertificateShareService.java b/zhang-content/src/main/java/com/ruoyi/service/ZCertificateShareService.java
new file mode 100644
index 0000000..66eaaa5
--- /dev/null
+++ b/zhang-content/src/main/java/com/ruoyi/service/ZCertificateShareService.java
@@ -0,0 +1,25 @@
+package com.ruoyi.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.domain.ShareMore;
+import com.ruoyi.domain.ZfDownload;
+import com.ruoyi.domain.ZfShare;
+
+import java.util.List;
+
+public interface ZCertificateShareService extends IService<ZfShare> {
+ List<ZfShare> getAuthority();
+
+ AjaxResult saveZa(ShareMore shareMore);
+
+ AjaxResult listByFidAid(ShareMore shareMore,Integer pageNo ,Integer pageSize);
+
+ AjaxResult deleteZa(ShareMore shareMore);
+
+ AjaxResult listByUserId();
+
+ AjaxResult listUserId(Integer pageNo ,Integer pageSize);
+
+ Long getShareId(ZfDownload zfDownload);
+}
diff --git a/zhang-content/src/main/java/com/ruoyi/service/ZExperienceDownloadService.java b/zhang-content/src/main/java/com/ruoyi/service/ZExperienceDownloadService.java
new file mode 100644
index 0000000..eb55328
--- /dev/null
+++ b/zhang-content/src/main/java/com/ruoyi/service/ZExperienceDownloadService.java
@@ -0,0 +1,13 @@
+package com.ruoyi.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.domain.ZfDownload;
+
+public interface ZExperienceDownloadService extends IService<ZfDownload> {
+ AjaxResult addData(ZfDownload zfDownload);
+
+ AjaxResult deleteData(Long[] ids);
+
+ AjaxResult selectDoctorList(ZfDownload zfDownload, Integer pageNo , Integer pageSize);
+}
diff --git a/zhang-content/src/main/java/com/ruoyi/service/ZExperienceShareService.java b/zhang-content/src/main/java/com/ruoyi/service/ZExperienceShareService.java
new file mode 100644
index 0000000..414a6ba
--- /dev/null
+++ b/zhang-content/src/main/java/com/ruoyi/service/ZExperienceShareService.java
@@ -0,0 +1,25 @@
+package com.ruoyi.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.domain.ShareMore;
+import com.ruoyi.domain.ZfDownload;
+import com.ruoyi.domain.ZfShare;
+
+import java.util.List;
+
+public interface ZExperienceShareService extends IService<ZfShare> {
+ List<ZfShare> getAuthority();
+
+ AjaxResult saveZa(ShareMore shareMore);
+
+ AjaxResult listByFidAid(ShareMore shareMore,Integer pageNo ,Integer pageSize);
+
+ AjaxResult deleteZa(ShareMore shareMore);
+
+ AjaxResult listByUserId();
+
+ AjaxResult listUserId(Integer pageNo ,Integer pageSize);
+
+ Long getShareId(ZfDownload zfDownload);
+}
diff --git a/zhang-content/src/main/java/com/ruoyi/service/ZHonorDownloadService.java b/zhang-content/src/main/java/com/ruoyi/service/ZHonorDownloadService.java
new file mode 100644
index 0000000..6f26a7b
--- /dev/null
+++ b/zhang-content/src/main/java/com/ruoyi/service/ZHonorDownloadService.java
@@ -0,0 +1,13 @@
+package com.ruoyi.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.domain.ZfDownload;
+
+public interface ZHonorDownloadService extends IService<ZfDownload> {
+ AjaxResult addData(ZfDownload zfDownload);
+
+ AjaxResult deleteData(Long[] ids);
+
+ AjaxResult selectDoctorList(ZfDownload zfDownload, Integer pageNo , Integer pageSize);
+}
diff --git a/zhang-content/src/main/java/com/ruoyi/service/ZHonorShareService.java b/zhang-content/src/main/java/com/ruoyi/service/ZHonorShareService.java
new file mode 100644
index 0000000..7f3eab6
--- /dev/null
+++ b/zhang-content/src/main/java/com/ruoyi/service/ZHonorShareService.java
@@ -0,0 +1,25 @@
+package com.ruoyi.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.domain.ShareMore;
+import com.ruoyi.domain.ZfDownload;
+import com.ruoyi.domain.ZfShare;
+
+import java.util.List;
+
+public interface ZHonorShareService extends IService<ZfShare> {
+ List<ZfShare> getAuthority();
+
+ AjaxResult saveZa(ShareMore shareMore);
+
+ AjaxResult listByFidAid(ShareMore shareMore,Integer pageNo ,Integer pageSize);
+
+ AjaxResult deleteZa(ShareMore shareMore);
+
+ AjaxResult listByUserId();
+
+ AjaxResult listUserId(Integer pageNo ,Integer pageSize);
+
+ Long getShareId(ZfDownload zfDownload);
+}
diff --git a/zhang-content/src/main/java/com/ruoyi/service/ZIdeaDownloadService.java b/zhang-content/src/main/java/com/ruoyi/service/ZIdeaDownloadService.java
new file mode 100644
index 0000000..ff354d6
--- /dev/null
+++ b/zhang-content/src/main/java/com/ruoyi/service/ZIdeaDownloadService.java
@@ -0,0 +1,13 @@
+package com.ruoyi.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.domain.ZfDownload;
+
+public interface ZIdeaDownloadService extends IService<ZfDownload> {
+ AjaxResult addData(ZfDownload zfDownload);
+
+ AjaxResult deleteData(Long[] ids);
+
+ AjaxResult selectDoctorList(ZfDownload zfDownload, Integer pageNo , Integer pageSize);
+}
diff --git a/zhang-content/src/main/java/com/ruoyi/service/ZIdeaShareService.java b/zhang-content/src/main/java/com/ruoyi/service/ZIdeaShareService.java
new file mode 100644
index 0000000..95965f6
--- /dev/null
+++ b/zhang-content/src/main/java/com/ruoyi/service/ZIdeaShareService.java
@@ -0,0 +1,25 @@
+package com.ruoyi.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.domain.ShareMore;
+import com.ruoyi.domain.ZfDownload;
+import com.ruoyi.domain.ZfShare;
+
+import java.util.List;
+
+public interface ZIdeaShareService extends IService<ZfShare> {
+ List<ZfShare> getAuthority();
+
+ AjaxResult saveZa(ShareMore shareMore);
+
+ AjaxResult listByFidAid(ShareMore shareMore,Integer pageNo ,Integer pageSize);
+
+ AjaxResult deleteZa(ShareMore shareMore);
+
+ AjaxResult listByUserId();
+
+ AjaxResult listUserId(Integer pageNo ,Integer pageSize);
+
+ Long getShareId(ZfDownload zfDownload);
+}
diff --git a/zhang-content/src/main/java/com/ruoyi/service/ZPropertyDownloadService.java b/zhang-content/src/main/java/com/ruoyi/service/ZPropertyDownloadService.java
new file mode 100644
index 0000000..1746db7
--- /dev/null
+++ b/zhang-content/src/main/java/com/ruoyi/service/ZPropertyDownloadService.java
@@ -0,0 +1,13 @@
+package com.ruoyi.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.domain.ZfDownload;
+
+public interface ZPropertyDownloadService extends IService<ZfDownload> {
+ AjaxResult addData(ZfDownload zfDownload);
+
+ AjaxResult deleteData(Long[] ids);
+
+ AjaxResult selectDoctorList(ZfDownload zfDownload, Integer pageNo , Integer pageSize);
+}
diff --git a/zhang-content/src/main/java/com/ruoyi/service/ZPropertyShareService.java b/zhang-content/src/main/java/com/ruoyi/service/ZPropertyShareService.java
new file mode 100644
index 0000000..56047a8
--- /dev/null
+++ b/zhang-content/src/main/java/com/ruoyi/service/ZPropertyShareService.java
@@ -0,0 +1,25 @@
+package com.ruoyi.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.domain.ShareMore;
+import com.ruoyi.domain.ZfDownload;
+import com.ruoyi.domain.ZfShare;
+
+import java.util.List;
+
+public interface ZPropertyShareService extends IService<ZfShare> {
+ List<ZfShare> getAuthority();
+
+ AjaxResult saveZa(ShareMore shareMore);
+
+ AjaxResult listByFidAid(ShareMore shareMore,Integer pageNo ,Integer pageSize);
+
+ AjaxResult deleteZa(ShareMore shareMore);
+
+ AjaxResult listByUserId();
+
+ AjaxResult listUserId(Integer pageNo ,Integer pageSize);
+
+ Long getShareId(ZfDownload zfDownload);
+}
diff --git a/zhang-content/src/main/java/com/ruoyi/service/ZSecretDownloadService.java b/zhang-content/src/main/java/com/ruoyi/service/ZSecretDownloadService.java
new file mode 100644
index 0000000..d92081a
--- /dev/null
+++ b/zhang-content/src/main/java/com/ruoyi/service/ZSecretDownloadService.java
@@ -0,0 +1,13 @@
+package com.ruoyi.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.domain.ZfDownload;
+
+public interface ZSecretDownloadService extends IService<ZfDownload> {
+ AjaxResult addData(ZfDownload zfDownload);
+
+ AjaxResult deleteData(Long[] ids);
+
+ AjaxResult selectDoctorList(ZfDownload zfDownload, Integer pageNo , Integer pageSize);
+}
diff --git a/zhang-content/src/main/java/com/ruoyi/service/ZSecretShareService.java b/zhang-content/src/main/java/com/ruoyi/service/ZSecretShareService.java
new file mode 100644
index 0000000..3f12848
--- /dev/null
+++ b/zhang-content/src/main/java/com/ruoyi/service/ZSecretShareService.java
@@ -0,0 +1,25 @@
+package com.ruoyi.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.domain.ShareMore;
+import com.ruoyi.domain.ZfDownload;
+import com.ruoyi.domain.ZfShare;
+
+import java.util.List;
+
+public interface ZSecretShareService extends IService<ZfShare> {
+ List<ZfShare> getAuthority();
+
+ AjaxResult saveZa(ShareMore shareMore);
+
+ AjaxResult listByFidAid(ShareMore shareMore,Integer pageNo ,Integer pageSize);
+
+ AjaxResult deleteZa(ShareMore shareMore);
+
+ AjaxResult listByUserId();
+
+ AjaxResult listUserId(Integer pageNo ,Integer pageSize);
+
+ Long getShareId(ZfDownload zfDownload);
+}
diff --git a/zhang-content/src/main/java/com/ruoyi/service/ZSelfNoteDownloadService.java b/zhang-content/src/main/java/com/ruoyi/service/ZSelfNoteDownloadService.java
new file mode 100644
index 0000000..5997917
--- /dev/null
+++ b/zhang-content/src/main/java/com/ruoyi/service/ZSelfNoteDownloadService.java
@@ -0,0 +1,13 @@
+package com.ruoyi.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.domain.ZfDownload;
+
+public interface ZSelfNoteDownloadService extends IService<ZfDownload> {
+ AjaxResult addData(ZfDownload zfDownload);
+
+ AjaxResult deleteData(Long[] ids);
+
+ AjaxResult selectDoctorList(ZfDownload zfDownload, Integer pageNo , Integer pageSize);
+}
diff --git a/zhang-content/src/main/java/com/ruoyi/service/ZSelfNoteShareService.java b/zhang-content/src/main/java/com/ruoyi/service/ZSelfNoteShareService.java
new file mode 100644
index 0000000..b37f470
--- /dev/null
+++ b/zhang-content/src/main/java/com/ruoyi/service/ZSelfNoteShareService.java
@@ -0,0 +1,25 @@
+package com.ruoyi.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.domain.ShareMore;
+import com.ruoyi.domain.ZfDownload;
+import com.ruoyi.domain.ZfShare;
+
+import java.util.List;
+
+public interface ZSelfNoteShareService extends IService<ZfShare> {
+ List<ZfShare> getAuthority();
+
+ AjaxResult saveZa(ShareMore shareMore);
+
+ AjaxResult listByFidAid(ShareMore shareMore,Integer pageNo ,Integer pageSize);
+
+ AjaxResult deleteZa(ShareMore shareMore);
+
+ AjaxResult listByUserId();
+
+ AjaxResult listUserId(Integer pageNo ,Integer pageSize);
+
+ Long getShareId(ZfDownload zfDownload);
+}
diff --git a/zhang-content/src/main/java/com/ruoyi/service/ZfRelationDownloadService.java b/zhang-content/src/main/java/com/ruoyi/service/ZfRelationDownloadService.java
new file mode 100644
index 0000000..f8cf2e0
--- /dev/null
+++ b/zhang-content/src/main/java/com/ruoyi/service/ZfRelationDownloadService.java
@@ -0,0 +1,13 @@
+package com.ruoyi.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.domain.ZfDownload;
+
+public interface ZfRelationDownloadService extends IService<ZfDownload> {
+ AjaxResult addData(ZfDownload zfDownload);
+
+ AjaxResult deleteData(Long[] ids);
+
+ AjaxResult selectDoctorList(ZfDownload zfDownload, Integer pageNo , Integer pageSize);
+}
diff --git a/zhang-content/src/main/java/com/ruoyi/service/ZfRelationShareService.java b/zhang-content/src/main/java/com/ruoyi/service/ZfRelationShareService.java
new file mode 100644
index 0000000..bee3353
--- /dev/null
+++ b/zhang-content/src/main/java/com/ruoyi/service/ZfRelationShareService.java
@@ -0,0 +1,25 @@
+package com.ruoyi.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.domain.ShareMore;
+import com.ruoyi.domain.ZfDownload;
+import com.ruoyi.domain.ZfShare;
+
+import java.util.List;
+
+public interface ZfRelationShareService extends IService<ZfShare> {
+ List<ZfShare> getAuthority();
+
+ AjaxResult saveZa(ShareMore shareMore);
+
+ AjaxResult listByFidAid(ShareMore shareMore,Integer pageNo ,Integer pageSize);
+
+ AjaxResult deleteZa(ShareMore shareMore);
+
+ AjaxResult listByUserId();
+
+ AjaxResult listUserId(Integer pageNo ,Integer pageSize);
+
+ Long getShareId(ZfDownload zfDownload);
+}
diff --git a/zhang-content/src/main/java/com/ruoyi/service/impl/ZAbroadDownloadServiceImpl.java b/zhang-content/src/main/java/com/ruoyi/service/impl/ZAbroadDownloadServiceImpl.java
new file mode 100644
index 0000000..904d4c6
--- /dev/null
+++ b/zhang-content/src/main/java/com/ruoyi/service/impl/ZAbroadDownloadServiceImpl.java
@@ -0,0 +1,144 @@
+
+package com.ruoyi.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.EsModel;
+import com.ruoyi.common.utils.MapUtils;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.domain.ZAbroad;
+import com.ruoyi.domain.ZInfoUser;
+import com.ruoyi.domain.ZfDownload;
+import com.ruoyi.mapper.ZfDownloadMapper;
+import com.ruoyi.service.*;
+import lombok.extern.slf4j.Slf4j;
+import org.elasticsearch.action.delete.DeleteRequest;
+import org.elasticsearch.client.RequestOptions;
+import org.elasticsearch.client.RestHighLevelClient;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.io.IOException;
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Slf4j
+@Service
+public class ZAbroadDownloadServiceImpl extends ServiceImpl<ZfDownloadMapper,ZfDownload> implements ZAbroadDownloadService {
+ @Resource
+ EsService esService;
+
+ @Resource
+ ZAbroadShareService zAbroadShareService;
+
+ @Resource
+ ZAbroadService zAbroadService;
+
+
+ @Resource
+ ZInfoUserService zInfoUserService;
+
+ @Resource
+ private RestHighLevelClient restHighLevelClient;
+
+ private LambdaQueryWrapper<ZfDownload> buildCondition(ZfDownload zfDownload, Long userId) {
+ LambdaQueryWrapper<ZfDownload> lqw = new LambdaQueryWrapper<>();
+ lqw.in(ZfDownload::getDownloadId,userId);
+ lqw.orderByDesc(ZfDownload::getDownloadId);
+ lqw.like(zfDownload.getDownloadId() != null, ZfDownload::getDownloadId, zfDownload.getDownloadId())
+ .like(zfDownload.getDownloadContent() != null, ZfDownload::getDownloadContent, zfDownload.getDownloadContent())
+ .eq( ZfDownload::getSysMenuId, zfDownload.getSysMenuId());
+ return lqw;
+ }
+ private LambdaQueryWrapper<ZfDownload> uniqueCondition(ZfDownload zfDownload) {
+ LambdaQueryWrapper<ZfDownload> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(StringUtils.isNotEmpty(String.valueOf(zfDownload.getDownloadId())), ZfDownload::getDownloadId, zfDownload.getDownloadId())
+ .eq(StringUtils.isNotEmpty(String.valueOf(zfDownload.getDownloadContent())), ZfDownload::getDownloadContent, zfDownload.getDownloadContent())
+ .eq(ZfDownload::getSysMenuId, zfDownload.getSysMenuId());
+ return lqw;
+ }
+
+ public Long getUserId() {
+ ZInfoUser myself = zInfoUserService.getMyself();
+ return myself.getUserId();
+ }
+ @Override
+ public AjaxResult addData(ZfDownload zfDownload) {
+ zfDownload.setDownloadId(getUserId());
+ LambdaQueryWrapper<ZfDownload> lqw = uniqueCondition(zfDownload);
+ List<ZfDownload> list = list(lqw);
+ if (list.size() > 0) {
+ throw new RuntimeException("璇峰嬁閲嶅涓嬭浇鏁版嵁");
+ }
+
+ zfDownload.setDownloadId(getUserId());
+ zfDownload.setShareId(zAbroadShareService.getShareId(zfDownload));
+ if (save(zfDownload)) {
+ EsModel esModel = new EsModel();
+ Integer inte = zfDownload.getId().intValue();
+ String uuid = UUID.randomUUID().toString().replace("-", "");
+ esModel.setId(uuid);
+ esModel.setCtId(Long.valueOf(inte));
+ esModel.setCtTableName("鍑哄浗鍑哄鎯呭喌");
+
+ esModel.setBy1(String.valueOf(zfDownload.getDownloadId()));
+ esModel.setBy2(String.valueOf(zfDownload.getDownloadContent()));
+ esModel.setBy3(String.valueOf(zfDownload.getShareId()));
+ //杩欓噷瀛樺偍鏌ヨ璇︽儏鐨勮矾寰�
+ esService.insertTable(esModel);
+ return AjaxResult.success();
+ } else {
+ return AjaxResult.error();
+ }
+ }
+
+ @Override
+ public AjaxResult deleteData(Long[] ids) {
+ List<ZfDownload> zfDownloads = listByIds(Arrays.asList(ids));
+
+ if (zAbroadShareService.removeByIds(Arrays.asList(ids))) {
+
+ //鍒犻櫎es涓殑鏁版嵁
+ zfDownloads.stream().forEach(zfDoctorDownload -> {
+ EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "鍑哄浗鍑哄鎯呭喌涓嬭浇");
+
+ if (esModel != null) {
+ DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId());
+ try {
+ restHighLevelClient.delete(deleteRequest, RequestOptions.DEFAULT);
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ });
+ return AjaxResult.success();
+ } else {
+ return AjaxResult.error();
+ }
+ }
+
+ @Override
+ public AjaxResult selectDoctorList(ZfDownload zfDownload, Integer pageNo, Integer pageSize) {
+ ZInfoUser myself = zInfoUserService.getMyself();
+ LambdaQueryWrapper<ZfDownload> lqw = buildCondition(zfDownload,myself.getUserId());
+ List<ZfDownload> beanRecords = list(lqw);
+ List<ZAbroad> bs = new ArrayList<>();
+ for (ZfDownload a: beanRecords) {
+ if (zAbroadService.getById(a.getDownloadContent()) != null) {
+ ZAbroad ds = zAbroadService.getById(a.getDownloadContent());
+ ds.setShareId(a.getShareId().intValue());
+ bs.add(ds);
+ }
+ }
+ List<ZAbroad> record = bs.stream().skip((pageNo-1)*pageSize).limit(pageSize).collect(Collectors.toList());
+
+ int totalPage = (bs.size() -1) / pageSize +1;
+
+ Page<ZAbroad> zAbroadPage = new Page<>(pageNo, pageSize,totalPage);
+ HashMap<String, Object> data = MapUtils.getShareResult(zAbroadPage, record,bs.size());
+ return AjaxResult.success(data);
+ }
+
+}
diff --git a/zhang-content/src/main/java/com/ruoyi/service/impl/ZAbroadShareServiceImpl.java b/zhang-content/src/main/java/com/ruoyi/service/impl/ZAbroadShareServiceImpl.java
new file mode 100644
index 0000000..2598d05
--- /dev/null
+++ b/zhang-content/src/main/java/com/ruoyi/service/impl/ZAbroadShareServiceImpl.java
@@ -0,0 +1,191 @@
+
+package com.ruoyi.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.SysUser;
+import com.ruoyi.common.utils.MapUtils;
+import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.domain.*;
+import com.ruoyi.mapper.ZfShareMapper;
+import com.ruoyi.service.*;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.stream.Collectors;
+
+@Service
+public class ZAbroadShareServiceImpl extends ServiceImpl<ZfShareMapper,ZfShare> implements ZAbroadShareService {
+
+
+ @Resource
+ ZAbroadService zAbroadService;
+
+ @Resource
+ private ZInfoUserService zInfoUserService;
+
+ private LambdaQueryWrapper<ZfShare> uniqueCondition(ZfShare zfShare) {
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(StringUtils.isNotEmpty(String.valueOf(zfShare.getShareId())), ZfShare::getShareId, zfShare.getShareId());
+ lqw.eq(StringUtils.isNotEmpty(String.valueOf(zfShare.getShareContent())), ZfShare::getShareContent, zfShare.getShareContent());
+ lqw.eq(StringUtils.isNotEmpty(String.valueOf(zfShare.getSysMenuId())), ZfShare::getSysMenuId, zfShare.getSysMenuId());
+ return lqw;
+ }
+
+ @Override
+ public List<ZfShare> getAuthority() {
+ SysUser user = SecurityUtils.getLoginUser().getUser();
+ Long userId = user.getUserId();
+
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId,userId);
+
+ return list(lqw);
+ }
+
+ public Long getUserId(){
+ ZInfoUser myself = zInfoUserService.getMyself();
+ return myself.getUserId();
+
+ }
+
+ public void addData(ZfShare za)
+ {
+ LambdaQueryWrapper<ZfShare> lqw = uniqueCondition(za);
+ List<ZfShare> list = list(lqw);
+
+ if(list.size()>0){
+ throw new RuntimeException("璇峰嬁鍒嗕韩閲嶅鏁版嵁");
+ }
+ else {
+ save(za);
+ }
+
+ }
+
+ @Override
+ public AjaxResult saveZa(ShareMore shareMore) {
+ Long [] shareIds = shareMore.getShareIds();
+ Long [] shareContents = shareMore.getShareContents();
+ for (Long shareId : shareIds) {
+ for (Long shareContent : shareContents) {
+ ZfShare za = new ZfShare();
+ za.setUserId(getUserId());
+ za.setShareContent(shareContent);
+ za.setShareId(shareId);
+ za.setSysMenuId(20105L);
+ addData(za);
+ }
+ }
+ // Long []
+ // if(bl)
+ return AjaxResult.success("鍒嗕韩鎴愬姛!");
+ }
+
+ @Override
+ public AjaxResult listByFidAid(ShareMore shareMore, Integer pageNo, Integer pageSize) {
+ Long [] shareIds = shareMore.getShareIds();
+ List<ZAbroad> beanRecord3 = new ArrayList<>();
+ for (Long shareId : shareIds) {
+ {
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId,shareId)
+ .eq(ZfShare::getSysMenuId,shareMore.getSysMenuId())
+ .eq(ZfShare::getUserId, getUserId());
+ List<ZfShare> beanRecords = list(lqw);
+ for (ZfShare beanRecord : beanRecords ) {
+ beanRecord3.add(zAbroadService.getById(beanRecord.getShareContent()));
+ }
+ }
+ }
+ List<ZAbroad> record = beanRecord3.stream().skip((pageNo-1)*pageSize).limit(pageSize).collect(Collectors.toList());
+
+ int totalPage = (beanRecord3.size() -1) / pageSize +1;
+
+ Page<ZAbroad> zAbroadPage = new Page<>(pageNo, pageSize,totalPage);
+ HashMap<String, Object> data = MapUtils.getShareResult(zAbroadPage, record,beanRecord3.size());
+
+ return AjaxResult.success(data);
+ }
+
+ @Override
+ public AjaxResult deleteZa(ShareMore shareMore) {
+ Long [] shareIds = shareMore.getShareIds();
+ Long [] shareContents = shareMore.getShareContents();
+ for(Long shareId : shareIds)
+ for(Long shareContent: shareContents)
+ {
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId,shareId)
+ .eq(ZfShare::getShareContent, shareContent)
+ .eq(ZfShare::getSysMenuId, shareMore.getSysMenuId())
+ .eq(ZfShare::getUserId, getUserId());
+
+ remove(lqw);
+ // addData(za);
+ }
+ return AjaxResult.success("鏁版嵁鏀跺洖鎴愬姛!");
+ }
+
+ @Override
+ public AjaxResult listByUserId() {
+ HashMap<Long,List<ZAbroad>> bs = new HashMap<>();
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId,getUserId());
+ lqw.eq(ZfShare::getSysMenuId,20105L);
+ List<ZfShare> beanRecords = list(lqw);
+ List<ZAbroad> b1 = new ArrayList<>();
+ for (ZfShare beanRecord : beanRecords ) {
+ b1.add(zAbroadService.getById(beanRecord.getShareContent()));
+ bs.put(beanRecord.getUserId(),b1);
+ }
+// log.info("浠庢暟鎹簱涓煡鍒扮殑涓�:{}", bs);
+ return AjaxResult.success(bs);
+ }
+
+ @Override
+ public AjaxResult listUserId(Integer pageNo, Integer pageSize) {
+ List<ZAbroad> bs = new ArrayList<>();
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId,getUserId());
+ lqw.eq(ZfShare::getSysMenuId,20105L);
+ List<ZfShare> beanRecords = list(lqw);
+ for (ZfShare beanRecord : beanRecords ) {
+ ZAbroad bs2 = zAbroadService.getById(beanRecord.getShareContent());
+ bs2.setShareId(beanRecord.getUserId().intValue());
+ bs.add(bs2);
+ }
+// log.info("浠庢暟鎹簱涓煡鍒扮殑涓�:{}", bs);
+ List<ZAbroad> record = bs.stream().skip((pageNo-1)*pageSize).limit(pageSize).collect(Collectors.toList());
+
+ int totalPage = (bs.size() -1) / pageSize +1;
+
+ Page<ZAbroad> zAbroadPage = new Page<>(pageNo, pageSize,totalPage);
+ HashMap<String, Object> data = MapUtils.getShareResult(zAbroadPage, record,bs.size());
+ return AjaxResult.success(data);
+ }
+
+ @Override
+ public Long getShareId(ZfDownload zfDownload) {
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId, zfDownload.getDownloadId())
+ .eq(ZfShare::getShareContent, zfDownload.getDownloadContent())
+ .eq(ZfShare::getSysMenuId, zfDownload.getSysMenuId());
+ List<ZfShare> beanRecords = list(lqw);
+ if (beanRecords.size() != 0){
+ return beanRecords.get(0).getUserId();
+ }
+ else {
+ return null;
+ }
+ }
+
+
+
+}
diff --git a/zhang-content/src/main/java/com/ruoyi/service/impl/ZAutobiographyDownloadServiceImpl.java b/zhang-content/src/main/java/com/ruoyi/service/impl/ZAutobiographyDownloadServiceImpl.java
new file mode 100644
index 0000000..381f1db
--- /dev/null
+++ b/zhang-content/src/main/java/com/ruoyi/service/impl/ZAutobiographyDownloadServiceImpl.java
@@ -0,0 +1,145 @@
+
+package com.ruoyi.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.EsModel;
+import com.ruoyi.common.utils.MapUtils;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.domain.ZAutobiography;
+
+import com.ruoyi.domain.ZInfoUser;
+import com.ruoyi.domain.ZfDownload;
+import com.ruoyi.mapper.ZfDownloadMapper;
+import com.ruoyi.service.*;
+import lombok.extern.slf4j.Slf4j;
+import org.elasticsearch.action.delete.DeleteRequest;
+import org.elasticsearch.client.RequestOptions;
+import org.elasticsearch.client.RestHighLevelClient;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.io.IOException;
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Slf4j
+@Service
+public class ZAutobiographyDownloadServiceImpl extends ServiceImpl<ZfDownloadMapper,ZfDownload> implements ZAutobiographyDownloadService {
+ @Resource
+ EsService esService;
+
+ @Resource
+ ZAutobiographyShareService zAutobiographyShareService;
+
+ @Resource
+ ZAutobiographyService zAutobiographyService;
+
+
+ @Resource
+ ZInfoUserService zInfoUserService;
+
+ @Resource
+ private RestHighLevelClient restHighLevelClient;
+
+ private LambdaQueryWrapper<ZfDownload> buildCondition(ZfDownload zfDownload, Long userId) {
+ LambdaQueryWrapper<ZfDownload> lqw = new LambdaQueryWrapper<>();
+ lqw.in(ZfDownload::getDownloadId,userId);
+ lqw.orderByDesc(ZfDownload::getDownloadId);
+ lqw.like(zfDownload.getDownloadId() != null, ZfDownload::getDownloadId, zfDownload.getDownloadId())
+ .like(zfDownload.getDownloadContent() != null, ZfDownload::getDownloadContent, zfDownload.getDownloadContent())
+ .eq( ZfDownload::getSysMenuId, zfDownload.getSysMenuId());
+ return lqw;
+ }
+ private LambdaQueryWrapper<ZfDownload> uniqueCondition(ZfDownload zfDownload) {
+ LambdaQueryWrapper<ZfDownload> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(StringUtils.isNotEmpty(String.valueOf(zfDownload.getDownloadId())), ZfDownload::getDownloadId, zfDownload.getDownloadId())
+ .eq(StringUtils.isNotEmpty(String.valueOf(zfDownload.getDownloadContent())), ZfDownload::getDownloadContent, zfDownload.getDownloadContent())
+ .eq(ZfDownload::getSysMenuId, zfDownload.getSysMenuId());
+ return lqw;
+ }
+
+ public Long getUserId() {
+ ZInfoUser myself = zInfoUserService.getMyself();
+ return myself.getUserId();
+ }
+ @Override
+ public AjaxResult addData(ZfDownload zfDownload) {
+ zfDownload.setDownloadId(getUserId());
+ LambdaQueryWrapper<ZfDownload> lqw = uniqueCondition(zfDownload);
+ List<ZfDownload> list = list(lqw);
+ if (list.size() > 0) {
+ throw new RuntimeException("璇峰嬁閲嶅涓嬭浇鏁版嵁");
+ }
+
+ zfDownload.setDownloadId(getUserId());
+ zfDownload.setShareId(zAutobiographyShareService.getShareId(zfDownload));
+ if (save(zfDownload)) {
+ EsModel esModel = new EsModel();
+ Integer inte = zfDownload.getId().intValue();
+ String uuid = UUID.randomUUID().toString().replace("-", "");
+ esModel.setId(uuid);
+ esModel.setCtId(Long.valueOf(inte));
+ esModel.setCtTableName("鑷紶");
+
+ esModel.setBy1(String.valueOf(zfDownload.getDownloadId()));
+ esModel.setBy2(String.valueOf(zfDownload.getDownloadContent()));
+ esModel.setBy3(String.valueOf(zfDownload.getShareId()));
+ //杩欓噷瀛樺偍鏌ヨ璇︽儏鐨勮矾寰�
+ esService.insertTable(esModel);
+ return AjaxResult.success();
+ } else {
+ return AjaxResult.error();
+ }
+ }
+
+ @Override
+ public AjaxResult deleteData(Long[] ids) {
+ List<ZfDownload> zfDownloads = listByIds(Arrays.asList(ids));
+
+ if (zAutobiographyShareService.removeByIds(Arrays.asList(ids))) {
+
+ //鍒犻櫎es涓殑鏁版嵁
+ zfDownloads.stream().forEach(zfDoctorDownload -> {
+ EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "鑷紶涓嬭浇");
+
+ if (esModel != null) {
+ DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId());
+ try {
+ restHighLevelClient.delete(deleteRequest, RequestOptions.DEFAULT);
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ });
+ return AjaxResult.success();
+ } else {
+ return AjaxResult.error();
+ }
+ }
+
+ @Override
+ public AjaxResult selectDoctorList(ZfDownload zfDownload, Integer pageNo, Integer pageSize) {
+ ZInfoUser myself = zInfoUserService.getMyself();
+ LambdaQueryWrapper<ZfDownload> lqw = buildCondition(zfDownload,myself.getUserId());
+ List<ZfDownload> beanRecords = list(lqw);
+ List<ZAutobiography> bs = new ArrayList<>();
+ for (ZfDownload a: beanRecords) {
+ if (zAutobiographyService.getById(a.getDownloadContent()) != null) {
+ ZAutobiography ds = zAutobiographyService.getById(a.getDownloadContent());
+ ds.setShareId(a.getShareId().intValue());
+ bs.add(ds);
+ }
+ }
+ List<ZAutobiography> record = bs.stream().skip((pageNo-1)*pageSize).limit(pageSize).collect(Collectors.toList());
+
+ int totalPage = (bs.size() -1) / pageSize +1;
+
+ Page<ZAutobiography> zAutobiographyPage = new Page<>(pageNo, pageSize,totalPage);
+ HashMap<String, Object> data = MapUtils.getShareResult(zAutobiographyPage, record,bs.size());
+ return AjaxResult.success(data);
+ }
+
+}
diff --git a/zhang-content/src/main/java/com/ruoyi/service/impl/ZAutobiographyShareServiceImpl.java b/zhang-content/src/main/java/com/ruoyi/service/impl/ZAutobiographyShareServiceImpl.java
new file mode 100644
index 0000000..eee11a1
--- /dev/null
+++ b/zhang-content/src/main/java/com/ruoyi/service/impl/ZAutobiographyShareServiceImpl.java
@@ -0,0 +1,194 @@
+
+package com.ruoyi.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.SysUser;
+import com.ruoyi.common.utils.MapUtils;
+import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.domain.*;
+import com.ruoyi.mapper.ZfShareMapper;
+import com.ruoyi.service.ZAutobiographyShareService;
+import com.ruoyi.service.ZAutobiographyService;
+import com.ruoyi.service.ZAutobiographyShareService;
+import com.ruoyi.service.ZInfoUserService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.stream.Collectors;
+
+@Service
+public class ZAutobiographyShareServiceImpl extends ServiceImpl<ZfShareMapper,ZfShare> implements ZAutobiographyShareService {
+
+
+ @Resource
+ ZAutobiographyService zAutobiographyService;
+
+ @Resource
+ private ZInfoUserService zInfoUserService;
+
+ private LambdaQueryWrapper<ZfShare> uniqueCondition(ZfShare zfShare) {
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(StringUtils.isNotEmpty(String.valueOf(zfShare.getShareId())), ZfShare::getShareId, zfShare.getShareId());
+ lqw.eq(StringUtils.isNotEmpty(String.valueOf(zfShare.getShareContent())), ZfShare::getShareContent, zfShare.getShareContent());
+ lqw.eq(StringUtils.isNotEmpty(String.valueOf(zfShare.getSysMenuId())), ZfShare::getSysMenuId, zfShare.getSysMenuId());
+ return lqw;
+ }
+
+ @Override
+ public List<ZfShare> getAuthority() {
+ SysUser user = SecurityUtils.getLoginUser().getUser();
+ Long userId = user.getUserId();
+
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId,userId);
+
+ return list(lqw);
+ }
+
+ public Long getUserId(){
+ ZInfoUser myself = zInfoUserService.getMyself();
+ return myself.getUserId();
+
+ }
+
+ public void addData(ZfShare za)
+ {
+ LambdaQueryWrapper<ZfShare> lqw = uniqueCondition(za);
+ List<ZfShare> list = list(lqw);
+
+ if(list.size()>0){
+ throw new RuntimeException("璇峰嬁鍒嗕韩閲嶅鏁版嵁");
+ }
+ else {
+ save(za);
+ }
+
+ }
+
+ @Override
+ public AjaxResult saveZa(ShareMore shareMore) {
+ Long [] shareIds = shareMore.getShareIds();
+ Long [] shareContents = shareMore.getShareContents();
+ for (Long shareId : shareIds) {
+ for (Long shareContent : shareContents) {
+ ZfShare za = new ZfShare();
+ za.setUserId(getUserId());
+ za.setShareContent(shareContent);
+ za.setShareId(shareId);
+ za.setSysMenuId(20106L);
+ addData(za);
+ }
+ }
+ // Long []
+ // if(bl)
+ return AjaxResult.success("鍒嗕韩鎴愬姛!");
+ }
+
+ @Override
+ public AjaxResult listByFidAid(ShareMore shareMore, Integer pageNo, Integer pageSize) {
+ Long [] shareIds = shareMore.getShareIds();
+ List<ZAutobiography> beanRecord3 = new ArrayList<>();
+ for (Long shareId : shareIds) {
+ {
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId,shareId)
+ .eq(ZfShare::getSysMenuId,shareMore.getSysMenuId())
+ .eq(ZfShare::getUserId, getUserId());
+ List<ZfShare> beanRecords = list(lqw);
+ for (ZfShare beanRecord : beanRecords ) {
+ beanRecord3.add(zAutobiographyService.getById(beanRecord.getShareContent()));
+ }
+ }
+ }
+ List<ZAutobiography> record = beanRecord3.stream().skip((pageNo-1)*pageSize).limit(pageSize).collect(Collectors.toList());
+
+ int totalPage = (beanRecord3.size() -1) / pageSize +1;
+
+ Page<ZAutobiography> zAutobiographyPage = new Page<>(pageNo, pageSize,totalPage);
+ HashMap<String, Object> data = MapUtils.getShareResult(zAutobiographyPage, record,beanRecord3.size());
+
+ return AjaxResult.success(data);
+ }
+
+ @Override
+ public AjaxResult deleteZa(ShareMore shareMore) {
+ Long [] shareIds = shareMore.getShareIds();
+ Long [] shareContents = shareMore.getShareContents();
+ for(Long shareId : shareIds)
+ for(Long shareContent: shareContents)
+ {
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId,shareId)
+ .eq(ZfShare::getShareContent, shareContent)
+ .eq(ZfShare::getSysMenuId, shareMore.getSysMenuId())
+ .eq(ZfShare::getUserId, getUserId());
+
+ remove(lqw);
+ // addData(za);
+ }
+ return AjaxResult.success("鏁版嵁鏀跺洖鎴愬姛!");
+ }
+
+ @Override
+ public AjaxResult listByUserId() {
+ HashMap<Long,List<ZAutobiography>> bs = new HashMap<>();
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId,getUserId());
+ lqw.eq(ZfShare::getSysMenuId,20106L);
+ List<ZfShare> beanRecords = list(lqw);
+ List<ZAutobiography> b1 = new ArrayList<>();
+ for (ZfShare beanRecord : beanRecords ) {
+ b1.add(zAutobiographyService.getById(beanRecord.getShareContent()));
+ bs.put(beanRecord.getUserId(),b1);
+ }
+// log.info("浠庢暟鎹簱涓煡鍒扮殑涓�:{}", bs);
+ return AjaxResult.success(bs);
+ }
+
+ @Override
+ public AjaxResult listUserId(Integer pageNo, Integer pageSize) {
+ List<ZAutobiography> bs = new ArrayList<>();
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId,getUserId());
+ lqw.eq(ZfShare::getSysMenuId,20106L);
+ List<ZfShare> beanRecords = list(lqw);
+ for (ZfShare beanRecord : beanRecords ) {
+ ZAutobiography bs2 = zAutobiographyService.getById(beanRecord.getShareContent());
+ bs2.setShareId(beanRecord.getUserId().intValue());
+ bs.add(bs2);
+ }
+// log.info("浠庢暟鎹簱涓煡鍒扮殑涓�:{}", bs);
+ List<ZAutobiography> record = bs.stream().skip((pageNo-1)*pageSize).limit(pageSize).collect(Collectors.toList());
+
+ int totalPage = (bs.size() -1) / pageSize +1;
+
+ Page<ZAutobiography> zAutobiographyPage = new Page<>(pageNo, pageSize,totalPage);
+ HashMap<String, Object> data = MapUtils.getShareResult(zAutobiographyPage, record,bs.size());
+ return AjaxResult.success(data);
+ }
+
+ @Override
+ public Long getShareId(ZfDownload zfDownload) {
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId, zfDownload.getDownloadId())
+ .eq(ZfShare::getShareContent, zfDownload.getDownloadContent())
+ .eq(ZfShare::getSysMenuId, zfDownload.getSysMenuId());
+ List<ZfShare> beanRecords = list(lqw);
+ if (beanRecords.size() != 0){
+ return beanRecords.get(0).getUserId();
+ }
+ else {
+ return null;
+ }
+ }
+
+
+
+}
diff --git a/zhang-content/src/main/java/com/ruoyi/service/impl/ZCertificateDownloadServiceImpl.java b/zhang-content/src/main/java/com/ruoyi/service/impl/ZCertificateDownloadServiceImpl.java
new file mode 100644
index 0000000..da10f00
--- /dev/null
+++ b/zhang-content/src/main/java/com/ruoyi/service/impl/ZCertificateDownloadServiceImpl.java
@@ -0,0 +1,144 @@
+
+package com.ruoyi.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.EsModel;
+import com.ruoyi.common.utils.MapUtils;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.domain.ZCertificate;
+import com.ruoyi.domain.ZInfoUser;
+import com.ruoyi.domain.ZfDownload;
+import com.ruoyi.mapper.ZfDownloadMapper;
+import com.ruoyi.service.*;
+import lombok.extern.slf4j.Slf4j;
+import org.elasticsearch.action.delete.DeleteRequest;
+import org.elasticsearch.client.RequestOptions;
+import org.elasticsearch.client.RestHighLevelClient;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.io.IOException;
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Slf4j
+@Service
+public class ZCertificateDownloadServiceImpl extends ServiceImpl<ZfDownloadMapper,ZfDownload> implements ZCertificateDownloadService {
+ @Resource
+ EsService esService;
+
+ @Resource
+ ZCertificateShareService zCertificateShareService;
+
+ @Resource
+ ZCertificateService zCertificateService;
+
+
+ @Resource
+ ZInfoUserService zInfoUserService;
+
+ @Resource
+ private RestHighLevelClient restHighLevelClient;
+
+ private LambdaQueryWrapper<ZfDownload> buildCondition(ZfDownload zfDownload, Long userId) {
+ LambdaQueryWrapper<ZfDownload> lqw = new LambdaQueryWrapper<>();
+ lqw.in(ZfDownload::getDownloadId,userId);
+ lqw.orderByDesc(ZfDownload::getDownloadId);
+ lqw.like(zfDownload.getDownloadId() != null, ZfDownload::getDownloadId, zfDownload.getDownloadId())
+ .like(zfDownload.getDownloadContent() != null, ZfDownload::getDownloadContent, zfDownload.getDownloadContent())
+ .eq( ZfDownload::getSysMenuId, zfDownload.getSysMenuId());
+ return lqw;
+ }
+ private LambdaQueryWrapper<ZfDownload> uniqueCondition(ZfDownload zfDownload) {
+ LambdaQueryWrapper<ZfDownload> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(StringUtils.isNotEmpty(String.valueOf(zfDownload.getDownloadId())), ZfDownload::getDownloadId, zfDownload.getDownloadId())
+ .eq(StringUtils.isNotEmpty(String.valueOf(zfDownload.getDownloadContent())), ZfDownload::getDownloadContent, zfDownload.getDownloadContent())
+ .eq(ZfDownload::getSysMenuId, zfDownload.getSysMenuId());
+ return lqw;
+ }
+
+ public Long getUserId() {
+ ZInfoUser myself = zInfoUserService.getMyself();
+ return myself.getUserId();
+ }
+ @Override
+ public AjaxResult addData(ZfDownload zfDownload) {
+ zfDownload.setDownloadId(getUserId());
+ LambdaQueryWrapper<ZfDownload> lqw = uniqueCondition(zfDownload);
+ List<ZfDownload> list = list(lqw);
+ if (list.size() > 0) {
+ throw new RuntimeException("璇峰嬁閲嶅涓嬭浇鏁版嵁");
+ }
+
+ zfDownload.setDownloadId(getUserId());
+ zfDownload.setShareId(zCertificateShareService.getShareId(zfDownload));
+ if (save(zfDownload)) {
+ EsModel esModel = new EsModel();
+ Integer inte = zfDownload.getId().intValue();
+ String uuid = UUID.randomUUID().toString().replace("-", "");
+ esModel.setId(uuid);
+ esModel.setCtId(Long.valueOf(inte));
+ esModel.setCtTableName("鎸佹湁璇佷欢鎯呭喌");
+
+ esModel.setBy1(String.valueOf(zfDownload.getDownloadId()));
+ esModel.setBy2(String.valueOf(zfDownload.getDownloadContent()));
+ esModel.setBy3(String.valueOf(zfDownload.getShareId()));
+ //杩欓噷瀛樺偍鏌ヨ璇︽儏鐨勮矾寰�
+ esService.insertTable(esModel);
+ return AjaxResult.success();
+ } else {
+ return AjaxResult.error();
+ }
+ }
+
+ @Override
+ public AjaxResult deleteData(Long[] ids) {
+ List<ZfDownload> zfDownloads = listByIds(Arrays.asList(ids));
+
+ if (zCertificateShareService.removeByIds(Arrays.asList(ids))) {
+
+ //鍒犻櫎es涓殑鏁版嵁
+ zfDownloads.stream().forEach(zfDoctorDownload -> {
+ EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "鎸佹湁璇佷欢鎯呭喌涓嬭浇");
+
+ if (esModel != null) {
+ DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId());
+ try {
+ restHighLevelClient.delete(deleteRequest, RequestOptions.DEFAULT);
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ });
+ return AjaxResult.success();
+ } else {
+ return AjaxResult.error();
+ }
+ }
+
+ @Override
+ public AjaxResult selectDoctorList(ZfDownload zfDownload, Integer pageNo, Integer pageSize) {
+ ZInfoUser myself = zInfoUserService.getMyself();
+ LambdaQueryWrapper<ZfDownload> lqw = buildCondition(zfDownload,myself.getUserId());
+ List<ZfDownload> beanRecords = list(lqw);
+ List<ZCertificate> bs = new ArrayList<>();
+ for (ZfDownload a: beanRecords) {
+ if (zCertificateService.getById(a.getDownloadContent()) != null) {
+ ZCertificate ds = zCertificateService.getById(a.getDownloadContent());
+ ds.setShareId(a.getShareId().intValue());
+ bs.add(ds);
+ }
+ }
+ List<ZCertificate> record = bs.stream().skip((pageNo-1)*pageSize).limit(pageSize).collect(Collectors.toList());
+
+ int totalPage = (bs.size() -1) / pageSize +1;
+
+ Page<ZCertificate> zCertificatePage = new Page<>(pageNo, pageSize,totalPage);
+ HashMap<String, Object> data = MapUtils.getShareResult(zCertificatePage, record,bs.size());
+ return AjaxResult.success(data);
+ }
+
+}
diff --git a/zhang-content/src/main/java/com/ruoyi/service/impl/ZCertificateShareServiceImpl.java b/zhang-content/src/main/java/com/ruoyi/service/impl/ZCertificateShareServiceImpl.java
new file mode 100644
index 0000000..37c678d
--- /dev/null
+++ b/zhang-content/src/main/java/com/ruoyi/service/impl/ZCertificateShareServiceImpl.java
@@ -0,0 +1,194 @@
+
+package com.ruoyi.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.SysUser;
+import com.ruoyi.common.utils.MapUtils;
+import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.domain.*;
+import com.ruoyi.mapper.ZfShareMapper;
+import com.ruoyi.service.ZCertificateShareService;
+import com.ruoyi.service.ZCertificateService;
+import com.ruoyi.service.ZCertificateShareService;
+import com.ruoyi.service.ZInfoUserService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.stream.Collectors;
+
+@Service
+public class ZCertificateShareServiceImpl extends ServiceImpl<ZfShareMapper,ZfShare> implements ZCertificateShareService {
+
+
+ @Resource
+ ZCertificateService zCertificateService;
+
+ @Resource
+ private ZInfoUserService zInfoUserService;
+
+ private LambdaQueryWrapper<ZfShare> uniqueCondition(ZfShare zfShare) {
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(StringUtils.isNotEmpty(String.valueOf(zfShare.getShareId())), ZfShare::getShareId, zfShare.getShareId());
+ lqw.eq(StringUtils.isNotEmpty(String.valueOf(zfShare.getShareContent())), ZfShare::getShareContent, zfShare.getShareContent());
+ lqw.eq(StringUtils.isNotEmpty(String.valueOf(zfShare.getSysMenuId())), ZfShare::getSysMenuId, zfShare.getSysMenuId());
+ return lqw;
+ }
+
+ @Override
+ public List<ZfShare> getAuthority() {
+ SysUser user = SecurityUtils.getLoginUser().getUser();
+ Long userId = user.getUserId();
+
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId,userId);
+
+ return list(lqw);
+ }
+
+ public Long getUserId(){
+ ZInfoUser myself = zInfoUserService.getMyself();
+ return myself.getUserId();
+
+ }
+
+ public void addData(ZfShare za)
+ {
+ LambdaQueryWrapper<ZfShare> lqw = uniqueCondition(za);
+ List<ZfShare> list = list(lqw);
+
+ if(list.size()>0){
+ throw new RuntimeException("璇峰嬁鍒嗕韩閲嶅鏁版嵁");
+ }
+ else {
+ save(za);
+ }
+
+ }
+
+ @Override
+ public AjaxResult saveZa(ShareMore shareMore) {
+ Long [] shareIds = shareMore.getShareIds();
+ Long [] shareContents = shareMore.getShareContents();
+ for (Long shareId : shareIds) {
+ for (Long shareContent : shareContents) {
+ ZfShare za = new ZfShare();
+ za.setUserId(getUserId());
+ za.setShareContent(shareContent);
+ za.setShareId(shareId);
+ za.setSysMenuId(20104L);
+ addData(za);
+ }
+ }
+ // Long []
+ // if(bl)
+ return AjaxResult.success("鍒嗕韩鎴愬姛!");
+ }
+
+ @Override
+ public AjaxResult listByFidAid(ShareMore shareMore, Integer pageNo, Integer pageSize) {
+ Long [] shareIds = shareMore.getShareIds();
+ List<ZCertificate> beanRecord3 = new ArrayList<>();
+ for (Long shareId : shareIds) {
+ {
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId,shareId)
+ .eq(ZfShare::getSysMenuId,shareMore.getSysMenuId())
+ .eq(ZfShare::getUserId, getUserId());
+ List<ZfShare> beanRecords = list(lqw);
+ for (ZfShare beanRecord : beanRecords ) {
+ beanRecord3.add(zCertificateService.getById(beanRecord.getShareContent()));
+ }
+ }
+ }
+ List<ZCertificate> record = beanRecord3.stream().skip((pageNo-1)*pageSize).limit(pageSize).collect(Collectors.toList());
+
+ int totalPage = (beanRecord3.size() -1) / pageSize +1;
+
+ Page<ZCertificate> zCertificatePage = new Page<>(pageNo, pageSize,totalPage);
+ HashMap<String, Object> data = MapUtils.getShareResult(zCertificatePage, record,beanRecord3.size());
+
+ return AjaxResult.success(data);
+ }
+
+ @Override
+ public AjaxResult deleteZa(ShareMore shareMore) {
+ Long [] shareIds = shareMore.getShareIds();
+ Long [] shareContents = shareMore.getShareContents();
+ for(Long shareId : shareIds)
+ for(Long shareContent: shareContents)
+ {
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId,shareId)
+ .eq(ZfShare::getShareContent, shareContent)
+ .eq(ZfShare::getSysMenuId, shareMore.getSysMenuId())
+ .eq(ZfShare::getUserId, getUserId());
+
+ remove(lqw);
+ // addData(za);
+ }
+ return AjaxResult.success("鏁版嵁鏀跺洖鎴愬姛!");
+ }
+
+ @Override
+ public AjaxResult listByUserId() {
+ HashMap<Long,List<ZCertificate>> bs = new HashMap<>();
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId,getUserId());
+ lqw.eq(ZfShare::getSysMenuId,20104L);
+ List<ZfShare> beanRecords = list(lqw);
+ List<ZCertificate> b1 = new ArrayList<>();
+ for (ZfShare beanRecord : beanRecords ) {
+ b1.add(zCertificateService.getById(beanRecord.getShareContent()));
+ bs.put(beanRecord.getUserId(),b1);
+ }
+// log.info("浠庢暟鎹簱涓煡鍒扮殑涓�:{}", bs);
+ return AjaxResult.success(bs);
+ }
+
+ @Override
+ public AjaxResult listUserId(Integer pageNo, Integer pageSize) {
+ List<ZCertificate> bs = new ArrayList<>();
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId,getUserId());
+ lqw.eq(ZfShare::getSysMenuId,20104L);
+ List<ZfShare> beanRecords = list(lqw);
+ for (ZfShare beanRecord : beanRecords ) {
+ ZCertificate bs2 = zCertificateService.getById(beanRecord.getShareContent());
+ bs2.setShareId(beanRecord.getUserId().intValue());
+ bs.add(bs2);
+ }
+// log.info("浠庢暟鎹簱涓煡鍒扮殑涓�:{}", bs);
+ List<ZCertificate> record = bs.stream().skip((pageNo-1)*pageSize).limit(pageSize).collect(Collectors.toList());
+
+ int totalPage = (bs.size() -1) / pageSize +1;
+
+ Page<ZCertificate> zCertificatePage = new Page<>(pageNo, pageSize,totalPage);
+ HashMap<String, Object> data = MapUtils.getShareResult(zCertificatePage, record,bs.size());
+ return AjaxResult.success(data);
+ }
+
+ @Override
+ public Long getShareId(ZfDownload zfDownload) {
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId, zfDownload.getDownloadId())
+ .eq(ZfShare::getShareContent, zfDownload.getDownloadContent())
+ .eq(ZfShare::getSysMenuId, zfDownload.getSysMenuId());
+ List<ZfShare> beanRecords = list(lqw);
+ if (beanRecords.size() != 0){
+ return beanRecords.get(0).getUserId();
+ }
+ else {
+ return null;
+ }
+ }
+
+
+
+}
diff --git a/zhang-content/src/main/java/com/ruoyi/service/impl/ZExperienceDownloadServiceImpl.java b/zhang-content/src/main/java/com/ruoyi/service/impl/ZExperienceDownloadServiceImpl.java
new file mode 100644
index 0000000..64cf1dd
--- /dev/null
+++ b/zhang-content/src/main/java/com/ruoyi/service/impl/ZExperienceDownloadServiceImpl.java
@@ -0,0 +1,144 @@
+
+package com.ruoyi.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.EsModel;
+import com.ruoyi.common.utils.MapUtils;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.domain.ZExperience;
+import com.ruoyi.domain.ZInfoUser;
+import com.ruoyi.domain.ZfDownload;
+import com.ruoyi.mapper.ZfDownloadMapper;
+import com.ruoyi.service.*;
+import lombok.extern.slf4j.Slf4j;
+import org.elasticsearch.action.delete.DeleteRequest;
+import org.elasticsearch.client.RequestOptions;
+import org.elasticsearch.client.RestHighLevelClient;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.io.IOException;
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Slf4j
+@Service
+public class ZExperienceDownloadServiceImpl extends ServiceImpl<ZfDownloadMapper,ZfDownload> implements ZExperienceDownloadService {
+ @Resource
+ EsService esService;
+
+ @Resource
+ ZExperienceShareService zExperienceShareService;
+
+ @Resource
+ ZExperienceService zExperienceService;
+
+
+ @Resource
+ ZInfoUserService zInfoUserService;
+
+ @Resource
+ private RestHighLevelClient restHighLevelClient;
+
+ private LambdaQueryWrapper<ZfDownload> buildCondition(ZfDownload zfDownload, Long userId) {
+ LambdaQueryWrapper<ZfDownload> lqw = new LambdaQueryWrapper<>();
+ lqw.in(ZfDownload::getDownloadId,userId);
+ lqw.orderByDesc(ZfDownload::getDownloadId);
+ lqw.like(zfDownload.getDownloadId() != null, ZfDownload::getDownloadId, zfDownload.getDownloadId())
+ .like(zfDownload.getDownloadContent() != null, ZfDownload::getDownloadContent, zfDownload.getDownloadContent())
+ .eq( ZfDownload::getSysMenuId, zfDownload.getSysMenuId());
+ return lqw;
+ }
+ private LambdaQueryWrapper<ZfDownload> uniqueCondition(ZfDownload zfDownload) {
+ LambdaQueryWrapper<ZfDownload> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(StringUtils.isNotEmpty(String.valueOf(zfDownload.getDownloadId())), ZfDownload::getDownloadId, zfDownload.getDownloadId())
+ .eq(StringUtils.isNotEmpty(String.valueOf(zfDownload.getDownloadContent())), ZfDownload::getDownloadContent, zfDownload.getDownloadContent())
+ .eq(ZfDownload::getSysMenuId, zfDownload.getSysMenuId());
+ return lqw;
+ }
+
+ public Long getUserId() {
+ ZInfoUser myself = zInfoUserService.getMyself();
+ return myself.getUserId();
+ }
+ @Override
+ public AjaxResult addData(ZfDownload zfDownload) {
+ zfDownload.setDownloadId(getUserId());
+ LambdaQueryWrapper<ZfDownload> lqw = uniqueCondition(zfDownload);
+ List<ZfDownload> list = list(lqw);
+ if (list.size() > 0) {
+ throw new RuntimeException("璇峰嬁閲嶅涓嬭浇鏁版嵁");
+ }
+
+ zfDownload.setDownloadId(getUserId());
+ zfDownload.setShareId(zExperienceShareService.getShareId(zfDownload));
+ if (save(zfDownload)) {
+ EsModel esModel = new EsModel();
+ Integer inte = zfDownload.getId().intValue();
+ String uuid = UUID.randomUUID().toString().replace("-", "");
+ esModel.setId(uuid);
+ esModel.setCtId(Long.valueOf(inte));
+ esModel.setCtTableName("涓昏瀛︿範鎴栧伐浣滅粡鍘�");
+
+ esModel.setBy1(String.valueOf(zfDownload.getDownloadId()));
+ esModel.setBy2(String.valueOf(zfDownload.getDownloadContent()));
+ esModel.setBy3(String.valueOf(zfDownload.getShareId()));
+ //杩欓噷瀛樺偍鏌ヨ璇︽儏鐨勮矾寰�
+ esService.insertTable(esModel);
+ return AjaxResult.success();
+ } else {
+ return AjaxResult.error();
+ }
+ }
+
+ @Override
+ public AjaxResult deleteData(Long[] ids) {
+ List<ZfDownload> zfDownloads = listByIds(Arrays.asList(ids));
+
+ if (zExperienceShareService.removeByIds(Arrays.asList(ids))) {
+
+ //鍒犻櫎es涓殑鏁版嵁
+ zfDownloads.stream().forEach(zfDoctorDownload -> {
+ EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "涓昏瀛︿範鎴栧伐浣滅粡鍘嗕笅杞�");
+
+ if (esModel != null) {
+ DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId());
+ try {
+ restHighLevelClient.delete(deleteRequest, RequestOptions.DEFAULT);
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ });
+ return AjaxResult.success();
+ } else {
+ return AjaxResult.error();
+ }
+ }
+
+ @Override
+ public AjaxResult selectDoctorList(ZfDownload zfDownload, Integer pageNo, Integer pageSize) {
+ ZInfoUser myself = zInfoUserService.getMyself();
+ LambdaQueryWrapper<ZfDownload> lqw = buildCondition(zfDownload,myself.getUserId());
+ List<ZfDownload> beanRecords = list(lqw);
+ List<ZExperience> bs = new ArrayList<>();
+ for (ZfDownload a: beanRecords) {
+ if (zExperienceService.getById(a.getDownloadContent()) != null) {
+ ZExperience ds = zExperienceService.getById(a.getDownloadContent());
+ ds.setShareId(a.getShareId().intValue());
+ bs.add(ds);
+ }
+ }
+ List<ZExperience> record = bs.stream().skip((pageNo-1)*pageSize).limit(pageSize).collect(Collectors.toList());
+
+ int totalPage = (bs.size() -1) / pageSize +1;
+
+ Page<ZExperience> zExperiencePage = new Page<>(pageNo, pageSize,totalPage);
+ HashMap<String, Object> data = MapUtils.getShareResult(zExperiencePage, record,bs.size());
+ return AjaxResult.success(data);
+ }
+
+}
diff --git a/zhang-content/src/main/java/com/ruoyi/service/impl/ZExperienceShareServiceImpl.java b/zhang-content/src/main/java/com/ruoyi/service/impl/ZExperienceShareServiceImpl.java
new file mode 100644
index 0000000..1e18215
--- /dev/null
+++ b/zhang-content/src/main/java/com/ruoyi/service/impl/ZExperienceShareServiceImpl.java
@@ -0,0 +1,194 @@
+
+package com.ruoyi.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.SysUser;
+import com.ruoyi.common.utils.MapUtils;
+import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.domain.*;
+import com.ruoyi.mapper.ZfShareMapper;
+import com.ruoyi.service.ZExperienceShareService;
+import com.ruoyi.service. ZExperienceService;
+import com.ruoyi.service. ZExperienceShareService;
+import com.ruoyi.service.ZInfoUserService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.stream.Collectors;
+
+@Service
+public class ZExperienceShareServiceImpl extends ServiceImpl<ZfShareMapper,ZfShare> implements ZExperienceShareService {
+
+
+ @Resource
+ ZExperienceService zExperienceService;
+
+ @Resource
+ private ZInfoUserService zInfoUserService;
+
+ private LambdaQueryWrapper<ZfShare> uniqueCondition(ZfShare zfShare) {
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(StringUtils.isNotEmpty(String.valueOf(zfShare.getShareId())), ZfShare::getShareId, zfShare.getShareId());
+ lqw.eq(StringUtils.isNotEmpty(String.valueOf(zfShare.getShareContent())), ZfShare::getShareContent, zfShare.getShareContent());
+ lqw.eq(StringUtils.isNotEmpty(String.valueOf(zfShare.getSysMenuId())), ZfShare::getSysMenuId, zfShare.getSysMenuId());
+ return lqw;
+ }
+
+ @Override
+ public List<ZfShare> getAuthority() {
+ SysUser user = SecurityUtils.getLoginUser().getUser();
+ Long userId = user.getUserId();
+
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId,userId);
+
+ return list(lqw);
+ }
+
+ public Long getUserId(){
+ ZInfoUser myself = zInfoUserService.getMyself();
+ return myself.getUserId();
+
+ }
+
+ public void addData(ZfShare za)
+ {
+ LambdaQueryWrapper<ZfShare> lqw = uniqueCondition(za);
+ List<ZfShare> list = list(lqw);
+
+ if(list.size()>0){
+ throw new RuntimeException("璇峰嬁鍒嗕韩閲嶅鏁版嵁");
+ }
+ else {
+ save(za);
+ }
+
+ }
+
+ @Override
+ public AjaxResult saveZa(ShareMore shareMore) {
+ Long [] shareIds = shareMore.getShareIds();
+ Long [] shareContents = shareMore.getShareContents();
+ for (Long shareId : shareIds) {
+ for (Long shareContent : shareContents) {
+ ZfShare za = new ZfShare();
+ za.setUserId(getUserId());
+ za.setShareContent(shareContent);
+ za.setShareId(shareId);
+ za.setSysMenuId(20102L);
+ addData(za);
+ }
+ }
+ // Long []
+ // if(bl)
+ return AjaxResult.success("鍒嗕韩鎴愬姛!");
+ }
+
+ @Override
+ public AjaxResult listByFidAid(ShareMore shareMore, Integer pageNo, Integer pageSize) {
+ Long [] shareIds = shareMore.getShareIds();
+ List< ZExperience> beanRecord3 = new ArrayList<>();
+ for (Long shareId : shareIds) {
+ {
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId,shareId)
+ .eq(ZfShare::getSysMenuId,shareMore.getSysMenuId())
+ .eq(ZfShare::getUserId, getUserId());
+ List<ZfShare> beanRecords = list(lqw);
+ for (ZfShare beanRecord : beanRecords ) {
+ beanRecord3.add( zExperienceService.getById(beanRecord.getShareContent()));
+ }
+ }
+ }
+ List< ZExperience> record = beanRecord3.stream().skip((pageNo-1)*pageSize).limit(pageSize).collect(Collectors.toList());
+
+ int totalPage = (beanRecord3.size() -1) / pageSize +1;
+
+ Page< ZExperience> zExperiencePage = new Page<>(pageNo, pageSize,totalPage);
+ HashMap<String, Object> data = MapUtils.getShareResult( zExperiencePage, record,beanRecord3.size());
+
+ return AjaxResult.success(data);
+ }
+
+ @Override
+ public AjaxResult deleteZa(ShareMore shareMore) {
+ Long [] shareIds = shareMore.getShareIds();
+ Long [] shareContents = shareMore.getShareContents();
+ for(Long shareId : shareIds)
+ for(Long shareContent: shareContents)
+ {
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId,shareId)
+ .eq(ZfShare::getShareContent, shareContent)
+ .eq(ZfShare::getSysMenuId, shareMore.getSysMenuId())
+ .eq(ZfShare::getUserId, getUserId());
+
+ remove(lqw);
+ // addData(za);
+ }
+ return AjaxResult.success("鏁版嵁鏀跺洖鎴愬姛!");
+ }
+
+ @Override
+ public AjaxResult listByUserId() {
+ HashMap<Long,List< ZExperience>> bs = new HashMap<>();
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId,getUserId());
+ lqw.eq(ZfShare::getSysMenuId,20102L);
+ List<ZfShare> beanRecords = list(lqw);
+ List< ZExperience> b1 = new ArrayList<>();
+ for (ZfShare beanRecord : beanRecords ) {
+ b1.add( zExperienceService.getById(beanRecord.getShareContent()));
+ bs.put(beanRecord.getUserId(),b1);
+ }
+// log.info("浠庢暟鎹簱涓煡鍒扮殑涓�:{}", bs);
+ return AjaxResult.success(bs);
+ }
+
+ @Override
+ public AjaxResult listUserId(Integer pageNo, Integer pageSize) {
+ List< ZExperience> bs = new ArrayList<>();
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId,getUserId());
+ lqw.eq(ZfShare::getSysMenuId,20102L);
+ List<ZfShare> beanRecords = list(lqw);
+ for (ZfShare beanRecord : beanRecords ) {
+ ZExperience bs2 = zExperienceService.getById(beanRecord.getShareContent());
+ bs2.setShareId(beanRecord.getUserId().intValue());
+ bs.add(bs2);
+ }
+// log.info("浠庢暟鎹簱涓煡鍒扮殑涓�:{}", bs);
+ List< ZExperience> record = bs.stream().skip((pageNo-1)*pageSize).limit(pageSize).collect(Collectors.toList());
+
+ int totalPage = (bs.size() -1) / pageSize +1;
+
+ Page< ZExperience> zExperiencePage = new Page<>(pageNo, pageSize,totalPage);
+ HashMap<String, Object> data = MapUtils.getShareResult(zExperiencePage, record,bs.size());
+ return AjaxResult.success(data);
+ }
+
+ @Override
+ public Long getShareId(ZfDownload zfDownload) {
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId, zfDownload.getDownloadId())
+ .eq(ZfShare::getShareContent, zfDownload.getDownloadContent())
+ .eq(ZfShare::getSysMenuId, zfDownload.getSysMenuId());
+ List<ZfShare> beanRecords = list(lqw);
+ if (beanRecords.size() != 0){
+ return beanRecords.get(0).getUserId();
+ }
+ else {
+ return null;
+ }
+ }
+
+
+
+}
diff --git a/zhang-content/src/main/java/com/ruoyi/service/impl/ZHonorDownloadServiceImpl.java b/zhang-content/src/main/java/com/ruoyi/service/impl/ZHonorDownloadServiceImpl.java
new file mode 100644
index 0000000..1fef431
--- /dev/null
+++ b/zhang-content/src/main/java/com/ruoyi/service/impl/ZHonorDownloadServiceImpl.java
@@ -0,0 +1,145 @@
+
+package com.ruoyi.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.EsModel;
+import com.ruoyi.common.utils.MapUtils;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.domain.ZHonor;
+import com.ruoyi.domain.ZInfoUser;
+import com.ruoyi.domain.ZfDownload;
+import com.ruoyi.domain.ZHonor;
+import com.ruoyi.mapper.ZfDownloadMapper;
+import com.ruoyi.service.*;
+import lombok.extern.slf4j.Slf4j;
+import org.elasticsearch.action.delete.DeleteRequest;
+import org.elasticsearch.client.RequestOptions;
+import org.elasticsearch.client.RestHighLevelClient;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.io.IOException;
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Slf4j
+@Service
+public class ZHonorDownloadServiceImpl extends ServiceImpl<ZfDownloadMapper,ZfDownload> implements ZHonorDownloadService {
+ @Resource
+ EsService esService;
+
+ @Resource
+ ZHonorShareService zHonorShareService;
+
+ @Resource
+ ZHonorService zHonorService;
+
+
+ @Resource
+ ZInfoUserService zInfoUserService;
+
+ @Resource
+ private RestHighLevelClient restHighLevelClient;
+
+ private LambdaQueryWrapper<ZfDownload> buildCondition(ZfDownload zfDownload, Long userId) {
+ LambdaQueryWrapper<ZfDownload> lqw = new LambdaQueryWrapper<>();
+ lqw.in(ZfDownload::getDownloadId,userId);
+ lqw.orderByDesc(ZfDownload::getDownloadId);
+ lqw.like(zfDownload.getDownloadId() != null, ZfDownload::getDownloadId, zfDownload.getDownloadId())
+ .like(zfDownload.getDownloadContent() != null, ZfDownload::getDownloadContent, zfDownload.getDownloadContent())
+ .eq( ZfDownload::getSysMenuId, zfDownload.getSysMenuId());
+ return lqw;
+ }
+ private LambdaQueryWrapper<ZfDownload> uniqueCondition(ZfDownload zfDownload) {
+ LambdaQueryWrapper<ZfDownload> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(StringUtils.isNotEmpty(String.valueOf(zfDownload.getDownloadId())), ZfDownload::getDownloadId, zfDownload.getDownloadId())
+ .eq(StringUtils.isNotEmpty(String.valueOf(zfDownload.getDownloadContent())), ZfDownload::getDownloadContent, zfDownload.getDownloadContent())
+ .eq(ZfDownload::getSysMenuId, zfDownload.getSysMenuId());
+ return lqw;
+ }
+
+ public Long getUserId() {
+ ZInfoUser myself = zInfoUserService.getMyself();
+ return myself.getUserId();
+ }
+ @Override
+ public AjaxResult addData(ZfDownload zfDownload) {
+ zfDownload.setDownloadId(getUserId());
+ LambdaQueryWrapper<ZfDownload> lqw = uniqueCondition(zfDownload);
+ List<ZfDownload> list = list(lqw);
+ if (list.size() > 0) {
+ throw new RuntimeException("璇峰嬁閲嶅涓嬭浇鏁版嵁");
+ }
+
+ zfDownload.setDownloadId(getUserId());
+ zfDownload.setShareId(zHonorShareService.getShareId(zfDownload));
+ if (save(zfDownload)) {
+ EsModel esModel = new EsModel();
+ Integer inte = zfDownload.getId().intValue();
+ String uuid = UUID.randomUUID().toString().replace("-", "");
+ esModel.setId(uuid);
+ esModel.setCtId(Long.valueOf(inte));
+ esModel.setCtTableName("璇佷功鑽h��璧勮川");
+
+ esModel.setBy1(String.valueOf(zfDownload.getDownloadId()));
+ esModel.setBy2(String.valueOf(zfDownload.getDownloadContent()));
+ esModel.setBy3(String.valueOf(zfDownload.getShareId()));
+ //杩欓噷瀛樺偍鏌ヨ璇︽儏鐨勮矾寰�
+ esService.insertTable(esModel);
+ return AjaxResult.success();
+ } else {
+ return AjaxResult.error();
+ }
+ }
+
+ @Override
+ public AjaxResult deleteData(Long[] ids) {
+ List<ZfDownload> zfDownloads = listByIds(Arrays.asList(ids));
+
+ if (zHonorShareService.removeByIds(Arrays.asList(ids))) {
+
+ //鍒犻櫎es涓殑鏁版嵁
+ zfDownloads.stream().forEach(zfDoctorDownload -> {
+ EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "璇佷功鑽h��璧勮川涓嬭浇");
+
+ if (esModel != null) {
+ DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId());
+ try {
+ restHighLevelClient.delete(deleteRequest, RequestOptions.DEFAULT);
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ });
+ return AjaxResult.success();
+ } else {
+ return AjaxResult.error();
+ }
+ }
+
+ @Override
+ public AjaxResult selectDoctorList(ZfDownload zfDownload, Integer pageNo, Integer pageSize) {
+ ZInfoUser myself = zInfoUserService.getMyself();
+ LambdaQueryWrapper<ZfDownload> lqw = buildCondition(zfDownload,myself.getUserId());
+ List<ZfDownload> beanRecords = list(lqw);
+ List<ZHonor> bs = new ArrayList<>();
+ for (ZfDownload a: beanRecords) {
+ if (zHonorService.getById(a.getDownloadContent()) != null) {
+ ZHonor ds = zHonorService.getById(a.getDownloadContent());
+ ds.setShareId(a.getShareId().intValue());
+ bs.add(ds);
+ }
+ }
+ List<ZHonor> record = bs.stream().skip((pageNo-1)*pageSize).limit(pageSize).collect(Collectors.toList());
+
+ int totalPage = (bs.size() -1) / pageSize +1;
+
+ Page<ZHonor> zHonorPage = new Page<>(pageNo, pageSize,totalPage);
+ HashMap<String, Object> data = MapUtils.getShareResult(zHonorPage, record,bs.size());
+ return AjaxResult.success(data);
+ }
+
+}
diff --git a/zhang-content/src/main/java/com/ruoyi/service/impl/ZHonorShareServiceImpl.java b/zhang-content/src/main/java/com/ruoyi/service/impl/ZHonorShareServiceImpl.java
new file mode 100644
index 0000000..826e1b3
--- /dev/null
+++ b/zhang-content/src/main/java/com/ruoyi/service/impl/ZHonorShareServiceImpl.java
@@ -0,0 +1,191 @@
+
+package com.ruoyi.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.SysUser;
+import com.ruoyi.common.utils.MapUtils;
+import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.domain.*;
+import com.ruoyi.mapper.ZfShareMapper;
+import com.ruoyi.service.*;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.stream.Collectors;
+
+@Service
+public class ZHonorShareServiceImpl extends ServiceImpl<ZfShareMapper,ZfShare> implements ZHonorShareService {
+
+
+ @Resource
+ ZHonorService zHonorService;
+
+ @Resource
+ private ZInfoUserService zInfoUserService;
+
+ private LambdaQueryWrapper<ZfShare> uniqueCondition(ZfShare zfShare) {
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(StringUtils.isNotEmpty(String.valueOf(zfShare.getShareId())), ZfShare::getShareId, zfShare.getShareId());
+ lqw.eq(StringUtils.isNotEmpty(String.valueOf(zfShare.getShareContent())), ZfShare::getShareContent, zfShare.getShareContent());
+ lqw.eq(StringUtils.isNotEmpty(String.valueOf(zfShare.getSysMenuId())), ZfShare::getSysMenuId, zfShare.getSysMenuId());
+ return lqw;
+ }
+
+ @Override
+ public List<ZfShare> getAuthority() {
+ SysUser user = SecurityUtils.getLoginUser().getUser();
+ Long userId = user.getUserId();
+
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId,userId);
+
+ return list(lqw);
+ }
+
+ public Long getUserId(){
+ ZInfoUser myself = zInfoUserService.getMyself();
+ return myself.getUserId();
+
+ }
+
+ public void addData(ZfShare za)
+ {
+ LambdaQueryWrapper<ZfShare> lqw = uniqueCondition(za);
+ List<ZfShare> list = list(lqw);
+
+ if(list.size()>0){
+ throw new RuntimeException("璇峰嬁鍒嗕韩閲嶅鏁版嵁");
+ }
+ else {
+ save(za);
+ }
+
+ }
+
+ @Override
+ public AjaxResult saveZa(ShareMore shareMore) {
+ Long [] shareIds = shareMore.getShareIds();
+ Long [] shareContents = shareMore.getShareContents();
+ for (Long shareId : shareIds) {
+ for (Long shareContent : shareContents) {
+ ZfShare za = new ZfShare();
+ za.setUserId(getUserId());
+ za.setShareContent(shareContent);
+ za.setShareId(shareId);
+ za.setSysMenuId(2053L);
+ addData(za);
+ }
+ }
+ // Long []
+ // if(bl)
+ return AjaxResult.success("鍒嗕韩鎴愬姛!");
+ }
+
+ @Override
+ public AjaxResult listByFidAid(ShareMore shareMore, Integer pageNo, Integer pageSize) {
+ Long [] shareIds = shareMore.getShareIds();
+ List<ZHonor> beanRecord3 = new ArrayList<>();
+ for (Long shareId : shareIds) {
+ {
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId,shareId)
+ .eq(ZfShare::getSysMenuId,shareMore.getSysMenuId())
+ .eq(ZfShare::getUserId, getUserId());
+ List<ZfShare> beanRecords = list(lqw);
+ for (ZfShare beanRecord : beanRecords ) {
+ beanRecord3.add(zHonorService.getById(beanRecord.getShareContent()));
+ }
+ }
+ }
+ List<ZHonor> record = beanRecord3.stream().skip((pageNo-1)*pageSize).limit(pageSize).collect(Collectors.toList());
+
+ int totalPage = (beanRecord3.size() -1) / pageSize +1;
+
+ Page<ZHonor> zHonorPage = new Page<>(pageNo, pageSize,totalPage);
+ HashMap<String, Object> data = MapUtils.getShareResult(zHonorPage, record,beanRecord3.size());
+
+ return AjaxResult.success(data);
+ }
+
+ @Override
+ public AjaxResult deleteZa(ShareMore shareMore) {
+ Long [] shareIds = shareMore.getShareIds();
+ Long [] shareContents = shareMore.getShareContents();
+ for(Long shareId : shareIds)
+ for(Long shareContent: shareContents)
+ {
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId,shareId)
+ .eq(ZfShare::getShareContent, shareContent)
+ .eq(ZfShare::getSysMenuId, shareMore.getSysMenuId())
+ .eq(ZfShare::getUserId, getUserId());
+
+ remove(lqw);
+ // addData(za);
+ }
+ return AjaxResult.success("鏁版嵁鏀跺洖鎴愬姛!");
+ }
+
+ @Override
+ public AjaxResult listByUserId() {
+ HashMap<Long,List<ZHonor>> bs = new HashMap<>();
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId,getUserId());
+ lqw.eq(ZfShare::getSysMenuId,2053L);
+ List<ZfShare> beanRecords = list(lqw);
+ List<ZHonor> b1 = new ArrayList<>();
+ for (ZfShare beanRecord : beanRecords ) {
+ b1.add(zHonorService.getById(beanRecord.getShareContent()));
+ bs.put(beanRecord.getUserId(),b1);
+ }
+// log.info("浠庢暟鎹簱涓煡鍒扮殑涓�:{}", bs);
+ return AjaxResult.success(bs);
+ }
+
+ @Override
+ public AjaxResult listUserId(Integer pageNo, Integer pageSize) {
+ List<ZHonor> bs = new ArrayList<>();
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId,getUserId());
+ lqw.eq(ZfShare::getSysMenuId,2053L);
+ List<ZfShare> beanRecords = list(lqw);
+ for (ZfShare beanRecord : beanRecords ) {
+ ZHonor bs2 = zHonorService.getById(beanRecord.getShareContent());
+ bs2.setShareId(beanRecord.getUserId().intValue());
+ bs.add(bs2);
+ }
+// log.info("浠庢暟鎹簱涓煡鍒扮殑涓�:{}", bs);
+ List<ZHonor> record = bs.stream().skip((pageNo-1)*pageSize).limit(pageSize).collect(Collectors.toList());
+
+ int totalPage = (bs.size() -1) / pageSize +1;
+
+ Page<ZHonor> zfCleanPage = new Page<>(pageNo, pageSize,totalPage);
+ HashMap<String, Object> data = MapUtils.getShareResult(zfCleanPage, record,bs.size());
+ return AjaxResult.success(data);
+ }
+
+ @Override
+ public Long getShareId(ZfDownload zfDownload) {
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId, zfDownload.getDownloadId())
+ .eq(ZfShare::getShareContent, zfDownload.getDownloadContent())
+ .eq(ZfShare::getSysMenuId, zfDownload.getSysMenuId());
+ List<ZfShare> beanRecords = list(lqw);
+ if (beanRecords.size() != 0){
+ return beanRecords.get(0).getUserId();
+ }
+ else {
+ return null;
+ }
+ }
+
+
+
+}
diff --git a/zhang-content/src/main/java/com/ruoyi/service/impl/ZIdeaDownloadServiceImpl.java b/zhang-content/src/main/java/com/ruoyi/service/impl/ZIdeaDownloadServiceImpl.java
new file mode 100644
index 0000000..8afb8b2
--- /dev/null
+++ b/zhang-content/src/main/java/com/ruoyi/service/impl/ZIdeaDownloadServiceImpl.java
@@ -0,0 +1,144 @@
+
+package com.ruoyi.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.EsModel;
+import com.ruoyi.common.utils.MapUtils;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.domain.ZInfoUser;
+import com.ruoyi.domain.ZfDownload;
+import com.ruoyi.domain.ZIdea;
+import com.ruoyi.mapper.ZfDownloadMapper;
+import com.ruoyi.service.*;
+import lombok.extern.slf4j.Slf4j;
+import org.elasticsearch.action.delete.DeleteRequest;
+import org.elasticsearch.client.RequestOptions;
+import org.elasticsearch.client.RestHighLevelClient;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.io.IOException;
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Slf4j
+@Service
+public class ZIdeaDownloadServiceImpl extends ServiceImpl<ZfDownloadMapper,ZfDownload> implements ZIdeaDownloadService {
+ @Resource
+ EsService esService;
+
+ @Resource
+ ZIdeaShareService zIdeaShareService;
+
+ @Resource
+ ZIdeaService zIdeaService;
+
+
+ @Resource
+ ZInfoUserService zInfoUserService;
+
+ @Resource
+ private RestHighLevelClient restHighLevelClient;
+
+ private LambdaQueryWrapper<ZfDownload> buildCondition(ZfDownload zfDownload, Long userId) {
+ LambdaQueryWrapper<ZfDownload> lqw = new LambdaQueryWrapper<>();
+ lqw.in(ZfDownload::getDownloadId,userId);
+ lqw.orderByDesc(ZfDownload::getDownloadId);
+ lqw.like(zfDownload.getDownloadId() != null, ZfDownload::getDownloadId, zfDownload.getDownloadId())
+ .like(zfDownload.getDownloadContent() != null, ZfDownload::getDownloadContent, zfDownload.getDownloadContent())
+ .eq( ZfDownload::getSysMenuId, zfDownload.getSysMenuId());
+ return lqw;
+ }
+ private LambdaQueryWrapper<ZfDownload> uniqueCondition(ZfDownload zfDownload) {
+ LambdaQueryWrapper<ZfDownload> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(StringUtils.isNotEmpty(String.valueOf(zfDownload.getDownloadId())), ZfDownload::getDownloadId, zfDownload.getDownloadId())
+ .eq(StringUtils.isNotEmpty(String.valueOf(zfDownload.getDownloadContent())), ZfDownload::getDownloadContent, zfDownload.getDownloadContent())
+ .eq(ZfDownload::getSysMenuId, zfDownload.getSysMenuId());
+ return lqw;
+ }
+
+ public Long getUserId() {
+ ZInfoUser myself = zInfoUserService.getMyself();
+ return myself.getUserId();
+ }
+ @Override
+ public AjaxResult addData(ZfDownload zfDownload) {
+ zfDownload.setDownloadId(getUserId());
+ LambdaQueryWrapper<ZfDownload> lqw = uniqueCondition(zfDownload);
+ List<ZfDownload> list = list(lqw);
+ if (list.size() > 0) {
+ throw new RuntimeException("璇峰嬁閲嶅涓嬭浇鏁版嵁");
+ }
+
+ zfDownload.setDownloadId(getUserId());
+ zfDownload.setShareId(zIdeaShareService.getShareId(zfDownload));
+ if (save(zfDownload)) {
+ EsModel esModel = new EsModel();
+ Integer inte = zfDownload.getId().intValue();
+ String uuid = UUID.randomUUID().toString().replace("-", "");
+ esModel.setId(uuid);
+ esModel.setCtId(Long.valueOf(inte));
+ esModel.setCtTableName("鐧惧勾蹇冩効");
+
+ esModel.setBy1(String.valueOf(zfDownload.getDownloadId()));
+ esModel.setBy2(String.valueOf(zfDownload.getDownloadContent()));
+ esModel.setBy3(String.valueOf(zfDownload.getShareId()));
+ //杩欓噷瀛樺偍鏌ヨ璇︽儏鐨勮矾寰�
+ esService.insertTable(esModel);
+ return AjaxResult.success();
+ } else {
+ return AjaxResult.error();
+ }
+ }
+
+ @Override
+ public AjaxResult deleteData(Long[] ids) {
+ List<ZfDownload> zfDownloads = listByIds(Arrays.asList(ids));
+
+ if (zIdeaShareService.removeByIds(Arrays.asList(ids))) {
+
+ //鍒犻櫎es涓殑鏁版嵁
+ zfDownloads.stream().forEach(zfDoctorDownload -> {
+ EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "鐧惧勾蹇冩効涓嬭浇");
+
+ if (esModel != null) {
+ DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId());
+ try {
+ restHighLevelClient.delete(deleteRequest, RequestOptions.DEFAULT);
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ });
+ return AjaxResult.success();
+ } else {
+ return AjaxResult.error();
+ }
+ }
+
+ @Override
+ public AjaxResult selectDoctorList(ZfDownload zfDownload, Integer pageNo, Integer pageSize) {
+ ZInfoUser myself = zInfoUserService.getMyself();
+ LambdaQueryWrapper<ZfDownload> lqw = buildCondition(zfDownload,myself.getUserId());
+ List<ZfDownload> beanRecords = list(lqw);
+ List<ZIdea> bs = new ArrayList<>();
+ for (ZfDownload a: beanRecords) {
+ if (zIdeaService.getById(a.getDownloadContent()) != null) {
+ ZIdea ds = zIdeaService.getById(a.getDownloadContent());
+ ds.setShareId(a.getShareId().intValue());
+ bs.add(ds);
+ }
+ }
+ List<ZIdea> record = bs.stream().skip((pageNo-1)*pageSize).limit(pageSize).collect(Collectors.toList());
+
+ int totalPage = (bs.size() -1) / pageSize +1;
+
+ Page<ZIdea> zIdeaPage = new Page<>(pageNo, pageSize,totalPage);
+ HashMap<String, Object> data = MapUtils.getShareResult(zIdeaPage, record,bs.size());
+ return AjaxResult.success(data);
+ }
+
+}
diff --git a/zhang-content/src/main/java/com/ruoyi/service/impl/ZIdeaShareServiceImpl.java b/zhang-content/src/main/java/com/ruoyi/service/impl/ZIdeaShareServiceImpl.java
new file mode 100644
index 0000000..79017b6
--- /dev/null
+++ b/zhang-content/src/main/java/com/ruoyi/service/impl/ZIdeaShareServiceImpl.java
@@ -0,0 +1,193 @@
+
+package com.ruoyi.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.SysUser;
+import com.ruoyi.common.utils.MapUtils;
+import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.domain.*;
+import com.ruoyi.mapper.ZfShareMapper;
+import com.ruoyi.service.ZIdeaShareService;
+import com.ruoyi.service.ZInfoUserService;
+import com.ruoyi.service.ZIdeaService;
+import com.ruoyi.service.ZIdeaShareService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.stream.Collectors;
+
+@Service
+public class ZIdeaShareServiceImpl extends ServiceImpl<ZfShareMapper,ZfShare> implements ZIdeaShareService {
+
+ @Resource
+ ZIdeaService zIdeaService;
+
+ @Resource
+ private ZInfoUserService zInfoUserService;
+
+ private LambdaQueryWrapper<ZfShare> uniqueCondition(ZfShare zfShare) {
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(StringUtils.isNotEmpty(String.valueOf(zfShare.getShareId())), ZfShare::getShareId, zfShare.getShareId());
+ lqw.eq(StringUtils.isNotEmpty(String.valueOf(zfShare.getShareContent())), ZfShare::getShareContent, zfShare.getShareContent());
+ lqw.eq(StringUtils.isNotEmpty(String.valueOf(zfShare.getSysMenuId())), ZfShare::getSysMenuId, zfShare.getSysMenuId());
+ return lqw;
+ }
+
+ @Override
+ public List<ZfShare> getAuthority() {
+ SysUser user = SecurityUtils.getLoginUser().getUser();
+ Long userId = user.getUserId();
+
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId,userId);
+
+ return list(lqw);
+ }
+
+ public Long getUserId(){
+ ZInfoUser myself = zInfoUserService.getMyself();
+ return myself.getUserId();
+
+ }
+
+ public void addData(ZfShare za)
+ {
+ LambdaQueryWrapper<ZfShare> lqw = uniqueCondition(za);
+ List<ZfShare> list = list(lqw);
+
+ if(list.size()>0){
+ throw new RuntimeException("璇峰嬁鍒嗕韩閲嶅鏁版嵁");
+ }
+ else {
+ save(za);
+ }
+
+ }
+
+ @Override
+ public AjaxResult saveZa(ShareMore shareMore) {
+ Long [] shareIds = shareMore.getShareIds();
+ Long [] shareContents = shareMore.getShareContents();
+ for (Long shareId : shareIds) {
+ for (Long shareContent : shareContents) {
+ ZfShare za = new ZfShare();
+ za.setUserId(getUserId());
+ za.setShareContent(shareContent);
+ za.setShareId(shareId);
+ za.setSysMenuId(2027L);
+ addData(za);
+ }
+ }
+ // Long []
+ // if(bl)
+ return AjaxResult.success("鍒嗕韩鎴愬姛!");
+ }
+
+ @Override
+ public AjaxResult listByFidAid(ShareMore shareMore, Integer pageNo, Integer pageSize) {
+ Long [] shareIds = shareMore.getShareIds();
+ List<ZIdea> beanRecord3 = new ArrayList<>();
+ for (Long shareId : shareIds) {
+ {
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId,shareId)
+ .eq(ZfShare::getSysMenuId,shareMore.getSysMenuId())
+ .eq(ZfShare::getUserId, getUserId());
+ List<ZfShare> beanRecords = list(lqw);
+ for (ZfShare beanRecord : beanRecords ) {
+ beanRecord3.add(zIdeaService.getById(beanRecord.getShareContent()));
+ }
+ }
+ }
+ List<ZIdea> record = beanRecord3.stream().skip((pageNo-1)*pageSize).limit(pageSize).collect(Collectors.toList());
+
+ int totalPage = (beanRecord3.size() -1) / pageSize +1;
+
+ Page<ZIdea> zIdeaPage = new Page<>(pageNo, pageSize,totalPage);
+ HashMap<String, Object> data = MapUtils.getShareResult(zIdeaPage, record,beanRecord3.size());
+
+ return AjaxResult.success(data);
+ }
+
+ @Override
+ public AjaxResult deleteZa(ShareMore shareMore) {
+ Long [] shareIds = shareMore.getShareIds();
+ Long [] shareContents = shareMore.getShareContents();
+ for(Long shareId : shareIds)
+ for(Long shareContent: shareContents)
+ {
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId,shareId)
+ .eq(ZfShare::getShareContent, shareContent)
+ .eq(ZfShare::getSysMenuId, shareMore.getSysMenuId())
+ .eq(ZfShare::getUserId, getUserId());
+
+ remove(lqw);
+ // addData(za);
+ }
+ return AjaxResult.success("鏁版嵁鏀跺洖鎴愬姛!");
+ }
+
+ @Override
+ public AjaxResult listByUserId() {
+ HashMap<Long,List<ZIdea>> bs = new HashMap<>();
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId,getUserId());
+ lqw.eq(ZfShare::getSysMenuId,2027L);
+ List<ZfShare> beanRecords = list(lqw);
+ List<ZIdea> b1 = new ArrayList<>();
+ for (ZfShare beanRecord : beanRecords ) {
+ b1.add(zIdeaService.getById(beanRecord.getShareContent()));
+ bs.put(beanRecord.getUserId(),b1);
+ }
+// log.info("浠庢暟鎹簱涓煡鍒扮殑涓�:{}", bs);
+ return AjaxResult.success(bs);
+ }
+
+ @Override
+ public AjaxResult listUserId(Integer pageNo, Integer pageSize) {
+ List<ZIdea> bs = new ArrayList<>();
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId,getUserId());
+ lqw.eq(ZfShare::getSysMenuId,2027L);
+ List<ZfShare> beanRecords = list(lqw);
+ for (ZfShare beanRecord : beanRecords ) {
+ ZIdea bs2 = zIdeaService.getById(beanRecord.getShareContent());
+ bs2.setShareId(beanRecord.getUserId().intValue());
+ bs.add(bs2);
+ }
+// log.info("浠庢暟鎹簱涓煡鍒扮殑涓�:{}", bs);
+ List<ZIdea> record = bs.stream().skip((pageNo-1)*pageSize).limit(pageSize).collect(Collectors.toList());
+
+ int totalPage = (bs.size() -1) / pageSize +1;
+
+ Page<ZIdea> zIdeaPage = new Page<>(pageNo, pageSize,totalPage);
+ HashMap<String, Object> data = MapUtils.getShareResult(zIdeaPage, record,bs.size());
+ return AjaxResult.success(data);
+ }
+
+ @Override
+ public Long getShareId(ZfDownload zfDownload) {
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId, zfDownload.getDownloadId())
+ .eq(ZfShare::getShareContent, zfDownload.getDownloadContent())
+ .eq(ZfShare::getSysMenuId, zfDownload.getSysMenuId());
+ List<ZfShare> beanRecords = list(lqw);
+ if (beanRecords.size() != 0){
+ return beanRecords.get(0).getUserId();
+ }
+ else {
+ return null;
+ }
+ }
+
+
+
+}
diff --git a/zhang-content/src/main/java/com/ruoyi/service/impl/ZPropertyDownloadServiceImpl.java b/zhang-content/src/main/java/com/ruoyi/service/impl/ZPropertyDownloadServiceImpl.java
new file mode 100644
index 0000000..d8519b2
--- /dev/null
+++ b/zhang-content/src/main/java/com/ruoyi/service/impl/ZPropertyDownloadServiceImpl.java
@@ -0,0 +1,144 @@
+
+package com.ruoyi.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.EsModel;
+import com.ruoyi.common.utils.MapUtils;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.domain.ZInfoUser;
+import com.ruoyi.domain.ZfDownload;
+import com.ruoyi.domain.ZProperty;
+import com.ruoyi.mapper.ZfDownloadMapper;
+import com.ruoyi.service.*;
+import lombok.extern.slf4j.Slf4j;
+import org.elasticsearch.action.delete.DeleteRequest;
+import org.elasticsearch.client.RequestOptions;
+import org.elasticsearch.client.RestHighLevelClient;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.io.IOException;
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Slf4j
+@Service
+public class ZPropertyDownloadServiceImpl extends ServiceImpl<ZfDownloadMapper,ZfDownload> implements ZPropertyDownloadService {
+ @Resource
+ EsService esService;
+
+ @Resource
+ ZPropertyShareService zPropertyShareService;
+
+ @Resource
+ ZPropertyService zPropertyService;
+
+
+ @Resource
+ ZInfoUserService zInfoUserService;
+
+ @Resource
+ private RestHighLevelClient restHighLevelClient;
+
+ private LambdaQueryWrapper<ZfDownload> buildCondition(ZfDownload zfDownload, Long userId) {
+ LambdaQueryWrapper<ZfDownload> lqw = new LambdaQueryWrapper<>();
+ lqw.in(ZfDownload::getDownloadId,userId);
+ lqw.orderByDesc(ZfDownload::getDownloadId);
+ lqw.like(zfDownload.getDownloadId() != null, ZfDownload::getDownloadId, zfDownload.getDownloadId())
+ .like(zfDownload.getDownloadContent() != null, ZfDownload::getDownloadContent, zfDownload.getDownloadContent())
+ .eq( ZfDownload::getSysMenuId, zfDownload.getSysMenuId());
+ return lqw;
+ }
+ private LambdaQueryWrapper<ZfDownload> uniqueCondition(ZfDownload zfDownload) {
+ LambdaQueryWrapper<ZfDownload> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(StringUtils.isNotEmpty(String.valueOf(zfDownload.getDownloadId())), ZfDownload::getDownloadId, zfDownload.getDownloadId())
+ .eq(StringUtils.isNotEmpty(String.valueOf(zfDownload.getDownloadContent())), ZfDownload::getDownloadContent, zfDownload.getDownloadContent())
+ .eq(ZfDownload::getSysMenuId, zfDownload.getSysMenuId());
+ return lqw;
+ }
+
+ public Long getUserId() {
+ ZInfoUser myself = zInfoUserService.getMyself();
+ return myself.getUserId();
+ }
+ @Override
+ public AjaxResult addData(ZfDownload zfDownload) {
+ zfDownload.setDownloadId(getUserId());
+ LambdaQueryWrapper<ZfDownload> lqw = uniqueCondition(zfDownload);
+ List<ZfDownload> list = list(lqw);
+ if (list.size() > 0) {
+ throw new RuntimeException("璇峰嬁閲嶅涓嬭浇鏁版嵁");
+ }
+
+ zfDownload.setDownloadId(getUserId());
+ zfDownload.setShareId(zPropertyShareService.getShareId(zfDownload));
+ if (save(zfDownload)) {
+ EsModel esModel = new EsModel();
+ Integer inte = zfDownload.getId().intValue();
+ String uuid = UUID.randomUUID().toString().replace("-", "");
+ esModel.setId(uuid);
+ esModel.setCtId(Long.valueOf(inte));
+ esModel.setCtTableName("涓汉璐骇");
+
+ esModel.setBy1(String.valueOf(zfDownload.getDownloadId()));
+ esModel.setBy2(String.valueOf(zfDownload.getDownloadContent()));
+ esModel.setBy3(String.valueOf(zfDownload.getShareId()));
+ //杩欓噷瀛樺偍鏌ヨ璇︽儏鐨勮矾寰�
+ esService.insertTable(esModel);
+ return AjaxResult.success();
+ } else {
+ return AjaxResult.error();
+ }
+ }
+
+ @Override
+ public AjaxResult deleteData(Long[] ids) {
+ List<ZfDownload> zfDownloads = listByIds(Arrays.asList(ids));
+
+ if (zPropertyShareService.removeByIds(Arrays.asList(ids))) {
+
+ //鍒犻櫎es涓殑鏁版嵁
+ zfDownloads.stream().forEach(zfDoctorDownload -> {
+ EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "涓汉璐骇涓嬭浇");
+
+ if (esModel != null) {
+ DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId());
+ try {
+ restHighLevelClient.delete(deleteRequest, RequestOptions.DEFAULT);
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ });
+ return AjaxResult.success();
+ } else {
+ return AjaxResult.error();
+ }
+ }
+
+ @Override
+ public AjaxResult selectDoctorList(ZfDownload zfDownload, Integer pageNo, Integer pageSize) {
+ ZInfoUser myself = zInfoUserService.getMyself();
+ LambdaQueryWrapper<ZfDownload> lqw = buildCondition(zfDownload,myself.getUserId());
+ List<ZfDownload> beanRecords = list(lqw);
+ List<ZProperty> bs = new ArrayList<>();
+ for (ZfDownload a: beanRecords) {
+ if (zPropertyService.getById(a.getDownloadContent()) != null) {
+ ZProperty ds = zPropertyService.getById(a.getDownloadContent());
+ ds.setShareId(a.getShareId().intValue());
+ bs.add(ds);
+ }
+ }
+ List<ZProperty> record = bs.stream().skip((pageNo-1)*pageSize).limit(pageSize).collect(Collectors.toList());
+
+ int totalPage = (bs.size() -1) / pageSize +1;
+
+ Page<ZProperty> ZPropertyPage = new Page<>(pageNo, pageSize,totalPage);
+ HashMap<String, Object> data = MapUtils.getShareResult(ZPropertyPage, record,bs.size());
+ return AjaxResult.success(data);
+ }
+
+}
diff --git a/zhang-content/src/main/java/com/ruoyi/service/impl/ZPropertyShareServiceImpl.java b/zhang-content/src/main/java/com/ruoyi/service/impl/ZPropertyShareServiceImpl.java
new file mode 100644
index 0000000..bde7ff2
--- /dev/null
+++ b/zhang-content/src/main/java/com/ruoyi/service/impl/ZPropertyShareServiceImpl.java
@@ -0,0 +1,193 @@
+package com.ruoyi.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.SysUser;
+import com.ruoyi.common.utils.MapUtils;
+import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.domain.*;
+import com.ruoyi.mapper.ZfShareMapper;
+import com.ruoyi.service.ZPropertyService;
+import com.ruoyi.service.ZPropertyShareService;
+import com.ruoyi.service.ZInfoUserService;
+import com.ruoyi.service.ZPropertyShareService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.stream.Collectors;
+
+@Slf4j
+@Service
+public class ZPropertyShareServiceImpl extends ServiceImpl<ZfShareMapper,ZfShare> implements ZPropertyShareService {
+
+
+
+ @Resource
+ ZPropertyService zPropertyService;
+
+ @Resource
+ private ZInfoUserService zInfoUserService;
+
+ private LambdaQueryWrapper<ZfShare> uniqueCondition(ZfShare zfShare) {
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(StringUtils.isNotEmpty(String.valueOf(zfShare.getShareId())), ZfShare::getShareId, zfShare.getShareId());
+ lqw.eq(StringUtils.isNotEmpty(String.valueOf(zfShare.getShareContent())), ZfShare::getShareContent, zfShare.getShareContent());
+ lqw.eq(StringUtils.isNotEmpty(String.valueOf(zfShare.getSysMenuId())), ZfShare::getSysMenuId, zfShare.getSysMenuId());
+ return lqw;
+ }
+
+ @Override
+ public List<ZfShare> getAuthority() {
+ SysUser user = SecurityUtils.getLoginUser().getUser();
+ Long userId = user.getUserId();
+
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId,userId);
+
+ return list(lqw);
+ }
+
+ public Long getUserId(){
+ ZInfoUser myself = zInfoUserService.getMyself();
+ return myself.getUserId();
+
+ }
+
+ public void addData(ZfShare za)
+ {
+ LambdaQueryWrapper<ZfShare> lqw = uniqueCondition(za);
+ List<ZfShare> list = list(lqw);
+
+ if(list.size()>0){
+ throw new RuntimeException("璇峰嬁鍒嗕韩閲嶅鏁版嵁");
+ }
+ else {
+ save(za);
+ }
+
+ }
+
+ @Override
+ public AjaxResult saveZa(ShareMore shareMore) {
+ Long [] shareIds = shareMore.getShareIds();
+ Long [] shareContents = shareMore.getShareContents();
+ for (Long shareId : shareIds) {
+ for (Long shareContent : shareContents) {
+ ZfShare za = new ZfShare();
+ za.setUserId(getUserId());
+ za.setShareContent(shareContent);
+ za.setShareId(shareId);
+ za.setSysMenuId(2026L);
+ addData(za);
+ }
+ }
+ // Long []
+ // if(bl)
+ return AjaxResult.success("鍒嗕韩鎴愬姛!");
+ }
+
+ @Override
+ public AjaxResult listByFidAid(ShareMore shareMore, Integer pageNo, Integer pageSize) {
+ Long [] shareIds = shareMore.getShareIds();
+ List<ZProperty> beanRecord3 = new ArrayList<>();
+ for (Long shareId : shareIds) {
+ {
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId,shareId)
+ .eq(ZfShare::getSysMenuId,shareMore.getSysMenuId())
+ .eq(ZfShare::getUserId, getUserId());
+ List<ZfShare> beanRecords = list(lqw);
+ for (ZfShare beanRecord : beanRecords ) {
+ beanRecord3.add(zPropertyService.getById(beanRecord.getShareContent()));
+ }
+ }
+ }
+ List<ZProperty> record = beanRecord3.stream().skip((pageNo-1)*pageSize).limit(pageSize).collect(Collectors.toList());
+
+ int totalPage = (beanRecord3.size() -1) / pageSize +1;
+
+ Page<ZProperty> zPropertyPage = new Page<>(pageNo, pageSize,totalPage);
+ HashMap<String, Object> data = MapUtils.getShareResult(zPropertyPage, record,beanRecord3.size());
+
+ return AjaxResult.success(data);
+ }
+
+ @Override
+ public AjaxResult deleteZa(ShareMore shareMore) {
+ Long [] shareIds = shareMore.getShareIds();
+ Long [] shareContents = shareMore.getShareContents();
+ for(Long shareId : shareIds)
+ for(Long shareContent: shareContents)
+ {
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId,shareId)
+ .eq(ZfShare::getShareContent, shareContent)
+ .eq(ZfShare::getSysMenuId, shareMore.getSysMenuId())
+ .eq(ZfShare::getUserId, getUserId());
+
+ remove(lqw);
+ // addData(za);
+ }
+ return AjaxResult.success("鏁版嵁鏀跺洖鎴愬姛!");
+ }
+
+ @Override
+ public AjaxResult listByUserId() {
+ HashMap<Long,List<ZProperty>> bs = new HashMap<>();
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId,getUserId());
+ lqw.eq(ZfShare::getSysMenuId,2026L);
+ List<ZfShare> beanRecords = list(lqw);
+ List<ZProperty> b1 = new ArrayList<>();
+ for (ZfShare beanRecord : beanRecords ) {
+ b1.add(zPropertyService.getById(beanRecord.getShareContent()));
+ bs.put(beanRecord.getUserId(),b1);
+ }
+ log.info("浠庢暟鎹簱涓煡鍒扮殑涓�:{}", bs);
+ return AjaxResult.success(bs);
+ }
+
+ @Override
+ public AjaxResult listUserId(Integer pageNo, Integer pageSize) {
+ List<ZProperty> bs = new ArrayList<>();
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId,getUserId());
+ lqw.eq(ZfShare::getSysMenuId,2026L);
+ List<ZfShare> beanRecords = list(lqw);
+ for (ZfShare beanRecord : beanRecords ) {
+ ZProperty bs2 = zPropertyService.getById(beanRecord.getShareContent());
+ bs2.setShareId(beanRecord.getUserId().intValue());
+ bs.add(bs2);
+ }
+ log.info("浠庢暟鎹簱涓煡鍒扮殑涓�:{}", bs);
+ List<ZProperty> record = bs.stream().skip((pageNo-1)*pageSize).limit(pageSize).collect(Collectors.toList());
+
+ int totalPage = (bs.size() -1) / pageSize +1;
+
+ Page<ZProperty> zPropertyPage = new Page<>(pageNo, pageSize,totalPage);
+ HashMap<String, Object> data = MapUtils.getShareResult(zPropertyPage, record,bs.size());
+ return AjaxResult.success(data);
+ }
+
+ @Override
+ public Long getShareId(ZfDownload zfDownload) {
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId, zfDownload.getDownloadId())
+ .eq(ZfShare::getShareContent, zfDownload.getDownloadContent())
+ .eq(ZfShare::getSysMenuId, zfDownload.getSysMenuId());
+ List<ZfShare> beanRecords = list(lqw);
+ if (beanRecords.size() != 0){
+ return beanRecords.get(0).getUserId();
+ }
+ else {
+ return null;
+ }
+ }
+}
diff --git a/zhang-content/src/main/java/com/ruoyi/service/impl/ZSecretDownloadServiceImpl.java b/zhang-content/src/main/java/com/ruoyi/service/impl/ZSecretDownloadServiceImpl.java
new file mode 100644
index 0000000..3bfb25d
--- /dev/null
+++ b/zhang-content/src/main/java/com/ruoyi/service/impl/ZSecretDownloadServiceImpl.java
@@ -0,0 +1,144 @@
+
+package com.ruoyi.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.EsModel;
+import com.ruoyi.common.utils.MapUtils;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.domain.ZInfoUser;
+import com.ruoyi.domain.ZfDownload;
+import com.ruoyi.domain.ZSecret;
+import com.ruoyi.mapper.ZfDownloadMapper;
+import com.ruoyi.service.*;
+import lombok.extern.slf4j.Slf4j;
+import org.elasticsearch.action.delete.DeleteRequest;
+import org.elasticsearch.client.RequestOptions;
+import org.elasticsearch.client.RestHighLevelClient;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.io.IOException;
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Slf4j
+@Service
+public class ZSecretDownloadServiceImpl extends ServiceImpl<ZfDownloadMapper,ZfDownload> implements ZSecretDownloadService {
+ @Resource
+ EsService esService;
+
+ @Resource
+ ZSecretShareService zSecretShareService;
+
+ @Resource
+ ZSecretService zSecretService;
+
+
+ @Resource
+ ZInfoUserService zInfoUserService;
+
+ @Resource
+ private RestHighLevelClient restHighLevelClient;
+
+ private LambdaQueryWrapper<ZfDownload> buildCondition(ZfDownload zfDownload, Long userId) {
+ LambdaQueryWrapper<ZfDownload> lqw = new LambdaQueryWrapper<>();
+ lqw.in(ZfDownload::getDownloadId,userId);
+ lqw.orderByDesc(ZfDownload::getDownloadId);
+ lqw.like(zfDownload.getDownloadId() != null, ZfDownload::getDownloadId, zfDownload.getDownloadId())
+ .like(zfDownload.getDownloadContent() != null, ZfDownload::getDownloadContent, zfDownload.getDownloadContent())
+ .eq( ZfDownload::getSysMenuId, zfDownload.getSysMenuId());
+ return lqw;
+ }
+ private LambdaQueryWrapper<ZfDownload> uniqueCondition(ZfDownload zfDownload) {
+ LambdaQueryWrapper<ZfDownload> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(StringUtils.isNotEmpty(String.valueOf(zfDownload.getDownloadId())), ZfDownload::getDownloadId, zfDownload.getDownloadId())
+ .eq(StringUtils.isNotEmpty(String.valueOf(zfDownload.getDownloadContent())), ZfDownload::getDownloadContent, zfDownload.getDownloadContent())
+ .eq(ZfDownload::getSysMenuId, zfDownload.getSysMenuId());
+ return lqw;
+ }
+
+ public Long getUserId() {
+ ZInfoUser myself = zInfoUserService.getMyself();
+ return myself.getUserId();
+ }
+ @Override
+ public AjaxResult addData(ZfDownload zfDownload) {
+ zfDownload.setDownloadId(getUserId());
+ LambdaQueryWrapper<ZfDownload> lqw = uniqueCondition(zfDownload);
+ List<ZfDownload> list = list(lqw);
+ if (list.size() > 0) {
+ throw new RuntimeException("璇峰嬁閲嶅涓嬭浇鏁版嵁");
+ }
+
+ zfDownload.setDownloadId(getUserId());
+ zfDownload.setShareId(zSecretShareService.getShareId(zfDownload));
+ if (save(zfDownload)) {
+ EsModel esModel = new EsModel();
+ Integer inte = zfDownload.getId().intValue();
+ String uuid = UUID.randomUUID().toString().replace("-", "");
+ esModel.setId(uuid);
+ esModel.setCtId(Long.valueOf(inte));
+ esModel.setCtTableName("闅愮");
+
+ esModel.setBy1(String.valueOf(zfDownload.getDownloadId()));
+ esModel.setBy2(String.valueOf(zfDownload.getDownloadContent()));
+ esModel.setBy3(String.valueOf(zfDownload.getShareId()));
+ //杩欓噷瀛樺偍鏌ヨ璇︽儏鐨勮矾寰�
+ esService.insertTable(esModel);
+ return AjaxResult.success();
+ } else {
+ return AjaxResult.error();
+ }
+ }
+
+ @Override
+ public AjaxResult deleteData(Long[] ids) {
+ List<ZfDownload> zfDownloads = listByIds(Arrays.asList(ids));
+
+ if (zSecretShareService.removeByIds(Arrays.asList(ids))) {
+
+ //鍒犻櫎es涓殑鏁版嵁
+ zfDownloads.stream().forEach(zfDoctorDownload -> {
+ EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "闅愮涓嬭浇");
+
+ if (esModel != null) {
+ DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId());
+ try {
+ restHighLevelClient.delete(deleteRequest, RequestOptions.DEFAULT);
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ });
+ return AjaxResult.success();
+ } else {
+ return AjaxResult.error();
+ }
+ }
+
+ @Override
+ public AjaxResult selectDoctorList(ZfDownload zfDownload, Integer pageNo, Integer pageSize) {
+ ZInfoUser myself = zInfoUserService.getMyself();
+ LambdaQueryWrapper<ZfDownload> lqw = buildCondition(zfDownload,myself.getUserId());
+ List<ZfDownload> beanRecords = list(lqw);
+ List<ZSecret> bs = new ArrayList<>();
+ for (ZfDownload a: beanRecords) {
+ if (zSecretService.getById(a.getDownloadContent()) != null) {
+ ZSecret ds = zSecretService.getById(a.getDownloadContent());
+ ds.setShareId(a.getShareId().intValue());
+ bs.add(ds);
+ }
+ }
+ List<ZSecret> record = bs.stream().skip((pageNo-1)*pageSize).limit(pageSize).collect(Collectors.toList());
+
+ int totalPage = (bs.size() -1) / pageSize +1;
+
+ Page<ZSecret> zSecretPage = new Page<>(pageNo, pageSize,totalPage);
+ HashMap<String, Object> data = MapUtils.getShareResult(zSecretPage, record,bs.size());
+ return AjaxResult.success(data);
+ }
+
+}
diff --git a/zhang-content/src/main/java/com/ruoyi/service/impl/ZSecretShareServiceImpl.java b/zhang-content/src/main/java/com/ruoyi/service/impl/ZSecretShareServiceImpl.java
new file mode 100644
index 0000000..2a52012
--- /dev/null
+++ b/zhang-content/src/main/java/com/ruoyi/service/impl/ZSecretShareServiceImpl.java
@@ -0,0 +1,193 @@
+
+package com.ruoyi.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.SysUser;
+import com.ruoyi.common.utils.MapUtils;
+import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.domain.*;
+import com.ruoyi.mapper.ZfShareMapper;
+import com.ruoyi.service.ZInfoUserService;
+import com.ruoyi.service.ZSecretService;
+import com.ruoyi.service.ZSecretShareService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.stream.Collectors;
+
+@Service
+public class ZSecretShareServiceImpl extends ServiceImpl<ZfShareMapper,ZfShare> implements ZSecretShareService {
+
+
+ @Resource
+ ZSecretService zSecretService;
+
+ @Resource
+ private ZInfoUserService zInfoUserService;
+
+ private LambdaQueryWrapper<ZfShare> uniqueCondition(ZfShare zfShare) {
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(StringUtils.isNotEmpty(String.valueOf(zfShare.getShareId())), ZfShare::getShareId, zfShare.getShareId());
+ lqw.eq(StringUtils.isNotEmpty(String.valueOf(zfShare.getShareContent())), ZfShare::getShareContent, zfShare.getShareContent());
+ lqw.eq(StringUtils.isNotEmpty(String.valueOf(zfShare.getSysMenuId())), ZfShare::getSysMenuId, zfShare.getSysMenuId());
+ return lqw;
+ }
+
+ @Override
+ public List<ZfShare> getAuthority() {
+ SysUser user = SecurityUtils.getLoginUser().getUser();
+ Long userId = user.getUserId();
+
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId,userId);
+
+ return list(lqw);
+ }
+
+ public Long getUserId(){
+ ZInfoUser myself = zInfoUserService.getMyself();
+ return myself.getUserId();
+
+ }
+
+ public void addData(ZfShare za)
+ {
+ LambdaQueryWrapper<ZfShare> lqw = uniqueCondition(za);
+ List<ZfShare> list = list(lqw);
+
+ if(list.size()>0){
+ throw new RuntimeException("璇峰嬁鍒嗕韩閲嶅鏁版嵁");
+ }
+ else {
+ save(za);
+ }
+
+ }
+
+ @Override
+ public AjaxResult saveZa(ShareMore shareMore) {
+ Long [] shareIds = shareMore.getShareIds();
+ Long [] shareContents = shareMore.getShareContents();
+ for (Long shareId : shareIds) {
+ for (Long shareContent : shareContents) {
+ ZfShare za = new ZfShare();
+ za.setUserId(getUserId());
+ za.setShareContent(shareContent);
+ za.setShareId(shareId);
+ za.setSysMenuId(2031L);
+ addData(za);
+ }
+ }
+ // Long []
+ // if(bl)
+ return AjaxResult.success("鍒嗕韩鎴愬姛!");
+ }
+
+ @Override
+ public AjaxResult listByFidAid(ShareMore shareMore, Integer pageNo, Integer pageSize) {
+ Long [] shareIds = shareMore.getShareIds();
+ List<ZSecret> beanRecord3 = new ArrayList<>();
+ for (Long shareId : shareIds) {
+ {
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId,shareId)
+ .eq(ZfShare::getSysMenuId,shareMore.getSysMenuId())
+ .eq(ZfShare::getUserId, getUserId());
+ List<ZfShare> beanRecords = list(lqw);
+ for (ZfShare beanRecord : beanRecords ) {
+ beanRecord3.add(zSecretService.getById(beanRecord.getShareContent()));
+ }
+ }
+ }
+ List<ZSecret> record = beanRecord3.stream().skip((pageNo-1)*pageSize).limit(pageSize).collect(Collectors.toList());
+
+ int totalPage = (beanRecord3.size() -1) / pageSize +1;
+
+ Page<ZSecret> zSecretPage = new Page<>(pageNo, pageSize,totalPage);
+ HashMap<String, Object> data = MapUtils.getShareResult(zSecretPage, record,beanRecord3.size());
+
+ return AjaxResult.success(data);
+ }
+
+ @Override
+ public AjaxResult deleteZa(ShareMore shareMore) {
+ Long [] shareIds = shareMore.getShareIds();
+ Long [] shareContents = shareMore.getShareContents();
+ for(Long shareId : shareIds)
+ for(Long shareContent: shareContents)
+ {
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId,shareId)
+ .eq(ZfShare::getShareContent, shareContent)
+ .eq(ZfShare::getSysMenuId, shareMore.getSysMenuId())
+ .eq(ZfShare::getUserId, getUserId());
+
+ remove(lqw);
+ // addData(za);
+ }
+ return AjaxResult.success("鏁版嵁鏀跺洖鎴愬姛!");
+ }
+
+ @Override
+ public AjaxResult listByUserId() {
+ HashMap<Long,List<ZSecret>> bs = new HashMap<>();
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId,getUserId());
+ lqw.eq(ZfShare::getSysMenuId,2031L);
+ List<ZfShare> beanRecords = list(lqw);
+ List<ZSecret> b1 = new ArrayList<>();
+ for (ZfShare beanRecord : beanRecords ) {
+ b1.add(zSecretService.getById(beanRecord.getShareContent()));
+ bs.put(beanRecord.getUserId(),b1);
+ }
+// log.info("浠庢暟鎹簱涓煡鍒扮殑涓�:{}", bs);
+ return AjaxResult.success(bs);
+ }
+
+ @Override
+ public AjaxResult listUserId(Integer pageNo, Integer pageSize) {
+ List<ZSecret> bs = new ArrayList<>();
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId,getUserId());
+ lqw.eq(ZfShare::getSysMenuId,2031L);
+ List<ZfShare> beanRecords = list(lqw);
+ for (ZfShare beanRecord : beanRecords ) {
+ ZSecret bs2 = zSecretService.getById(beanRecord.getShareContent());
+ bs2.setShareId(beanRecord.getUserId().intValue());
+ bs.add(bs2);
+ }
+// log.info("浠庢暟鎹簱涓煡鍒扮殑涓�:{}", bs);
+ List<ZSecret> record = bs.stream().skip((pageNo-1)*pageSize).limit(pageSize).collect(Collectors.toList());
+
+ int totalPage = (bs.size() -1) / pageSize +1;
+
+ Page<ZSecret> zSecretPage = new Page<>(pageNo, pageSize,totalPage);
+ HashMap<String, Object> data = MapUtils.getShareResult(zSecretPage, record,bs.size());
+ return AjaxResult.success(data);
+ }
+
+ @Override
+ public Long getShareId(ZfDownload zfDownload) {
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId, zfDownload.getDownloadId())
+ .eq(ZfShare::getShareContent, zfDownload.getDownloadContent())
+ .eq(ZfShare::getSysMenuId, zfDownload.getSysMenuId());
+ List<ZfShare> beanRecords = list(lqw);
+ if (beanRecords.size() != 0){
+ return beanRecords.get(0).getUserId();
+ }
+ else {
+ return null;
+ }
+ }
+
+
+
+}
diff --git a/zhang-content/src/main/java/com/ruoyi/service/impl/ZSelfNoteDownloadServiceImpl.java b/zhang-content/src/main/java/com/ruoyi/service/impl/ZSelfNoteDownloadServiceImpl.java
new file mode 100644
index 0000000..866f892
--- /dev/null
+++ b/zhang-content/src/main/java/com/ruoyi/service/impl/ZSelfNoteDownloadServiceImpl.java
@@ -0,0 +1,144 @@
+
+package com.ruoyi.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.EsModel;
+import com.ruoyi.common.utils.MapUtils;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.domain.ZSelfNote;
+import com.ruoyi.domain.ZInfoUser;
+import com.ruoyi.domain.ZfDownload;
+import com.ruoyi.mapper.ZfDownloadMapper;
+import com.ruoyi.service.*;
+import lombok.extern.slf4j.Slf4j;
+import org.elasticsearch.action.delete.DeleteRequest;
+import org.elasticsearch.client.RequestOptions;
+import org.elasticsearch.client.RestHighLevelClient;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.io.IOException;
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Slf4j
+@Service
+public class ZSelfNoteDownloadServiceImpl extends ServiceImpl<ZfDownloadMapper,ZfDownload> implements ZSelfNoteDownloadService {
+ @Resource
+ EsService esService;
+
+ @Resource
+ ZSelfNoteShareService zSelfNoteShareService;
+
+ @Resource
+ ZSelfNoteService zSelfNoteService;
+
+
+ @Resource
+ ZInfoUserService zInfoUserService;
+
+ @Resource
+ private RestHighLevelClient restHighLevelClient;
+
+ private LambdaQueryWrapper<ZfDownload> buildCondition(ZfDownload zfDownload, Long userId) {
+ LambdaQueryWrapper<ZfDownload> lqw = new LambdaQueryWrapper<>();
+ lqw.in(ZfDownload::getDownloadId,userId);
+ lqw.orderByDesc(ZfDownload::getDownloadId);
+ lqw.like(zfDownload.getDownloadId() != null, ZfDownload::getDownloadId, zfDownload.getDownloadId())
+ .like(zfDownload.getDownloadContent() != null, ZfDownload::getDownloadContent, zfDownload.getDownloadContent())
+ .eq( ZfDownload::getSysMenuId, zfDownload.getSysMenuId());
+ return lqw;
+ }
+ private LambdaQueryWrapper<ZfDownload> uniqueCondition(ZfDownload zfDownload) {
+ LambdaQueryWrapper<ZfDownload> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(StringUtils.isNotEmpty(String.valueOf(zfDownload.getDownloadId())), ZfDownload::getDownloadId, zfDownload.getDownloadId())
+ .eq(StringUtils.isNotEmpty(String.valueOf(zfDownload.getDownloadContent())), ZfDownload::getDownloadContent, zfDownload.getDownloadContent())
+ .eq(ZfDownload::getSysMenuId, zfDownload.getSysMenuId());
+ return lqw;
+ }
+
+ public Long getUserId() {
+ ZInfoUser myself = zInfoUserService.getMyself();
+ return myself.getUserId();
+ }
+ @Override
+ public AjaxResult addData(ZfDownload zfDownload) {
+ zfDownload.setDownloadId(getUserId());
+ LambdaQueryWrapper<ZfDownload> lqw = uniqueCondition(zfDownload);
+ List<ZfDownload> list = list(lqw);
+ if (list.size() > 0) {
+ throw new RuntimeException("璇峰嬁閲嶅涓嬭浇鏁版嵁");
+ }
+
+ zfDownload.setDownloadId(getUserId());
+ zfDownload.setShareId(zSelfNoteShareService.getShareId(zfDownload));
+ if (save(zfDownload)) {
+ EsModel esModel = new EsModel();
+ Integer inte = zfDownload.getId().intValue();
+ String uuid = UUID.randomUUID().toString().replace("-", "");
+ esModel.setId(uuid);
+ esModel.setCtId(Long.valueOf(inte));
+ esModel.setCtTableName("涓汉璁颁簨鏈�");
+
+ esModel.setBy1(String.valueOf(zfDownload.getDownloadId()));
+ esModel.setBy2(String.valueOf(zfDownload.getDownloadContent()));
+ esModel.setBy3(String.valueOf(zfDownload.getShareId()));
+ //杩欓噷瀛樺偍鏌ヨ璇︽儏鐨勮矾寰�
+ esService.insertTable(esModel);
+ return AjaxResult.success();
+ } else {
+ return AjaxResult.error();
+ }
+ }
+
+ @Override
+ public AjaxResult deleteData(Long[] ids) {
+ List<ZfDownload> zfDownloads = listByIds(Arrays.asList(ids));
+
+ if (zSelfNoteShareService.removeByIds(Arrays.asList(ids))) {
+
+ //鍒犻櫎es涓殑鏁版嵁
+ zfDownloads.stream().forEach(zfDoctorDownload -> {
+ EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "涓汉璁颁簨鏈笅杞�");
+
+ if (esModel != null) {
+ DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId());
+ try {
+ restHighLevelClient.delete(deleteRequest, RequestOptions.DEFAULT);
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ });
+ return AjaxResult.success();
+ } else {
+ return AjaxResult.error();
+ }
+ }
+
+ @Override
+ public AjaxResult selectDoctorList(ZfDownload zfDownload, Integer pageNo, Integer pageSize) {
+ ZInfoUser myself = zInfoUserService.getMyself();
+ LambdaQueryWrapper<ZfDownload> lqw = buildCondition(zfDownload,myself.getUserId());
+ List<ZfDownload> beanRecords = list(lqw);
+ List<ZSelfNote> bs = new ArrayList<>();
+ for (ZfDownload a: beanRecords) {
+ if (zSelfNoteService.getById(a.getDownloadContent()) != null) {
+ ZSelfNote ds = zSelfNoteService.getById(a.getDownloadContent());
+ ds.setShareId(a.getShareId().intValue());
+ bs.add(ds);
+ }
+ }
+ List<ZSelfNote> record = bs.stream().skip((pageNo-1)*pageSize).limit(pageSize).collect(Collectors.toList());
+
+ int totalPage = (bs.size() -1) / pageSize +1;
+
+ Page<ZSelfNote> zSelfNotePage = new Page<>(pageNo, pageSize,totalPage);
+ HashMap<String, Object> data = MapUtils.getShareResult(zSelfNotePage, record,bs.size());
+ return AjaxResult.success(data);
+ }
+
+}
diff --git a/zhang-content/src/main/java/com/ruoyi/service/impl/ZSelfNoteShareServiceImpl.java b/zhang-content/src/main/java/com/ruoyi/service/impl/ZSelfNoteShareServiceImpl.java
new file mode 100644
index 0000000..673e8ff
--- /dev/null
+++ b/zhang-content/src/main/java/com/ruoyi/service/impl/ZSelfNoteShareServiceImpl.java
@@ -0,0 +1,194 @@
+
+package com.ruoyi.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.SysUser;
+import com.ruoyi.common.utils.MapUtils;
+import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.domain.*;
+import com.ruoyi.mapper.ZfShareMapper;
+import com.ruoyi.service.ZSelfNoteService;
+import com.ruoyi.service.ZSelfNoteShareService;
+import com.ruoyi.service.ZInfoUserService;
+import com.ruoyi.service.ZSelfNoteShareService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.stream.Collectors;
+
+@Service
+public class ZSelfNoteShareServiceImpl extends ServiceImpl<ZfShareMapper,ZfShare> implements ZSelfNoteShareService {
+
+
+ @Resource
+ ZSelfNoteService zSelfNoteService;
+
+ @Resource
+ private ZInfoUserService zInfoUserService;
+
+ private LambdaQueryWrapper<ZfShare> uniqueCondition(ZfShare zfShare) {
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(StringUtils.isNotEmpty(String.valueOf(zfShare.getShareId())), ZfShare::getShareId, zfShare.getShareId());
+ lqw.eq(StringUtils.isNotEmpty(String.valueOf(zfShare.getShareContent())), ZfShare::getShareContent, zfShare.getShareContent());
+ lqw.eq(StringUtils.isNotEmpty(String.valueOf(zfShare.getSysMenuId())), ZfShare::getSysMenuId, zfShare.getSysMenuId());
+ return lqw;
+ }
+
+ @Override
+ public List<ZfShare> getAuthority() {
+ SysUser user = SecurityUtils.getLoginUser().getUser();
+ Long userId = user.getUserId();
+
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId,userId);
+
+ return list(lqw);
+ }
+
+ public Long getUserId(){
+ ZInfoUser myself = zInfoUserService.getMyself();
+ return myself.getUserId();
+
+ }
+
+ public void addData(ZfShare za)
+ {
+ LambdaQueryWrapper<ZfShare> lqw = uniqueCondition(za);
+ List<ZfShare> list = list(lqw);
+
+ if(list.size()>0){
+ throw new RuntimeException("璇峰嬁鍒嗕韩閲嶅鏁版嵁");
+ }
+ else {
+ save(za);
+ }
+
+ }
+
+ @Override
+ public AjaxResult saveZa(ShareMore shareMore) {
+ Long [] shareIds = shareMore.getShareIds();
+ Long [] shareContents = shareMore.getShareContents();
+ for (Long shareId : shareIds) {
+ for (Long shareContent : shareContents) {
+ ZfShare za = new ZfShare();
+ za.setUserId(getUserId());
+ za.setShareContent(shareContent);
+ za.setShareId(shareId);
+ za.setSysMenuId(2010L);
+ addData(za);
+ }
+ }
+ // Long []
+ // if(bl)
+ return AjaxResult.success("鍒嗕韩鎴愬姛!");
+ }
+
+ @Override
+ public AjaxResult listByFidAid(ShareMore shareMore, Integer pageNo, Integer pageSize) {
+ Long [] shareIds = shareMore.getShareIds();
+ List<ZSelfNote> beanRecord3 = new ArrayList<>();
+ for (Long shareId : shareIds) {
+ {
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId,shareId)
+ .eq(ZfShare::getSysMenuId,shareMore.getSysMenuId())
+ .eq(ZfShare::getUserId, getUserId());
+ List<ZfShare> beanRecords = list(lqw);
+ for (ZfShare beanRecord : beanRecords ) {
+ beanRecord3.add(zSelfNoteService.getById(beanRecord.getShareContent()));
+ }
+ }
+ }
+ List<ZSelfNote> record = beanRecord3.stream().skip((pageNo-1)*pageSize).limit(pageSize).collect(Collectors.toList());
+
+ int totalPage = (beanRecord3.size() -1) / pageSize +1;
+
+ Page<ZSelfNote> zSelfNotePage = new Page<>(pageNo, pageSize,totalPage);
+ HashMap<String, Object> data = MapUtils.getShareResult(zSelfNotePage, record,beanRecord3.size());
+
+ return AjaxResult.success(data);
+ }
+
+ @Override
+ public AjaxResult deleteZa(ShareMore shareMore) {
+ Long [] shareIds = shareMore.getShareIds();
+ Long [] shareContents = shareMore.getShareContents();
+ for(Long shareId : shareIds)
+ for(Long shareContent: shareContents)
+ {
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId,shareId)
+ .eq(ZfShare::getShareContent, shareContent)
+ .eq(ZfShare::getSysMenuId, shareMore.getSysMenuId())
+ .eq(ZfShare::getUserId, getUserId());
+
+ remove(lqw);
+ // addData(za);
+ }
+ return AjaxResult.success("鏁版嵁鏀跺洖鎴愬姛!");
+ }
+
+ @Override
+ public AjaxResult listByUserId() {
+ HashMap<Long,List<ZSelfNote>> bs = new HashMap<>();
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId,getUserId());
+ lqw.eq(ZfShare::getSysMenuId,2010L);
+ List<ZfShare> beanRecords = list(lqw);
+ List<ZSelfNote> b1 = new ArrayList<>();
+ for (ZfShare beanRecord : beanRecords ) {
+ b1.add(zSelfNoteService.getById(beanRecord.getShareContent()));
+ bs.put(beanRecord.getUserId(),b1);
+ }
+// log.info("浠庢暟鎹簱涓煡鍒扮殑涓�:{}", bs);
+ return AjaxResult.success(bs);
+ }
+
+ @Override
+ public AjaxResult listUserId(Integer pageNo, Integer pageSize) {
+ List<ZSelfNote> bs = new ArrayList<>();
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId,getUserId());
+ lqw.eq(ZfShare::getSysMenuId,2010L);
+ List<ZfShare> beanRecords = list(lqw);
+ for (ZfShare beanRecord : beanRecords ) {
+ ZSelfNote bs2 = zSelfNoteService.getById(beanRecord.getShareContent());
+ bs2.setShareId(beanRecord.getUserId().intValue());
+ bs.add(bs2);
+ }
+// log.info("浠庢暟鎹簱涓煡鍒扮殑涓�:{}", bs);
+ List<ZSelfNote> record = bs.stream().skip((pageNo-1)*pageSize).limit(pageSize).collect(Collectors.toList());
+
+ int totalPage = (bs.size() -1) / pageSize +1;
+
+ Page<ZSelfNote> zSelfNotePage = new Page<>(pageNo, pageSize,totalPage);
+ HashMap<String, Object> data = MapUtils.getShareResult(zSelfNotePage, record,bs.size());
+ return AjaxResult.success(data);
+ }
+
+ @Override
+ public Long getShareId(ZfDownload zfDownload) {
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId, zfDownload.getDownloadId())
+ .eq(ZfShare::getShareContent, zfDownload.getDownloadContent())
+ .eq(ZfShare::getSysMenuId, zfDownload.getSysMenuId());
+ List<ZfShare> beanRecords = list(lqw);
+ if (beanRecords.size() != 0){
+ return beanRecords.get(0).getUserId();
+ }
+ else {
+ return null;
+ }
+ }
+
+
+
+}
diff --git a/zhang-content/src/main/java/com/ruoyi/service/impl/ZfEquipDownloadServiceImpl.java b/zhang-content/src/main/java/com/ruoyi/service/impl/ZfEquipDownloadServiceImpl.java
index 7953ce3..1d08847 100644
--- a/zhang-content/src/main/java/com/ruoyi/service/impl/ZfEquipDownloadServiceImpl.java
+++ b/zhang-content/src/main/java/com/ruoyi/service/impl/ZfEquipDownloadServiceImpl.java
@@ -32,7 +32,7 @@
EsService esService;
@Resource
- ZfEquipShareServiceImpl zfEquipShareService;
+ ZfEquipShareService zfEquipShareService;
@Resource
ZfEquipmentService zfEquipmentService;
diff --git a/zhang-content/src/main/java/com/ruoyi/service/impl/ZfRelationDownloadServiceImpl.java b/zhang-content/src/main/java/com/ruoyi/service/impl/ZfRelationDownloadServiceImpl.java
new file mode 100644
index 0000000..f8f9200
--- /dev/null
+++ b/zhang-content/src/main/java/com/ruoyi/service/impl/ZfRelationDownloadServiceImpl.java
@@ -0,0 +1,144 @@
+
+package com.ruoyi.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.EsModel;
+import com.ruoyi.common.utils.MapUtils;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.domain.ZfRelation;
+import com.ruoyi.domain.ZInfoUser;
+import com.ruoyi.domain.ZfDownload;
+import com.ruoyi.mapper.ZfDownloadMapper;
+import com.ruoyi.service.*;
+import lombok.extern.slf4j.Slf4j;
+import org.elasticsearch.action.delete.DeleteRequest;
+import org.elasticsearch.client.RequestOptions;
+import org.elasticsearch.client.RestHighLevelClient;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.io.IOException;
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Slf4j
+@Service
+public class ZfRelationDownloadServiceImpl extends ServiceImpl<ZfDownloadMapper,ZfDownload> implements ZfRelationDownloadService {
+ @Resource
+ EsService esService;
+
+ @Resource
+ ZfRelationShareService zfRelationShareService;
+
+ @Resource
+ ZfRelationService zfRelationService;
+
+
+ @Resource
+ ZInfoUserService zInfoUserService;
+
+ @Resource
+ private RestHighLevelClient restHighLevelClient;
+
+ private LambdaQueryWrapper<ZfDownload> buildCondition(ZfDownload zfDownload, Long userId) {
+ LambdaQueryWrapper<ZfDownload> lqw = new LambdaQueryWrapper<>();
+ lqw.in(ZfDownload::getDownloadId,userId);
+ lqw.orderByDesc(ZfDownload::getDownloadId);
+ lqw.like(zfDownload.getDownloadId() != null, ZfDownload::getDownloadId, zfDownload.getDownloadId())
+ .like(zfDownload.getDownloadContent() != null, ZfDownload::getDownloadContent, zfDownload.getDownloadContent())
+ .eq( ZfDownload::getSysMenuId, zfDownload.getSysMenuId());
+ return lqw;
+ }
+ private LambdaQueryWrapper<ZfDownload> uniqueCondition(ZfDownload zfDownload) {
+ LambdaQueryWrapper<ZfDownload> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(StringUtils.isNotEmpty(String.valueOf(zfDownload.getDownloadId())), ZfDownload::getDownloadId, zfDownload.getDownloadId())
+ .eq(StringUtils.isNotEmpty(String.valueOf(zfDownload.getDownloadContent())), ZfDownload::getDownloadContent, zfDownload.getDownloadContent())
+ .eq(ZfDownload::getSysMenuId, zfDownload.getSysMenuId());
+ return lqw;
+ }
+
+ public Long getUserId() {
+ ZInfoUser myself = zInfoUserService.getMyself();
+ return myself.getUserId();
+ }
+ @Override
+ public AjaxResult addData(ZfDownload zfDownload) {
+ zfDownload.setDownloadId(getUserId());
+ LambdaQueryWrapper<ZfDownload> lqw = uniqueCondition(zfDownload);
+ List<ZfDownload> list = list(lqw);
+ if (list.size() > 0) {
+ throw new RuntimeException("璇峰嬁閲嶅涓嬭浇鏁版嵁");
+ }
+
+ zfDownload.setDownloadId(getUserId());
+ zfDownload.setShareId(zfRelationShareService.getShareId(zfDownload));
+ if (save(zfDownload)) {
+ EsModel esModel = new EsModel();
+ Integer inte = zfDownload.getId().intValue();
+ String uuid = UUID.randomUUID().toString().replace("-", "");
+ esModel.setId(uuid);
+ esModel.setCtId(Long.valueOf(inte));
+ esModel.setCtTableName("瀹跺涵鐨勪富瑕佹垚鍛樺強绀句細鍏崇郴鎯呭喌");
+
+ esModel.setBy1(String.valueOf(zfDownload.getDownloadId()));
+ esModel.setBy2(String.valueOf(zfDownload.getDownloadContent()));
+ esModel.setBy3(String.valueOf(zfDownload.getShareId()));
+ //杩欓噷瀛樺偍鏌ヨ璇︽儏鐨勮矾寰�
+ esService.insertTable(esModel);
+ return AjaxResult.success();
+ } else {
+ return AjaxResult.error();
+ }
+ }
+
+ @Override
+ public AjaxResult deleteData(Long[] ids) {
+ List<ZfDownload> zfDownloads = listByIds(Arrays.asList(ids));
+
+ if (zfRelationShareService.removeByIds(Arrays.asList(ids))) {
+
+ //鍒犻櫎es涓殑鏁版嵁
+ zfDownloads.stream().forEach(zfDoctorDownload -> {
+ EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "瀹跺涵鎴愬憳鍏崇郴鍙婄ぞ浼氬叧绯绘儏鍐典笅杞�");
+
+ if (esModel != null) {
+ DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId());
+ try {
+ restHighLevelClient.delete(deleteRequest, RequestOptions.DEFAULT);
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ });
+ return AjaxResult.success();
+ } else {
+ return AjaxResult.error();
+ }
+ }
+
+ @Override
+ public AjaxResult selectDoctorList(ZfDownload zfDownload, Integer pageNo, Integer pageSize) {
+ ZInfoUser myself = zInfoUserService.getMyself();
+ LambdaQueryWrapper<ZfDownload> lqw = buildCondition(zfDownload,myself.getUserId());
+ List<ZfDownload> beanRecords = list(lqw);
+ List<ZfRelation> bs = new ArrayList<>();
+ for (ZfDownload a: beanRecords) {
+ if (zfRelationService.getById(a.getDownloadContent()) != null) {
+ ZfRelation ds = zfRelationService.getById(a.getDownloadContent());
+ ds.setShareId(a.getShareId().intValue());
+ bs.add(ds);
+ }
+ }
+ List<ZfRelation> record = bs.stream().skip((pageNo-1)*pageSize).limit(pageSize).collect(Collectors.toList());
+
+ int totalPage = (bs.size() -1) / pageSize +1;
+
+ Page<ZfRelation> zfRelationPage = new Page<>(pageNo, pageSize,totalPage);
+ HashMap<String, Object> data = MapUtils.getShareResult(zfRelationPage, record,bs.size());
+ return AjaxResult.success(data);
+ }
+
+}
diff --git a/zhang-content/src/main/java/com/ruoyi/service/impl/ZfRelationShareServiceImpl.java b/zhang-content/src/main/java/com/ruoyi/service/impl/ZfRelationShareServiceImpl.java
new file mode 100644
index 0000000..d94a02c
--- /dev/null
+++ b/zhang-content/src/main/java/com/ruoyi/service/impl/ZfRelationShareServiceImpl.java
@@ -0,0 +1,193 @@
+
+package com.ruoyi.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.SysUser;
+import com.ruoyi.common.utils.MapUtils;
+import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.domain.*;
+import com.ruoyi.mapper.ZfShareMapper;
+import com.ruoyi.service.ZfRelationService;
+import com.ruoyi.service.ZfRelationShareService;
+import com.ruoyi.service.ZInfoUserService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.stream.Collectors;
+
+@Service
+public class ZfRelationShareServiceImpl extends ServiceImpl<ZfShareMapper,ZfShare> implements ZfRelationShareService {
+
+
+ @Resource
+ ZfRelationService zfRelationService;
+
+ @Resource
+ private ZInfoUserService zInfoUserService;
+
+ private LambdaQueryWrapper<ZfShare> uniqueCondition(ZfShare zfShare) {
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(StringUtils.isNotEmpty(String.valueOf(zfShare.getShareId())), ZfShare::getShareId, zfShare.getShareId());
+ lqw.eq(StringUtils.isNotEmpty(String.valueOf(zfShare.getShareContent())), ZfShare::getShareContent, zfShare.getShareContent());
+ lqw.eq(StringUtils.isNotEmpty(String.valueOf(zfShare.getSysMenuId())), ZfShare::getSysMenuId, zfShare.getSysMenuId());
+ return lqw;
+ }
+
+ @Override
+ public List<ZfShare> getAuthority() {
+ SysUser user = SecurityUtils.getLoginUser().getUser();
+ Long userId = user.getUserId();
+
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId,userId);
+
+ return list(lqw);
+ }
+
+ public Long getUserId(){
+ ZInfoUser myself = zInfoUserService.getMyself();
+ return myself.getUserId();
+
+ }
+
+ public void addData(ZfShare za)
+ {
+ LambdaQueryWrapper<ZfShare> lqw = uniqueCondition(za);
+ List<ZfShare> list = list(lqw);
+
+ if(list.size()>0){
+ throw new RuntimeException("璇峰嬁鍒嗕韩閲嶅鏁版嵁");
+ }
+ else {
+ save(za);
+ }
+
+ }
+
+ @Override
+ public AjaxResult saveZa(ShareMore shareMore) {
+ Long [] shareIds = shareMore.getShareIds();
+ Long [] shareContents = shareMore.getShareContents();
+ for (Long shareId : shareIds) {
+ for (Long shareContent : shareContents) {
+ ZfShare za = new ZfShare();
+ za.setUserId(getUserId());
+ za.setShareContent(shareContent);
+ za.setShareId(shareId);
+ za.setSysMenuId(20103L);
+ addData(za);
+ }
+ }
+ // Long []
+ // if(bl)
+ return AjaxResult.success("鍒嗕韩鎴愬姛!");
+ }
+
+ @Override
+ public AjaxResult listByFidAid(ShareMore shareMore, Integer pageNo, Integer pageSize) {
+ Long [] shareIds = shareMore.getShareIds();
+ List<ZfRelation> beanRecord3 = new ArrayList<>();
+ for (Long shareId : shareIds) {
+ {
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId,shareId)
+ .eq(ZfShare::getSysMenuId,shareMore.getSysMenuId())
+ .eq(ZfShare::getUserId, getUserId());
+ List<ZfShare> beanRecords = list(lqw);
+ for (ZfShare beanRecord : beanRecords ) {
+ beanRecord3.add(zfRelationService.getById(beanRecord.getShareContent()));
+ }
+ }
+ }
+ List<ZfRelation> record = beanRecord3.stream().skip((pageNo-1)*pageSize).limit(pageSize).collect(Collectors.toList());
+
+ int totalPage = (beanRecord3.size() -1) / pageSize +1;
+
+ Page<ZfRelation> zfRelationPage = new Page<>(pageNo, pageSize,totalPage);
+ HashMap<String, Object> data = MapUtils.getShareResult(zfRelationPage, record,beanRecord3.size());
+
+ return AjaxResult.success(data);
+ }
+
+ @Override
+ public AjaxResult deleteZa(ShareMore shareMore) {
+ Long [] shareIds = shareMore.getShareIds();
+ Long [] shareContents = shareMore.getShareContents();
+ for(Long shareId : shareIds)
+ for(Long shareContent: shareContents)
+ {
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId,shareId)
+ .eq(ZfShare::getShareContent, shareContent)
+ .eq(ZfShare::getSysMenuId, shareMore.getSysMenuId())
+ .eq(ZfShare::getUserId, getUserId());
+
+ remove(lqw);
+ // addData(za);
+ }
+ return AjaxResult.success("鏁版嵁鏀跺洖鎴愬姛!");
+ }
+
+ @Override
+ public AjaxResult listByUserId() {
+ HashMap<Long,List<ZfRelation>> bs = new HashMap<>();
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId,getUserId());
+ lqw.eq(ZfShare::getSysMenuId,20103L);
+ List<ZfShare> beanRecords = list(lqw);
+ List<ZfRelation> b1 = new ArrayList<>();
+ for (ZfShare beanRecord : beanRecords ) {
+ b1.add(zfRelationService.getById(beanRecord.getShareContent()));
+ bs.put(beanRecord.getUserId(),b1);
+ }
+// log.info("浠庢暟鎹簱涓煡鍒扮殑涓�:{}", bs);
+ return AjaxResult.success(bs);
+ }
+
+ @Override
+ public AjaxResult listUserId(Integer pageNo, Integer pageSize) {
+ List<ZfRelation> bs = new ArrayList<>();
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId,getUserId());
+ lqw.eq(ZfShare::getSysMenuId,20103L);
+ List<ZfShare> beanRecords = list(lqw);
+ for (ZfShare beanRecord : beanRecords ) {
+ ZfRelation bs2 = zfRelationService.getById(beanRecord.getShareContent());
+ bs2.setShareId(beanRecord.getUserId().intValue());
+ bs.add(bs2);
+ }
+// log.info("浠庢暟鎹簱涓煡鍒扮殑涓�:{}", bs);
+ List<ZfRelation> record = bs.stream().skip((pageNo-1)*pageSize).limit(pageSize).collect(Collectors.toList());
+
+ int totalPage = (bs.size() -1) / pageSize +1;
+
+ Page<ZfRelation> zfRelationPage = new Page<>(pageNo, pageSize,totalPage);
+ HashMap<String, Object> data = MapUtils.getShareResult(zfRelationPage, record,bs.size());
+ return AjaxResult.success(data);
+ }
+
+ @Override
+ public Long getShareId(ZfDownload zfDownload) {
+ LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ZfShare::getShareId, zfDownload.getDownloadId())
+ .eq(ZfShare::getShareContent, zfDownload.getDownloadContent())
+ .eq(ZfShare::getSysMenuId, zfDownload.getSysMenuId());
+ List<ZfShare> beanRecords = list(lqw);
+ if (beanRecords.size() != 0){
+ return beanRecords.get(0).getUserId();
+ }
+ else {
+ return null;
+ }
+ }
+
+
+
+}
--
Gitblit v1.9.1