zqy
2024-10-22 ca054d1db9256bc8d367486b0d78e89cd4fd7fdb
删除时会连着分享和下载的数据一起删掉
83个文件已修改
1729 ■■■■ 已修改文件
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/TravelCountController.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/TravelDetailController.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZHonorController.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZIdeaController.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZPropertyController.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZSecretController.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZSelfNoteController.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZSelfNoteShareController.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZfEventShareController.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/IZfPropertyDownloadService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/IZfPropertyShareService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/TravelCountDownlService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/TravelCountSharService.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/TravelDetailDownlService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/TravelDetailSharService.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/ZHonorDownloadService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/ZHonorShareService.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/ZIdeaDownloadService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/ZIdeaShareService.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/ZPropertyDownloadService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/ZPropertyShareService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/ZSecretDownloadService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/ZSecretShareService.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/ZSelfNoteDownloadService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/ZSelfNoteShareService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/ZfCleanDownloadService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/ZfCleanShareService.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/ZfCollectionDownloadService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/ZfCollectionShareService.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/ZfContactDownlService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/ZfContactShraService.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/ZfDoctorDownloadService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/ZfDoctorShareService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/ZfEconomyDownlService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/ZfEconomyShaService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/ZfEquipDownloadService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/ZfEquipShareService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/ZfEventDownloadService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/ZfEventShareService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/ZfPetDownlService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/ZfPetSharService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/impl/IZfPropertyDownloadServiceImpl.java 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/impl/IZfPropertyServiceImpl.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/impl/IZfPropertyShareServiceImpl.java 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/impl/TravelCountDownServiceImpl.java 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/impl/TravelCountSharServiceImpl.java 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/impl/TravelDetailDownServiceImpl.java 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/impl/TravelDetailServiceImpl.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/impl/TravelDetailSharServiceImpl.java 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/impl/ZHonorDownloadServiceImpl.java 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/impl/ZHonorShareServiceImpl.java 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/impl/ZIdeaDownloadServiceImpl.java 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/impl/ZIdeaShareServiceImpl.java 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/impl/ZPropertyDownloadServiceImpl.java 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/impl/ZPropertyShareServiceImpl.java 130 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/impl/ZSecretDownloadServiceImpl.java 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/impl/ZSecretShareServiceImpl.java 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/impl/ZSelfNoteDownloadServiceImpl.java 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/impl/ZSelfNoteShareServiceImpl.java 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/impl/ZfCleanDownloadServiceImpl.java 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/impl/ZfCleanServiceImpl.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/impl/ZfCleanShareServiceImpl.java 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/impl/ZfCollectionDownlServiceImpl.java 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/impl/ZfCollectionServiceImpl.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/impl/ZfCollectionShaServiceImpl.java 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/impl/ZfContactDownlServiceImpl.java 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/impl/ZfContactServiceImpl.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/impl/ZfContactShraServiceImpl.java 129 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/impl/ZfDoctorDownloadServiceImpl.java 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/impl/ZfDoctorServiceImpl.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/impl/ZfDoctorShareServiceImpl.java 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/impl/ZfEconomyDownlServiceImpl.java 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/impl/ZfEconomyServiceImpl.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/impl/ZfEconomySharServiceImpl.java 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/impl/ZfEquipDownloadServiceImpl.java 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/impl/ZfEquipShareServiceImpl.java 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/impl/ZfEquipmentServiceImpl.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/impl/ZfEventDownloadServiceImpl.java 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/impl/ZfEventServiceImpl.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/impl/ZfEventShareServiceImpl.java 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/impl/ZfPetDownServiceImpl.java 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/impl/ZfPetServiceImpl.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/impl/ZfPetSharServiceImpl.java 127 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/TravelCountController.java
@@ -12,7 +12,10 @@
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.domain.TravelCount;
import com.ruoyi.service.TravelCountDownlService;
import com.ruoyi.service.TravelCountService;
import com.ruoyi.service.TravelCountSharService;
import com.ruoyi.service.TravelDetailSharService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@@ -41,6 +44,12 @@
    @Autowired
    private TravelCountService travelCountService;
    @Autowired
    private TravelCountDownlService  travelCountDownlService;
    @Autowired
    private TravelCountSharService travelCountSharService;
    @GetMapping("/all")
    public AjaxResult listAll(TravelCount travelCount, String happenStartTime, String happenEndTime) throws ParseException {
@@ -134,6 +143,9 @@
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        if (! (travelCountDownlService.deleteData(ids) && travelCountSharService.deleteByContentId(ids)  ) ){
            return AjaxResult.error();
        }
        travelCountService.removeData(Arrays.asList(ids));
        return AjaxResult.success();
    }
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/TravelDetailController.java
@@ -3,6 +3,8 @@
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.domain.TravelDetail;
import com.ruoyi.service.TravelCountSharService;
import com.ruoyi.service.TravelDetailDownlService;
import com.ruoyi.service.TravelDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -25,6 +27,12 @@
    @Autowired
    TravelDetailService travelDetailService;
    @Autowired
    TravelDetailDownlService travelDetailDownlService;
    @Autowired
    TravelCountSharService travelCountSharService;
    @GetMapping("/{cid}")
     public AjaxResult getDataByCid(@PathVariable("cid") Long cid,TravelDetail travelDetail){
@@ -55,6 +63,9 @@
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        if (! (travelDetailDownlService.deleteData(ids) && travelCountSharService.deleteByContentId(ids)  ) ){
            return AjaxResult.error();
        }
        travelDetailService.removeByIds(Arrays.asList(ids));
        return AjaxResult.success();
    }
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZHonorController.java
@@ -11,7 +11,9 @@
import com.ruoyi.common.utils.ServletUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.domain.ZHonor;
import com.ruoyi.service.ZHonorDownloadService;
import com.ruoyi.service.ZHonorService;
import com.ruoyi.service.ZHonorShareService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -39,6 +41,12 @@
public class ZHonorController extends BaseController {
    @Autowired
    private ZHonorService zHonorService;
    @Autowired
    private ZHonorDownloadService zHonorDownloadService;
    @Autowired
    private ZHonorShareService zHonorShareService;
    /**
     * 查询所有记录
@@ -128,6 +136,9 @@
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        if (! (zHonorDownloadService.deleteData(ids) && zHonorShareService.deleteByContentId(ids)  ) ){
            return AjaxResult.error();
        }
        return toAjax(zHonorService.removeByIds(Arrays.asList(ids)));
    }
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZIdeaController.java
@@ -9,7 +9,10 @@
import com.ruoyi.common.utils.ServletUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.domain.ZIdea;
import com.ruoyi.service.ZIdeaDownloadService;
import com.ruoyi.service.ZIdeaService;
import com.ruoyi.service.ZIdeaShareService;
import com.ruoyi.service.ZPropertyDownloadService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -38,6 +41,13 @@
    @Autowired
    private ZIdeaService zIdeaService;
    @Autowired
    private ZIdeaDownloadService zIdeaDownloadService;
    @Autowired
    private ZIdeaShareService zIdeaShareService;
    /**
     * 查询所有记录
@@ -132,6 +142,10 @@
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        if (! (zIdeaDownloadService.deleteData(ids) && zIdeaShareService.deleteByContentId(ids)  ) ){
            return AjaxResult.error();
        }
        return toAjax(zIdeaService.removeByIds(Arrays.asList(ids)));
    }
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZPropertyController.java
@@ -10,7 +10,9 @@
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.domain.ZProperty;
import com.ruoyi.domain.ZfEconomy;
import com.ruoyi.service.ZPropertyDownloadService;
import com.ruoyi.service.ZPropertyService;
import com.ruoyi.service.ZPropertyShareService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -38,6 +40,12 @@
public class ZPropertyController extends BaseController {
    @Autowired
    private ZPropertyService zPropertyService;
    @Autowired
    private ZPropertyDownloadService zPropertyDownloadService;
    @Autowired
    private ZPropertyShareService zPropertyShareService;
    /**
     * 查询所有记录
@@ -137,6 +145,9 @@
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        if (! (zPropertyDownloadService.deleteData(ids) && zPropertyShareService.deleteByContentId(ids)  ) ){
            return AjaxResult.error();
        }
        return toAjax(zPropertyService.removeByIds(Arrays.asList(ids)));
    }
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZSecretController.java
@@ -9,7 +9,9 @@
import com.ruoyi.common.utils.ServletUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.domain.ZSecret;
import com.ruoyi.service.ZSecretDownloadService;
import com.ruoyi.service.ZSecretService;
import com.ruoyi.service.ZSecretShareService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -37,6 +39,12 @@
public class ZSecretController extends BaseController {
    @Autowired
    private ZSecretService zSecretService;
    @Autowired
    private ZSecretShareService zSecretShareService;
    @Autowired
    private ZSecretDownloadService zSecretDownloadService;
    /**
     * 查询所有记录
@@ -136,6 +144,9 @@
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        if (! (zSecretDownloadService.deleteData(ids) && zSecretShareService.deleteByContentId(ids)  ) ){
            return AjaxResult.error();
        }
        return toAjax(zSecretService.removeByIds(Arrays.asList(ids)));
    }
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZSelfNoteController.java
@@ -9,12 +9,15 @@
import com.ruoyi.common.utils.ServletUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.domain.ZSelfNote;
import com.ruoyi.service.ZSelfNoteDownloadService;
import com.ruoyi.service.ZSelfNoteService;
import com.ruoyi.service.ZSelfNoteShareService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.websocket.server.PathParam;
import java.util.Arrays;
@@ -38,6 +41,13 @@
public class ZSelfNoteController extends BaseController {
    @Autowired
    private ZSelfNoteService zSelfNoteService;
    @Autowired
    private ZSelfNoteShareService zSelfNoteShareService;
    @Autowired
    private ZSelfNoteDownloadService zSelfNoteDownloadService;
    /**
     * 查询所有记录
@@ -132,6 +142,9 @@
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        if (! (zSelfNoteDownloadService.deleteData(ids) && zSelfNoteShareService.deleteByContentId(ids)  ) ){
            return AjaxResult.error();
        }
        return toAjax(zSelfNoteService.removeByIds(Arrays.asList(ids)));
    }
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZSelfNoteShareController.java
@@ -26,7 +26,7 @@
    @PostMapping("/share")
    public AjaxResult share(@RequestBody ShareMore zfDoctor){
        zfDoctor.setSysMenuId(2062L);
        zfDoctor.setSysMenuId(2010L);
        return zSelfNoteShareService.saveZa(zfDoctor);
    }
@@ -35,7 +35,7 @@
     */
    @PostMapping("/getInfoByUserId")
    public AjaxResult empowerGetInfo(@RequestBody ShareMore zfDoctor){
        zfDoctor.setSysMenuId(2062L);
        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) ;
@@ -55,7 +55,7 @@
     */
    @PostMapping("/deleteInfoByUserId")
    public AjaxResult deleteEmpower(@RequestBody ShareMore zfDoctor){
        zfDoctor.setSysMenuId(2062L);
        zfDoctor.setSysMenuId(2010L);
        return zSelfNoteShareService.deleteZa(zfDoctor);
    }
@@ -64,7 +64,7 @@
     */
    @PostMapping("/downloadDate")
    public AjaxResult ifDownLoad(@RequestBody ZfDownload zfDownload){
        zfDownload.setSysMenuId(2062L);
        zfDownload.setSysMenuId(2010L);
        return zSelfNoteDownloadService.addData(zfDownload);
    }
@@ -73,7 +73,7 @@
     */
    @GetMapping("/all")
    public AjaxResult data(ZfDownload zfDownload){
        zfDownload.setSysMenuId(2062L);
        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);
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZfEventShareController.java
@@ -1,8 +1,10 @@
package com.ruoyi.web.controller.zhang;
import com.ruoyi.common.annotation.Log;
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.enums.BusinessType;
import com.ruoyi.common.utils.ServletUtils;
import com.ruoyi.domain.ShareMore;
import com.ruoyi.domain.ZfDownload;
zhang-content/src/main/java/com/ruoyi/service/IZfPropertyDownloadService.java
@@ -7,7 +7,7 @@
public interface IZfPropertyDownloadService extends IService<ZfDownload> {
    AjaxResult addData(ZfDownload zfDownload);
    AjaxResult deleteData(Long[] ids);
    Boolean deleteData(Long[] ids);
    AjaxResult selectDoctorList(ZfDownload zfDownload, Integer pageNo , Integer pageSize);
}
zhang-content/src/main/java/com/ruoyi/service/IZfPropertyShareService.java
@@ -22,4 +22,6 @@
    AjaxResult listUserId(Integer pageNo ,Integer pageSize);
    Long getShareId(ZfDownload zfDownload);
    Boolean deleteByContentId(Long[] ids);
}
zhang-content/src/main/java/com/ruoyi/service/TravelCountDownlService.java
@@ -9,7 +9,7 @@
public interface TravelCountDownlService extends IService<ZfDownload> {
    AjaxResult addData(ZfDownload zfDownload);
    AjaxResult deleteData(Long[] ids);
    Boolean deleteData(Long[] ids);
    AjaxResult selectDoctorList(ZfDownload zfDownload, Integer pageNo , Integer pageSize);
zhang-content/src/main/java/com/ruoyi/service/TravelCountSharService.java
@@ -26,4 +26,7 @@
    Long getShareId(ZfDownload zfDownload);
    Boolean deleteByContentId(Long[] ids);
}
zhang-content/src/main/java/com/ruoyi/service/TravelDetailDownlService.java
@@ -8,7 +8,7 @@
public interface TravelDetailDownlService extends IService<ZfDownload> {
    AjaxResult addData(ZfDownload zfDownload);
    AjaxResult deleteData(Long[] ids);
    Boolean deleteData(Long[] ids);
    AjaxResult selectDoctorList(ZfDownload zfDownload, Integer pageNo , Integer pageSize);
zhang-content/src/main/java/com/ruoyi/service/TravelDetailSharService.java
@@ -24,4 +24,7 @@
    Long getShareId(ZfDownload zfDownload);
    Boolean deleteByContentId(Long[] ids);
}
zhang-content/src/main/java/com/ruoyi/service/ZHonorDownloadService.java
@@ -7,7 +7,7 @@
public interface ZHonorDownloadService extends IService<ZfDownload> {
    AjaxResult addData(ZfDownload zfDownload);
    AjaxResult deleteData(Long[] ids);
    Boolean deleteData(Long[] ids);
    AjaxResult selectDoctorList(ZfDownload zfDownload, Integer pageNo , Integer pageSize);
}
zhang-content/src/main/java/com/ruoyi/service/ZHonorShareService.java
@@ -22,4 +22,7 @@
    AjaxResult listUserId(Integer pageNo ,Integer pageSize);
    Long getShareId(ZfDownload zfDownload);
    Boolean deleteByContentId(Long[] ids);
}
zhang-content/src/main/java/com/ruoyi/service/ZIdeaDownloadService.java
@@ -7,7 +7,7 @@
public interface ZIdeaDownloadService extends IService<ZfDownload> {
    AjaxResult addData(ZfDownload zfDownload);
    AjaxResult deleteData(Long[] ids);
    Boolean deleteData(Long[] ids);
    AjaxResult selectDoctorList(ZfDownload zfDownload, Integer pageNo , Integer pageSize);
}
zhang-content/src/main/java/com/ruoyi/service/ZIdeaShareService.java
@@ -25,4 +25,7 @@
    AjaxResult selectShareUserInfo(Integer user_id, Long menuId);
    Boolean deleteByContentId(Long[] ids);
}
zhang-content/src/main/java/com/ruoyi/service/ZPropertyDownloadService.java
@@ -7,7 +7,7 @@
public interface ZPropertyDownloadService extends IService<ZfDownload> {
    AjaxResult addData(ZfDownload zfDownload);
    AjaxResult deleteData(Long[] ids);
    Boolean deleteData(Long[] ids);
    AjaxResult selectDoctorList(ZfDownload zfDownload, Integer pageNo , Integer pageSize);
}
zhang-content/src/main/java/com/ruoyi/service/ZPropertyShareService.java
@@ -22,4 +22,6 @@
    AjaxResult listUserId(Integer pageNo ,Integer pageSize);
    Long getShareId(ZfDownload zfDownload);
    Boolean deleteByContentId(Long[] ids);
}
zhang-content/src/main/java/com/ruoyi/service/ZSecretDownloadService.java
@@ -7,7 +7,7 @@
public interface ZSecretDownloadService extends IService<ZfDownload> {
    AjaxResult addData(ZfDownload zfDownload);
    AjaxResult deleteData(Long[] ids);
    Boolean deleteData(Long[] ids);
    AjaxResult selectDoctorList(ZfDownload zfDownload, Integer pageNo , Integer pageSize);
}
zhang-content/src/main/java/com/ruoyi/service/ZSecretShareService.java
@@ -22,4 +22,7 @@
    AjaxResult listUserId(Integer pageNo ,Integer pageSize);
    Long getShareId(ZfDownload zfDownload);
    Boolean deleteByContentId(Long[] ids);
}
zhang-content/src/main/java/com/ruoyi/service/ZSelfNoteDownloadService.java
@@ -7,7 +7,7 @@
public interface ZSelfNoteDownloadService extends IService<ZfDownload> {
    AjaxResult addData(ZfDownload zfDownload);
    AjaxResult deleteData(Long[] ids);
    Boolean deleteData(Long[] ids);
    AjaxResult selectDoctorList(ZfDownload zfDownload, Integer pageNo , Integer pageSize);
}
zhang-content/src/main/java/com/ruoyi/service/ZSelfNoteShareService.java
@@ -22,4 +22,6 @@
    AjaxResult listUserId(Integer pageNo ,Integer pageSize);
    Long getShareId(ZfDownload zfDownload);
    Boolean deleteByContentId(Long[] ids);
}
zhang-content/src/main/java/com/ruoyi/service/ZfCleanDownloadService.java
@@ -8,7 +8,7 @@
public interface ZfCleanDownloadService extends IService<ZfDownload> {
    AjaxResult addData(ZfDownload zfDownload);
    AjaxResult deleteData(Long[] ids);
    Boolean deleteData(Long[] ids);
    AjaxResult selectDoctorList(ZfDownload zfDownload, Integer pageNo , Integer pageSize);
zhang-content/src/main/java/com/ruoyi/service/ZfCleanShareService.java
@@ -26,4 +26,5 @@
    Long getShareId(ZfDownload zfDownload);
    Boolean deleteByContentId(Long[] ids);
}
zhang-content/src/main/java/com/ruoyi/service/ZfCollectionDownloadService.java
@@ -8,7 +8,7 @@
public interface ZfCollectionDownloadService extends IService<ZfDownload> {
    AjaxResult addData(ZfDownload zfDownload);
    AjaxResult deleteData(Long[] ids);
    Boolean deleteData(Long[] ids);
    AjaxResult selectDoctorList(ZfDownload zfDownload, Integer pageNo , Integer pageSize);
zhang-content/src/main/java/com/ruoyi/service/ZfCollectionShareService.java
@@ -26,4 +26,5 @@
    Long getShareId(ZfDownload zfDownload);
    Boolean deleteByContentId(Long[] ids);
}
zhang-content/src/main/java/com/ruoyi/service/ZfContactDownlService.java
@@ -8,7 +8,7 @@
public interface ZfContactDownlService extends IService<ZfDownload> {
    AjaxResult addData(ZfDownload zfDownload);
    AjaxResult deleteData(Long[] ids);
    Boolean deleteData(Long[] ids);
    AjaxResult selectDoctorList(ZfDownload zfDownload, Integer pageNo , Integer pageSize);
zhang-content/src/main/java/com/ruoyi/service/ZfContactShraService.java
@@ -26,4 +26,5 @@
    Long getShareId(ZfDownload zfDownload);
    Boolean deleteByContentId(Long[] ids);
}
zhang-content/src/main/java/com/ruoyi/service/ZfDoctorDownloadService.java
@@ -8,7 +8,7 @@
public interface ZfDoctorDownloadService extends IService<ZfDownload> {
    AjaxResult addData(ZfDownload zfDownload);
    AjaxResult deleteData(Long[] ids);
    Boolean deleteData(Long[] ids);
    AjaxResult selectDoctorList(ZfDownload zfDownload, Integer pageNo , Integer pageSize);
zhang-content/src/main/java/com/ruoyi/service/ZfDoctorShareService.java
@@ -24,5 +24,5 @@
    Long getShareId(ZfDownload zfDownload);
    Boolean deleteByContentId(Long[] ids);
}
zhang-content/src/main/java/com/ruoyi/service/ZfEconomyDownlService.java
@@ -8,7 +8,7 @@
public interface ZfEconomyDownlService extends IService<ZfDownload> {
    AjaxResult addData(ZfDownload zfDownload);
    AjaxResult deleteData(Long[] ids);
    Boolean deleteData(Long[] ids);
    AjaxResult selectDoctorList(ZfDownload zfDownload, Integer pageNo , Integer pageSize);
zhang-content/src/main/java/com/ruoyi/service/ZfEconomyShaService.java
@@ -27,4 +27,6 @@
    Long getShareId(ZfDownload zfDownload);
    Boolean deleteByContentId(Long[] ids);
}
zhang-content/src/main/java/com/ruoyi/service/ZfEquipDownloadService.java
@@ -8,7 +8,7 @@
public interface ZfEquipDownloadService extends IService<ZfDownload> {
    AjaxResult addData(ZfDownload zfDownload);
    AjaxResult deleteData(Long[] ids);
    Boolean deleteData(Long[] ids);
    AjaxResult selectDoctorList(ZfDownload zfDownload, Integer pageNo , Integer pageSize);
zhang-content/src/main/java/com/ruoyi/service/ZfEquipShareService.java
@@ -27,4 +27,6 @@
    Long getShareId(ZfDownload zfDownload);
    Boolean deleteByContentId(Long[] ids);
}
zhang-content/src/main/java/com/ruoyi/service/ZfEventDownloadService.java
@@ -7,7 +7,7 @@
public interface ZfEventDownloadService extends IService<ZfDownload> {
    AjaxResult addData(ZfDownload zfDownload);
    AjaxResult deleteData(Long[] ids);
    Boolean deleteData(Long[] ids);
    AjaxResult selectDoctorList(ZfDownload zfDownload, Integer pageNo , Integer pageSize);
}
zhang-content/src/main/java/com/ruoyi/service/ZfEventShareService.java
@@ -22,4 +22,6 @@
    AjaxResult listUserId(Integer pageNo ,Integer pageSize);
    Long getShareId(ZfDownload zfDownload);
    Boolean deleteByContentId(Long[] ids);
}
zhang-content/src/main/java/com/ruoyi/service/ZfPetDownlService.java
@@ -8,7 +8,7 @@
public interface ZfPetDownlService extends IService<ZfDownload> {
    AjaxResult addData(ZfDownload zfDownload);
    AjaxResult deleteData(Long[] ids);
    Boolean deleteData(Long[] ids);
    AjaxResult selectDoctorList(ZfDownload zfDownload, Integer pageNo , Integer pageSize);
zhang-content/src/main/java/com/ruoyi/service/ZfPetSharService.java
@@ -27,4 +27,6 @@
    Long getShareId(ZfDownload zfDownload);
    Boolean deleteByContentId(Long[] ids);
}
zhang-content/src/main/java/com/ruoyi/service/impl/IZfPropertyDownloadServiceImpl.java
@@ -94,14 +94,27 @@
    }
    @Override
    public AjaxResult deleteData(Long[] ids) {
        List<ZfDownload> zfDownloads = listByIds(Arrays.asList(ids));
    public Boolean deleteData(Long[] ids) {
        List<Long> id = new ArrayList<>();
        if (iZfPropertyShareService.removeByIds(Arrays.asList(ids))) {
        LambdaQueryWrapper<ZfDownload> lqw = new LambdaQueryWrapper<>();
        lqw.in(ids != null, ZfDownload::getDownloadContent,  ids)
                .eq(ZfDownload::getSysMenuId, 2002L);
        List<ZfDownload> zfDownloads = list(lqw);
        System.out.println("111111111111111111111111111111111111111111111111111111"+zfDownloads);
        if (zfDownloads.size() == 0){
            return true;
        }
        for (ZfDownload zfDownload: zfDownloads) {
            id.add(zfDownload.getId());
        }
        if (removeByIds(id)) {
            //删除es中的数据
            zfDownloads.stream().forEach(zfDoctorDownload -> {
                EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "家庭小医生下载");
                EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "家庭资产管理删除");
                if (esModel != null) {
                    DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId());
@@ -112,9 +125,9 @@
                    }
                }
            });
            return AjaxResult.success();
            return true;
        } else {
            return AjaxResult.error();
            return false;
        }
    }
zhang-content/src/main/java/com/ruoyi/service/impl/IZfPropertyServiceImpl.java
@@ -65,6 +65,12 @@
    @Resource
    RestHighLevelClient restHighLevelClient;
    @Resource
    private IZfPropertyDownloadService zfPropertyDownloadService;
    @Resource
    private IZfPropertyShareService iZfPropertyShareService;
//    private LambdaQueryWrapper<ZfProperty> buildCondition(ZfProperty zfProperty) {
//        LambdaQueryWrapper<ZfProperty> lqw = new LambdaQueryWrapper<>();
@@ -567,6 +573,9 @@
        List<ZfProperty> zfPropertys = listByIds(Arrays.asList(ids));
        if (! (zfPropertyDownloadService.deleteData(ids) && iZfPropertyShareService.deleteByContentId(ids)  ) ){
            return AjaxResult.error();
        }
        if (zfPropertyService.removeByIds(Arrays.asList(ids))) {
            //删除es中的数据
@@ -581,6 +590,8 @@
                    throw new RuntimeException(e);
                }}
            });
            System.out.println("15165132165346153246153");
            return AjaxResult.success();
        }else {
            return AjaxResult.error();
zhang-content/src/main/java/com/ruoyi/service/impl/IZfPropertyShareServiceImpl.java
@@ -4,6 +4,7 @@
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.core.domain.entity.SysUser;
import com.ruoyi.common.utils.MapUtils;
import com.ruoyi.common.utils.SecurityUtils;
@@ -12,9 +13,13 @@
import com.ruoyi.mapper.ZfShareMapper;
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.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -31,6 +36,12 @@
    @Resource
    private ZInfoUserService zInfoUserService;
    @Resource
    private RestHighLevelClient restHighLevelClient;
    @Resource
    EsService esService;
    private LambdaQueryWrapper<ZfShare> uniqueCondition(ZfShare zfShare) {
        LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
@@ -187,4 +198,42 @@
            return null;
        }
    }
    @Override
    public Boolean deleteByContentId(Long[] ids) {
        System.out.println("5555555555555555555555555555555555555555555555555555555555555555");
        List<Long> id = new ArrayList<>();
        LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
        lqw.in(ids != null, ZfShare::getShareContent,  ids)
                .eq(ZfShare::getSysMenuId, 2002L);
        List<ZfShare> zfShares = list(lqw);
        if (zfShares.size() == 0){
            return true;
        }
        for (ZfShare zfShare: zfShares) {
            id.add(zfShare.getId());
        }
        System.out.println(id);
        if (removeByIds(id)) {
            //删除es中的数据
            zfShares.forEach(zfDoctorDownload -> {
                EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "家庭资产管理分享删除");
                if (esModel != null) {
                    DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId());
                    System.out.println(deleteRequest);
                    try {
                        restHighLevelClient.delete(deleteRequest, RequestOptions.DEFAULT);
                    } catch (IOException e) {
                        throw new RuntimeException(e);
                    }
                }
            });
            return true;
        } else {
            return false;
        }
    }
}
zhang-content/src/main/java/com/ruoyi/service/impl/TravelCountDownServiceImpl.java
@@ -115,14 +115,29 @@
    }
    @Override
    public AjaxResult deleteData(Long[] ids) {
        List<ZfDownload> zfDownloads = listByIds(Arrays.asList(ids));
    public Boolean deleteData(Long[] ids) {
        List<Long> id = new ArrayList<>();
        if (travelCountService.removeByIds(Arrays.asList(ids))) {
        LambdaQueryWrapper<ZfDownload> lqw = new LambdaQueryWrapper<>();
        lqw.in(ids != null, ZfDownload::getDownloadContent,  ids)
                .eq(ZfDownload::getSysMenuId, 2056L);
        List<ZfDownload> zfDownloads = list(lqw);
        System.out.println(zfDownloads);
        if (zfDownloads.size() == 0){
            return true;
        }
        for (ZfDownload zfDownload: zfDownloads) {
            id.add(zfDownload.getId());
        }
        System.out.println(id);
        if (removeByIds(id)) {
            //删除es中的数据
            zfDownloads.stream().forEach(zfDoctorDownload -> {
                EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "通讯录下载");
                EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "旅游统计表下载删除");
                if (esModel != null) {
                    DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId());
@@ -133,9 +148,9 @@
                    }
                }
            });
            return AjaxResult.success();
            return true;
        } else {
            return AjaxResult.error();
            return false;
        }
    }
zhang-content/src/main/java/com/ruoyi/service/impl/TravelCountSharServiceImpl.java
@@ -5,6 +5,7 @@
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.core.domain.entity.SysUser;
import com.ruoyi.common.utils.MapUtils;
import com.ruoyi.common.utils.SecurityUtils;
@@ -13,9 +14,13 @@
import com.ruoyi.mapper.ZfShareMapper;
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.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -37,6 +42,12 @@
    @Resource
    TravelDetailService travelDetailService;
    @Resource
    private RestHighLevelClient restHighLevelClient;
    @Resource
    EsService esService;
    private LambdaQueryWrapper<ZfShare> uniqueCondition(ZfShare zfShare) {
        LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
@@ -232,4 +243,41 @@
            return null;
        }
    }
    @Override
    public Boolean deleteByContentId(Long[] ids) {
        List<Long> id = new ArrayList<>();
        LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
        lqw.in(ids != null, ZfShare::getShareContent, ids)
                .eq(ZfShare::getSysMenuId, 2056L);
        List<ZfShare> zfShares = list(lqw);
        if (zfShares.size() == 0) {
            return true;
        }
        for (ZfShare zfShare : zfShares) {
            id.add(zfShare.getId());
        }
        System.out.println(id);
        if (removeByIds(id)) {
            //删除es中的数据
            zfShares.forEach(zfDoctorDownload -> {
                EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "旅游统计表分享删除");
                if (esModel != null) {
                    DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId());
                    System.out.println(deleteRequest);
                    try {
                        restHighLevelClient.delete(deleteRequest, RequestOptions.DEFAULT);
                    } catch (IOException e) {
                        throw new RuntimeException(e);
                    }
                }
            });
            return true;
        } else {
            return false;
        }
    }
}
zhang-content/src/main/java/com/ruoyi/service/impl/TravelDetailDownServiceImpl.java
@@ -109,14 +109,29 @@
    @Override
    public AjaxResult deleteData(Long[] ids) {
        List<ZfDownload> zfDownloads = listByIds(Arrays.asList(ids));
    public Boolean deleteData(Long[] ids) {
        List<Long> id = new ArrayList<>();
        if (travelDetailService.removeByIds(Arrays.asList(ids))) {
        LambdaQueryWrapper<ZfDownload> lqw = new LambdaQueryWrapper<>();
        lqw.in(ids != null, ZfDownload::getDownloadContent,  ids)
                .eq(ZfDownload::getSysMenuId, 2055L);
        List<ZfDownload> zfDownloads = list(lqw);
        System.out.println(zfDownloads);
        if (zfDownloads.size() == 0){
            return true;
        }
        for (ZfDownload zfDownload: zfDownloads) {
            id.add(zfDownload.getId());
        }
        System.out.println(id);
        if (removeByIds(id)) {
            //删除es中的数据
            zfDownloads.stream().forEach(zfDoctorDownload -> {
                EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "通讯录下载");
                EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "旅游费用表下载删除");
                if (esModel != null) {
                    DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId());
@@ -127,9 +142,9 @@
                    }
                }
            });
            return AjaxResult.success();
            return true;
        } else {
            return AjaxResult.error();
            return false;
        }
    }
zhang-content/src/main/java/com/ruoyi/service/impl/TravelDetailServiceImpl.java
@@ -3,13 +3,16 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.domain.TravelCount;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.domain.TravelDetail;
import com.ruoyi.domain.ZfCollection;
import com.ruoyi.mapper.TravelDetailMapper;
import com.ruoyi.service.TravelDetailDownlService;
import com.ruoyi.service.TravelDetailService;
import com.ruoyi.service.TravelDetailSharService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
/**
@@ -22,6 +25,11 @@
 */
@Service
public class TravelDetailServiceImpl extends ServiceImpl<TravelDetailMapper, TravelDetail> implements TravelDetailService {
    @Resource
    private TravelDetailDownlService travelDetailDownlService;
    @Resource
    private TravelDetailSharService travelDetailSharService;
    @Override
    public List<TravelDetail> getDataByCid(Long cid,TravelDetail travelDetail) {
@@ -43,11 +51,24 @@
    @Override
    public void removeBatchByCid(List<Long> cid) {
        List<TravelDetail> lqw1 = new ArrayList<>();
        for (Long c : cid) {
            LambdaQueryWrapper<TravelDetail> lqw = new LambdaQueryWrapper<>();
            lqw.eq(TravelDetail::getCid,c);
            lqw1.addAll(list(lqw));
            remove(lqw);
        }
        if (lqw1.size() == 0) return;
        Long[] id = new Long[lqw1.size()];
        for (int i = 0; i < lqw1.size(); i++) {
            id[i] = lqw1.get(i).getId();
        }
        travelDetailDownlService.deleteData(id) ;
        travelDetailSharService.deleteByContentId(id) ;
    }
}
zhang-content/src/main/java/com/ruoyi/service/impl/TravelDetailSharServiceImpl.java
@@ -5,6 +5,7 @@
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.core.domain.entity.SysUser;
import com.ruoyi.common.utils.MapUtils;
import com.ruoyi.common.utils.SecurityUtils;
@@ -13,9 +14,13 @@
import com.ruoyi.mapper.ZfShareMapper;
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.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -33,6 +38,11 @@
    @Resource
    TravelCountSharService travelCountSharService;
    @Resource
    private RestHighLevelClient restHighLevelClient;
    @Resource
    EsService esService;
    private LambdaQueryWrapper<ZfShare> uniqueCondition(ZfShare zfShare) {
        LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
@@ -201,4 +211,41 @@
            return null;
        }
    }
    @Override
    public Boolean deleteByContentId(Long[] ids) {
        List<Long> id = new ArrayList<>();
        LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
        lqw.in(ids != null, ZfShare::getShareContent, ids)
                .eq(ZfShare::getSysMenuId, 2055L);
        List<ZfShare> zfShares = list(lqw);
        if (zfShares.size() == 0) {
            return true;
        }
        for (ZfShare zfShare : zfShares) {
            id.add(zfShare.getId());
        }
        System.out.println(id);
        if (removeByIds(id)) {
            //删除es中的数据
            zfShares.forEach(zfDoctorDownload -> {
                EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "旅游费用表分享删除");
                if (esModel != null) {
                    DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId());
                    System.out.println(deleteRequest);
                    try {
                        restHighLevelClient.delete(deleteRequest, RequestOptions.DEFAULT);
                    } catch (IOException e) {
                        throw new RuntimeException(e);
                    }
                }
            });
            return true;
        } else {
            return false;
        }
    }
}
zhang-content/src/main/java/com/ruoyi/service/impl/ZHonorDownloadServiceImpl.java
@@ -96,14 +96,29 @@
    }
    @Override
    public AjaxResult deleteData(Long[] ids) {
        List<ZfDownload> zfDownloads = listByIds(Arrays.asList(ids));
    public Boolean deleteData(Long[] ids) {
        List<Long> id = new ArrayList<>();
        if (zHonorShareService.removeByIds(Arrays.asList(ids))) {
        LambdaQueryWrapper<ZfDownload> lqw = new LambdaQueryWrapper<>();
        lqw.in(ids != null, ZfDownload::getDownloadContent,  ids)
                .eq(ZfDownload::getSysMenuId, 2030L);
        List<ZfDownload> zfDownloads = list(lqw);
        System.out.println(zfDownloads);
        if (zfDownloads.size() == 0){
            return true;
        }
        for (ZfDownload zfDownload: zfDownloads) {
            id.add(zfDownload.getId());
        }
        System.out.println(id);
        if (removeByIds(id)) {
            //删除es中的数据
            zfDownloads.stream().forEach(zfDoctorDownload -> {
                EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "证书荣耀资质下载");
                EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "证书荣耀资质下载删除");
                if (esModel != null) {
                    DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId());
@@ -114,9 +129,9 @@
                    }
                }
            });
            return AjaxResult.success();
            return true;
        } else {
            return AjaxResult.error();
            return false;
        }
    }
zhang-content/src/main/java/com/ruoyi/service/impl/ZHonorShareServiceImpl.java
@@ -5,6 +5,7 @@
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.core.domain.entity.SysUser;
import com.ruoyi.common.utils.MapUtils;
import com.ruoyi.common.utils.SecurityUtils;
@@ -12,9 +13,13 @@
import com.ruoyi.domain.*;
import com.ruoyi.mapper.ZfShareMapper;
import com.ruoyi.service.*;
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.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -29,6 +34,12 @@
    @Resource
    private ZInfoUserService zInfoUserService;
    @Resource
    private RestHighLevelClient restHighLevelClient;
    @Resource
    EsService esService;
    private LambdaQueryWrapper<ZfShare> uniqueCondition(ZfShare zfShare) {
        LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
@@ -138,7 +149,7 @@
        HashMap<Long,List<ZHonor>>  bs = new HashMap<>();
        LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
        lqw.eq(ZfShare::getShareId,getUserId());
        lqw.eq(ZfShare::getSysMenuId,2053L);
        lqw.eq(ZfShare::getSysMenuId,2030L);
        List<ZfShare> beanRecords = list(lqw);
        List<ZHonor> b1 = new ArrayList<>();
        for (ZfShare beanRecord : beanRecords ) {
@@ -154,7 +165,7 @@
        List<ZHonor>  bs = new ArrayList<>();
        LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
        lqw.eq(ZfShare::getShareId,getUserId());
        lqw.eq(ZfShare::getSysMenuId,2053L);
        lqw.eq(ZfShare::getSysMenuId,2030L);
        List<ZfShare> beanRecords = list(lqw);
        for (ZfShare beanRecord : beanRecords ) {
            ZHonor bs2 = zHonorService.getById(beanRecord.getShareContent());
@@ -185,7 +196,42 @@
            return null;
        }
    }
    @Override
    public Boolean deleteByContentId(Long[] ids) {
        List<Long> id = new ArrayList<>();
        LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
        lqw.in(ids != null, ZfShare::getShareContent, ids)
                .eq(ZfShare::getSysMenuId, 2030L);
        List<ZfShare> zfShares = list(lqw);
        if (zfShares.size() == 0) {
            return true;
        }
        for (ZfShare zfShare : zfShares) {
            id.add(zfShare.getId());
        }
        System.out.println(id);
        if (removeByIds(id)) {
            //删除es中的数据
            zfShares.forEach(zfDoctorDownload -> {
                EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "个人财产分享删除");
                if (esModel != null) {
                    DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId());
                    System.out.println(deleteRequest);
                    try {
                        restHighLevelClient.delete(deleteRequest, RequestOptions.DEFAULT);
                    } catch (IOException e) {
                        throw new RuntimeException(e);
                    }
                }
            });
            return true;
        } else {
            return false;
        }
    }
}
zhang-content/src/main/java/com/ruoyi/service/impl/ZIdeaDownloadServiceImpl.java
@@ -95,10 +95,25 @@
    }
    @Override
    public AjaxResult deleteData(Long[] ids) {
        List<ZfDownload> zfDownloads = listByIds(Arrays.asList(ids));
    public Boolean deleteData(Long[] ids) {
        if (zIdeaShareService.removeByIds(Arrays.asList(ids))) {
        List<Long> id = new ArrayList<>();
        LambdaQueryWrapper<ZfDownload> lqw = new LambdaQueryWrapper<>();
        lqw.in(ids != null, ZfDownload::getDownloadContent,  ids)
                .eq(ZfDownload::getSysMenuId, 2027L);
        List<ZfDownload> zfDownloads = list(lqw);
        System.out.println(zfDownloads);
        if (zfDownloads.size() == 0){
            return true;
        }
        for (ZfDownload zfDownload: zfDownloads) {
            id.add(zfDownload.getId());
        }
        System.out.println(id);
        if (removeByIds(id)) {
            //删除es中的数据
            zfDownloads.stream().forEach(zfDoctorDownload -> {
@@ -113,9 +128,9 @@
                    }
                }
            });
            return AjaxResult.success();
            return true;
        } else {
            return AjaxResult.error();
            return false;
        }
    }
zhang-content/src/main/java/com/ruoyi/service/impl/ZIdeaShareServiceImpl.java
@@ -5,19 +5,22 @@
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.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 com.ruoyi.service.ZIdeaShareService;
import com.ruoyi.service.ZInfoUserService;
import com.ruoyi.service.ZIdeaService;
import com.ruoyi.service.ZIdeaShareService;
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.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -33,6 +36,12 @@
    private ZfShareMapper zfShareMapper;
    @Resource
    private ZInfoUserService zInfoUserService;
    @Resource
    private RestHighLevelClient restHighLevelClient;
    @Resource
    EsService esService;
    private LambdaQueryWrapper<ZfShare> uniqueCondition(ZfShare zfShare) {
        LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
@@ -197,5 +206,40 @@
        return AjaxResult.success(zInfoUsers);
    }
    @Override
    public Boolean deleteByContentId(Long[] ids) {
        List<Long> id = new ArrayList<>();
        LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
        lqw.in(ids != null, ZfShare::getShareContent, ids)
                .eq(ZfShare::getSysMenuId, 2027L);
        List<ZfShare> zfShares = list(lqw);
        if (zfShares.size() == 0) {
            return true;
        }
        for (ZfShare zfShare : zfShares) {
            id.add(zfShare.getId());
        }
        System.out.println(id);
        if (removeByIds(id)) {
            //删除es中的数据
            zfShares.forEach(zfDoctorDownload -> {
                EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "个人财产分享删除");
                if (esModel != null) {
                    DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId());
                    System.out.println(deleteRequest);
                    try {
                        restHighLevelClient.delete(deleteRequest, RequestOptions.DEFAULT);
                    } catch (IOException e) {
                        throw new RuntimeException(e);
                    }
                }
            });
            return true;
        } else {
            return false;
        }
    }
}
zhang-content/src/main/java/com/ruoyi/service/impl/ZPropertyDownloadServiceImpl.java
@@ -95,14 +95,28 @@
    }
    @Override
    public AjaxResult deleteData(Long[] ids) {
        List<ZfDownload> zfDownloads = listByIds(Arrays.asList(ids));
    public Boolean deleteData(Long[] ids) {
        List<Long> id = new ArrayList<>();
        if (zPropertyShareService.removeByIds(Arrays.asList(ids))) {
        LambdaQueryWrapper<ZfDownload> lqw = new LambdaQueryWrapper<>();
        lqw.in(ids != null, ZfDownload::getDownloadContent,  ids)
                .eq(ZfDownload::getSysMenuId, 2026L);
        List<ZfDownload> zfDownloads = list(lqw);
        System.out.println(zfDownloads);
        if (zfDownloads.size() == 0){
            return true;
        }
        for (ZfDownload zfDownload: zfDownloads) {
            id.add(zfDownload.getId());
        }
        System.out.println(id);
        if (removeByIds(id) ){
            //删除es中的数据
            zfDownloads.stream().forEach(zfDoctorDownload -> {
                EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "个人财产下载");
                EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "个人财产下载删除");
                if (esModel != null) {
                    DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId());
@@ -113,9 +127,9 @@
                    }
                }
            });
            return AjaxResult.success();
            return true;
        } else {
            return AjaxResult.error();
            return false;
        }
    }
zhang-content/src/main/java/com/ruoyi/service/impl/ZPropertyShareServiceImpl.java
@@ -4,20 +4,23 @@
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.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.*;
import com.ruoyi.service.ZPropertyShareService;
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.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -27,13 +30,19 @@
@Service
public class ZPropertyShareServiceImpl extends ServiceImpl<ZfShareMapper,ZfShare> implements ZPropertyShareService {
    @Resource
    ZPropertyService zPropertyService;
    @Resource
    private ZInfoUserService zInfoUserService;
    @Resource
    private RestHighLevelClient restHighLevelClient;
    @Resource
    EsService esService;
    private LambdaQueryWrapper<ZfShare> uniqueCondition(ZfShare zfShare) {
        LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
@@ -49,26 +58,24 @@
        Long userId = user.getUserId();
        LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
        lqw.eq(ZfShare::getShareId,userId);
        lqw.eq(ZfShare::getShareId, userId);
        return list(lqw);
    }
    public Long getUserId(){
    public Long getUserId() {
        ZInfoUser myself = zInfoUserService.getMyself();
        return myself.getUserId();
    }
    public void addData(ZfShare za)
    {
    public void addData(ZfShare za) {
        LambdaQueryWrapper<ZfShare> lqw = uniqueCondition(za);
        List<ZfShare> list = list(lqw);
        if(list.size()>0){
        if (list.size() > 0) {
            throw new RuntimeException("请勿分享重复数据");
        }
        else {
        } else {
            save(za);
        }
@@ -76,8 +83,8 @@
    @Override
    public AjaxResult saveZa(ShareMore shareMore) {
        Long [] shareIds = shareMore.getShareIds();
        Long [] shareContents =  shareMore.getShareContents();
        Long[] shareIds = shareMore.getShareIds();
        Long[] shareContents = shareMore.getShareContents();
        for (Long shareId : shareIds) {
            for (Long shareContent : shareContents) {
                ZfShare za = new ZfShare();
@@ -95,39 +102,38 @@
    @Override
    public AjaxResult listByFidAid(ShareMore shareMore, Integer pageNo, Integer pageSize) {
        Long [] shareIds = shareMore.getShareIds();
        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())
                lqw.eq(ZfShare::getShareId, shareId)
                        .eq(ZfShare::getSysMenuId, shareMore.getSysMenuId())
                        .eq(ZfShare::getUserId, getUserId());
                List<ZfShare> beanRecords = list(lqw);
                for (ZfShare beanRecord : beanRecords ) {
                for (ZfShare beanRecord : beanRecords) {
                    beanRecord3.add(zPropertyService.getById(beanRecord.getShareContent()));
                }
            }
        }
        List<ZProperty>  record =  beanRecord3.stream().skip((pageNo-1)*pageSize).limit(pageSize).collect(Collectors.toList());
        List<ZProperty> record = beanRecord3.stream().skip((pageNo - 1) * pageSize).limit(pageSize).collect(Collectors.toList());
        int totalPage = (beanRecord3.size() -1) / pageSize +1;
        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());
        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)
            {
        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)
                lqw.eq(ZfShare::getShareId, shareId)
                        .eq(ZfShare::getShareContent, shareContent)
                        .eq(ZfShare::getSysMenuId, shareMore.getSysMenuId())
                        .eq(ZfShare::getUserId, getUserId());
@@ -140,15 +146,15 @@
    @Override
    public AjaxResult listByUserId() {
        HashMap<Long,List<ZProperty>>  bs = new HashMap<>();
        HashMap<Long, List<ZProperty>> bs = new HashMap<>();
        LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
        lqw.eq(ZfShare::getShareId,getUserId());
        lqw.eq(ZfShare::getSysMenuId,2026L);
        lqw.eq(ZfShare::getShareId, getUserId());
        lqw.eq(ZfShare::getSysMenuId, 2026L);
        List<ZfShare> beanRecords = list(lqw);
        List<ZProperty> b1 = new ArrayList<>();
        for (ZfShare beanRecord : beanRecords ) {
        for (ZfShare beanRecord : beanRecords) {
            b1.add(zPropertyService.getById(beanRecord.getShareContent()));
            bs.put(beanRecord.getUserId(),b1);
            bs.put(beanRecord.getUserId(), b1);
        }
        log.info("从数据库中查到的为:{}", bs);
        return AjaxResult.success(bs);
@@ -156,23 +162,23 @@
    @Override
    public AjaxResult listUserId(Integer pageNo, Integer pageSize) {
        List<ZProperty>  bs = new ArrayList<>();
        List<ZProperty> bs = new ArrayList<>();
        LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
        lqw.eq(ZfShare::getShareId,getUserId());
        lqw.eq(ZfShare::getSysMenuId,2026L);
        lqw.eq(ZfShare::getShareId, getUserId());
        lqw.eq(ZfShare::getSysMenuId, 2026L);
        List<ZfShare> beanRecords = list(lqw);
        for (ZfShare beanRecord : beanRecords ) {
        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());
        List<ZProperty> record = bs.stream().skip((pageNo - 1) * pageSize).limit(pageSize).collect(Collectors.toList());
        int totalPage = (bs.size() -1) / pageSize +1;
        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());
        Page<ZProperty> zPropertyPage = new Page<>(pageNo, pageSize, totalPage);
        HashMap<String, Object> data = MapUtils.getShareResult(zPropertyPage, record, bs.size());
        return AjaxResult.success(data);
    }
@@ -183,11 +189,47 @@
                .eq(ZfShare::getShareContent, zfDownload.getDownloadContent())
                .eq(ZfShare::getSysMenuId, zfDownload.getSysMenuId());
        List<ZfShare> beanRecords = list(lqw);
        if (beanRecords.size() != 0){
        if (beanRecords.size() != 0) {
            return beanRecords.get(0).getUserId();
        }
        else {
        } else {
            return null;
        }
    }
}
    @Override
    public Boolean deleteByContentId(Long[] ids) {
        List<Long> id = new ArrayList<>();
        LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
        lqw.in(ids != null, ZfShare::getShareContent, ids)
                .eq(ZfShare::getSysMenuId, 2026L);
        List<ZfShare> zfShares = list(lqw);
        if (zfShares.size() == 0) {
            return true;
        }
        for (ZfShare zfShare : zfShares) {
            id.add(zfShare.getId());
        }
        System.out.println(id);
        if (removeByIds(id)) {
            //删除es中的数据
            zfShares.forEach(zfDoctorDownload -> {
                EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "个人财产分享删除");
                if (esModel != null) {
                    DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId());
                    System.out.println(deleteRequest);
                    try {
                        restHighLevelClient.delete(deleteRequest, RequestOptions.DEFAULT);
                    } catch (IOException e) {
                        throw new RuntimeException(e);
                    }
                }
            });
            return true;
        } else {
            return false;
        }
    }
}
zhang-content/src/main/java/com/ruoyi/service/impl/ZSecretDownloadServiceImpl.java
@@ -95,14 +95,29 @@
    }
    @Override
    public AjaxResult deleteData(Long[] ids) {
        List<ZfDownload> zfDownloads = listByIds(Arrays.asList(ids));
    public Boolean deleteData(Long[] ids) {
        List<Long> id = new ArrayList<>();
        if (zSecretShareService.removeByIds(Arrays.asList(ids))) {
        LambdaQueryWrapper<ZfDownload> lqw = new LambdaQueryWrapper<>();
        lqw.in(ids != null, ZfDownload::getDownloadContent,  ids)
                .eq(ZfDownload::getSysMenuId, 2031L);
        List<ZfDownload> zfDownloads = list(lqw);
        System.out.println(zfDownloads);
        if (zfDownloads.size() == 0){
            return true;
        }
        for (ZfDownload zfDownload: zfDownloads) {
            id.add(zfDownload.getId());
        }
        System.out.println(id);
        if (removeByIds(id)) {
            //删除es中的数据
            zfDownloads.stream().forEach(zfDoctorDownload -> {
                EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "隐私下载");
                EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "隐私下载删除");
                if (esModel != null) {
                    DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId());
@@ -113,9 +128,9 @@
                    }
                }
            });
            return AjaxResult.success();
            return true;
        } else {
            return AjaxResult.error();
            return false;
        }
    }
zhang-content/src/main/java/com/ruoyi/service/impl/ZSecretShareServiceImpl.java
@@ -5,18 +5,24 @@
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.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.EsService;
import com.ruoyi.service.ZInfoUserService;
import com.ruoyi.service.ZSecretService;
import com.ruoyi.service.ZSecretShareService;
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.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -32,6 +38,11 @@
    @Resource
    private ZInfoUserService zInfoUserService;
    @Resource
    private RestHighLevelClient restHighLevelClient;
    @Resource
    EsService esService;
    private LambdaQueryWrapper<ZfShare> uniqueCondition(ZfShare zfShare) {
        LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
        lqw.eq(StringUtils.isNotEmpty(String.valueOf(zfShare.getShareId())), ZfShare::getShareId, zfShare.getShareId());
@@ -187,6 +198,42 @@
            return null;
        }
    }
    @Override
    public Boolean deleteByContentId(Long[] ids) {
        List<Long> id = new ArrayList<>();
        LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
        lqw.in(ids != null, ZfShare::getShareContent, ids)
                .eq(ZfShare::getSysMenuId, 2031L);
        List<ZfShare> zfShares = list(lqw);
        if (zfShares.size() == 0) {
            return true;
        }
        for (ZfShare zfShare : zfShares) {
            id.add(zfShare.getId());
        }
        System.out.println(id);
        if (removeByIds(id)) {
            //删除es中的数据
            zfShares.forEach(zfDoctorDownload -> {
                EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "隐私分享删除");
                if (esModel != null) {
                    DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId());
                    System.out.println(deleteRequest);
                    try {
                        restHighLevelClient.delete(deleteRequest, RequestOptions.DEFAULT);
                    } catch (IOException e) {
                        throw new RuntimeException(e);
                    }
                }
            });
            return true;
        } else {
            return false;
        }
    }
zhang-content/src/main/java/com/ruoyi/service/impl/ZSelfNoteDownloadServiceImpl.java
@@ -95,14 +95,29 @@
    }
    @Override
    public AjaxResult deleteData(Long[] ids) {
        List<ZfDownload> zfDownloads = listByIds(Arrays.asList(ids));
    public Boolean deleteData(Long[] ids) {
        List<Long> id = new ArrayList<>();
        if (zSelfNoteShareService.removeByIds(Arrays.asList(ids))) {
        LambdaQueryWrapper<ZfDownload> lqw = new LambdaQueryWrapper<>();
        lqw.in(ids != null, ZfDownload::getDownloadContent,  ids)
                .eq(ZfDownload::getSysMenuId, 2010L);
        List<ZfDownload> zfDownloads = list(lqw);
        System.out.println(zfDownloads);
        if (zfDownloads.size() == 0){
            return true;
        }
        for (ZfDownload zfDownload: zfDownloads) {
            id.add(zfDownload.getId());
        }
        System.out.println(id);
        if (removeByIds(id)) {
            //删除es中的数据
            zfDownloads.stream().forEach(zfDoctorDownload -> {
                EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "个人记事本下载");
                EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "个人记事本下载删除");
                if (esModel != null) {
                    DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId());
@@ -113,9 +128,9 @@
                    }
                }
            });
            return AjaxResult.success();
            return true;
        } else {
            return AjaxResult.error();
            return false;
        }
    }
zhang-content/src/main/java/com/ruoyi/service/impl/ZSelfNoteShareServiceImpl.java
@@ -5,19 +5,22 @@
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.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.*;
import com.ruoyi.service.ZSelfNoteShareService;
import com.ruoyi.service.ZInfoUserService;
import com.ruoyi.service.ZSelfNoteShareService;
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.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -32,6 +35,13 @@
    @Resource
    private ZInfoUserService zInfoUserService;
    @Resource
    private RestHighLevelClient restHighLevelClient;
    @Resource
    EsService esService;
    private LambdaQueryWrapper<ZfShare> uniqueCondition(ZfShare zfShare) {
        LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
@@ -189,6 +199,41 @@
        }
    }
    @Override
    public Boolean deleteByContentId(Long[] ids) {
        List<Long> id = new ArrayList<>();
        LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
        lqw.in(ids != null, ZfShare::getShareContent, ids)
                .eq(ZfShare::getSysMenuId, 2010L);
        List<ZfShare> zfShares = list(lqw);
        if (zfShares.size() == 0) {
            return true;
        }
        for (ZfShare zfShare : zfShares) {
            id.add(zfShare.getId());
        }
        System.out.println(id);
        if (removeByIds(id)) {
            //删除es中的数据
            zfShares.forEach(zfDoctorDownload -> {
                EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "个人记事本分享删除");
                if (esModel != null) {
                    DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId());
                    System.out.println(deleteRequest);
                    try {
                        restHighLevelClient.delete(deleteRequest, RequestOptions.DEFAULT);
                    } catch (IOException e) {
                        throw new RuntimeException(e);
                    }
                }
            });
            return true;
        } else {
            return false;
        }
    }
}
zhang-content/src/main/java/com/ruoyi/service/impl/ZfCleanDownloadServiceImpl.java
@@ -95,14 +95,29 @@
    }
    @Override
    public AjaxResult deleteData(Long[] ids) {
        List<ZfDownload> zfDownloads = listByIds(Arrays.asList(ids));
    public Boolean deleteData(Long[] ids) {
        List<Long> id = new ArrayList<>();
        if (zfCleanShareService.removeByIds(Arrays.asList(ids))) {
        LambdaQueryWrapper<ZfDownload> lqw = new LambdaQueryWrapper<>();
        lqw.in(ids != null, ZfDownload::getDownloadContent,  ids)
                .eq(ZfDownload::getSysMenuId, 2020L);
        List<ZfDownload> zfDownloads = list(lqw);
        System.out.println(zfDownloads);
        if (zfDownloads.size() == 0){
            return true;
        }
        for (ZfDownload zfDownload: zfDownloads) {
            id.add(zfDownload.getId());
        }
        System.out.println(id);
        if (removeByIds(id)) {
            //删除es中的数据
            zfDownloads.stream().forEach(zfDoctorDownload -> {
                EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "保洁收纳下载");
                EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "保洁收纳下载删除");
                if (esModel != null) {
                    DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId());
@@ -113,9 +128,9 @@
                    }
                }
            });
            return AjaxResult.success();
            return true;
        } else {
            return AjaxResult.error();
            return false;
        }
    }
zhang-content/src/main/java/com/ruoyi/service/impl/ZfCleanServiceImpl.java
@@ -62,6 +62,12 @@
    @Resource
    RestHighLevelClient restHighLevelClient;
    @Resource
    ZfCleanShareService zfCleanShareService;
    @Resource
    ZfCleanDownloadService zfCleanDownloadService;
    private LambdaQueryWrapper<ZfClean> buildCondition(ZfClean zfClean,List<Long> familyIdList) {
        LambdaQueryWrapper<ZfClean> lqw = new LambdaQueryWrapper<>();
        lqw.orderByDesc(ZfClean::getCreateTime);
@@ -605,7 +611,9 @@
        }
        List<ZfClean> zfCleans = listByIds(Arrays.asList(ids));
        if (! (zfCleanDownloadService.deleteData(ids) && zfCleanShareService.deleteByContentId(ids)  ) ){
            return AjaxResult.error();
        }
        if (zfCleanService.removeByIds(Arrays.asList(ids))) {
            //删除es中的数据
zhang-content/src/main/java/com/ruoyi/service/impl/ZfCleanShareServiceImpl.java
@@ -5,6 +5,7 @@
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.core.domain.entity.SysUser;
import com.ruoyi.common.utils.MapUtils;
import com.ruoyi.common.utils.SecurityUtils;
@@ -12,10 +13,14 @@
import com.ruoyi.domain.*;
import com.ruoyi.mapper.ZfShareMapper;
import com.ruoyi.service.*;
import org.elasticsearch.action.delete.DeleteRequest;
import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -31,6 +36,12 @@
    @Resource
    private ZInfoUserService zInfoUserService;
    @Resource
    private RestHighLevelClient restHighLevelClient;
    @Resource
    EsService esService;
    private LambdaQueryWrapper<ZfShare> uniqueCondition(ZfShare zfShare) {
        LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
@@ -188,6 +199,42 @@
        }
    }
    @Override
    public Boolean deleteByContentId(Long[] ids) {
        List<Long> id = new ArrayList<>();
        LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
        lqw.in(ids != null, ZfShare::getShareContent,  ids)
                .eq(ZfShare::getSysMenuId, 2020L);
        List<ZfShare> zfShares = list(lqw);
        if (zfShares.size() == 0){
            return true;
        }
        for (ZfShare zfShare: zfShares) {
            id.add(zfShare.getId());
        }
        System.out.println(id);
        if (removeByIds(id)) {
            //删除es中的数据
            zfShares.forEach(zfDoctorDownload -> {
                EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "保洁收纳分享删除");
                if (esModel != null) {
                    DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId());
                    System.out.println(deleteRequest);
                    try {
                        restHighLevelClient.delete(deleteRequest, RequestOptions.DEFAULT);
                    } catch (IOException e) {
                        throw new RuntimeException(e);
                    }
                }
            });
            return true;
        } else {
            return false;
        }
    }
}
zhang-content/src/main/java/com/ruoyi/service/impl/ZfCollectionDownlServiceImpl.java
@@ -94,14 +94,27 @@
    }
    @Override
    public AjaxResult deleteData(Long[] ids) {
        List<ZfDownload> zfDownloads = listByIds(Arrays.asList(ids));
    public Boolean deleteData(Long[] ids) {
        if (zfCollectionShareService.removeByIds(Arrays.asList(ids))) {
        List<Long> id = new ArrayList<>();
        LambdaQueryWrapper<ZfDownload> lqw = new LambdaQueryWrapper<>();
        lqw.in(ids != null, ZfDownload::getDownloadContent,  ids)
                .eq(ZfDownload::getSysMenuId, 2018L);
        List<ZfDownload> zfDownloads = list(lqw);
        System.out.println(zfDownloads);
        if (zfDownloads.size() == 0){
            return true;
        }
        for (ZfDownload zfDownload: zfDownloads) {
            id.add(zfDownload.getId());
        }
        if (removeByIds(id)) {
            //删除es中的数据
            zfDownloads.stream().forEach(zfDoctorDownload -> {
                EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "收藏与荣耀");
                EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "收藏与荣耀下载的删除");
                if (esModel != null) {
                    DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId());
@@ -112,9 +125,9 @@
                    }
                }
            });
            return AjaxResult.success();
            return true;
        } else {
            return AjaxResult.error();
            return false;
        }
    }
zhang-content/src/main/java/com/ruoyi/service/impl/ZfCollectionServiceImpl.java
@@ -63,6 +63,12 @@
    @Resource
    RestHighLevelClient restHighLevelClient;
    @Resource
    ZfCollectionShareService zfCollectionShareService;
    @Resource
    ZfCollectionDownloadService zfCollectionDownloadService;
    private LambdaQueryWrapper<ZfCollection> buildCondition(ZfCollection zfCollection,List<Long> familyIdList) {
        LambdaQueryWrapper<ZfCollection> lqw = new LambdaQueryWrapper<>();
        lqw.orderByDesc(ZfCollection::getCreateTime);
@@ -579,7 +585,9 @@
        }
        List<ZfCollection> zfCollections = listByIds(Arrays.asList(ids));
        if (! ( zfCollectionDownloadService.deleteData(ids) && zfCollectionShareService.deleteByContentId(ids)  ) ){
            return AjaxResult.error();
        }
        if (zfCollectionService.removeByIds(Arrays.asList(ids))) {
            //删除es中的数据
zhang-content/src/main/java/com/ruoyi/service/impl/ZfCollectionShaServiceImpl.java
@@ -4,6 +4,7 @@
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.core.domain.entity.SysUser;
import com.ruoyi.common.utils.MapUtils;
import com.ruoyi.common.utils.SecurityUtils;
@@ -12,9 +13,13 @@
import com.ruoyi.mapper.ZfShareMapper;
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.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -32,6 +37,11 @@
    @Resource
    private ZInfoUserService zInfoUserService;
    @Resource
    private RestHighLevelClient restHighLevelClient;
    @Resource
    EsService esService;
    private LambdaQueryWrapper<ZfShare> uniqueCondition(ZfShare zfShare) {
        LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
@@ -203,4 +213,42 @@
            return null;
        }
    }
    @Override
    public Boolean deleteByContentId(Long[] ids) {
        List<Long> id = new ArrayList<>();
        LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
        lqw.in(ids != null, ZfShare::getShareContent,  ids)
                .eq(ZfShare::getSysMenuId, 2018L);
        List<ZfShare> zfShares = list(lqw);
        if (zfShares.size() == 0){
            return true;
        }
        for (ZfShare zfShare: zfShares) {
            id.add(zfShare.getId());
        }
        System.out.println(id);
        if (removeByIds(id)) {
            //删除es中的数据
            zfShares.forEach(zfDoctorDownload -> {
                EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "收藏和荣誉分享删除");
                if (esModel != null) {
                    DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId());
                    System.out.println(deleteRequest);
                    try {
                        restHighLevelClient.delete(deleteRequest, RequestOptions.DEFAULT);
                    } catch (IOException e) {
                        throw new RuntimeException(e);
                    }
                }
            });
            return true;
        } else {
            return false;
        }
    }
}
zhang-content/src/main/java/com/ruoyi/service/impl/ZfContactDownlServiceImpl.java
@@ -94,10 +94,25 @@
    }
    @Override
    public AjaxResult deleteData(Long[] ids) {
        List<ZfDownload> zfDownloads = listByIds(Arrays.asList(ids));
    public Boolean deleteData(Long[] ids) {
        List<Long> id = new ArrayList<>();
        if (zfContactShraService.removeByIds(Arrays.asList(ids))) {
        LambdaQueryWrapper<ZfDownload> lqw = new LambdaQueryWrapper<>();
        lqw.in(ids != null, ZfDownload::getDownloadContent,  ids)
                .eq(ZfDownload::getSysMenuId, 2021L);
        List<ZfDownload> zfDownloads = list(lqw);
        System.out.println(zfDownloads);
        if (zfDownloads.size() == 0){
            return true;
        }
        for (ZfDownload zfDownload: zfDownloads) {
            id.add(zfDownload.getId());
        }
        System.out.println(id);
        if (removeByIds(id)) {
            //删除es中的数据
            zfDownloads.stream().forEach(zfDoctorDownload -> {
@@ -112,9 +127,9 @@
                    }
                }
            });
            return AjaxResult.success();
            return true;
        } else {
            return AjaxResult.error();
            return false;
        }
    }
zhang-content/src/main/java/com/ruoyi/service/impl/ZfContactServiceImpl.java
@@ -57,6 +57,12 @@
    @Resource
    RestHighLevelClient restHighLevelClient;
    @Resource
    ZfContactShraServiceImpl zfContactShraService;
    @Resource
    ZfContactDownlService zfContactDownlService;
    private LambdaQueryWrapper<ZfContact> buildCondition(ZfContact zfContact,List<Long> familyIdList) {
        LambdaQueryWrapper<ZfContact> lqw = new LambdaQueryWrapper<>();
@@ -594,6 +600,9 @@
        List<ZfContact> zfContacts = listByIds(Arrays.asList(ids));
        if (! (zfContactDownlService.deleteData(ids) && zfContactShraService.deleteByContentId(ids)  ) ){
            return AjaxResult.error();
        }
        if (zfContactService.removeByIds(Arrays.asList(ids))) {
            //删除es中的数据
zhang-content/src/main/java/com/ruoyi/service/impl/ZfContactShraServiceImpl.java
@@ -5,20 +5,22 @@
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.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.ZfCollectionService;
import com.ruoyi.service.ZfContactService;
import com.ruoyi.service.ZfContactShraService;
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.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -32,6 +34,12 @@
    @Resource
    private ZInfoUserService zInfoUserService;
    @Resource
    private RestHighLevelClient restHighLevelClient;
    @Resource
    EsService esService;
    private LambdaQueryWrapper<ZfShare> uniqueCondition(ZfShare zfShare) {
        LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
@@ -47,26 +55,24 @@
        Long userId = user.getUserId();
        LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
        lqw.eq(ZfShare::getShareId,userId);
        lqw.eq(ZfShare::getShareId, userId);
        return list(lqw);
    }
    public Long getUserId(){
    public Long getUserId() {
        ZInfoUser myself = zInfoUserService.getMyself();
        return myself.getUserId();
    }
    public void addData(ZfShare za)
    {
    public void addData(ZfShare za) {
        LambdaQueryWrapper<ZfShare> lqw = uniqueCondition(za);
        List<ZfShare> list = list(lqw);
        if(list.size()>0){
        if (list.size() > 0) {
            throw new RuntimeException("请勿分享重复数据");
        }
        else {
        } else {
            save(za);
        }
@@ -74,8 +80,8 @@
    @Override
    public AjaxResult saveZa(ShareMore shareMore) {
        Long [] shareIds = shareMore.getShareIds();
        Long [] shareContents =  shareMore.getShareContents();
        Long[] shareIds = shareMore.getShareIds();
        Long[] shareContents = shareMore.getShareContents();
        for (Long shareId : shareIds) {
            for (Long shareContent : shareContents) {
                ZfShare za = new ZfShare();
@@ -93,39 +99,38 @@
    @Override
    public AjaxResult listByFidAid(ShareMore shareMore, Integer pageNo, Integer pageSize) {
        Long [] shareIds = shareMore.getShareIds();
        Long[] shareIds = shareMore.getShareIds();
        List<ZfContact> beanRecord3 = new ArrayList<>();
        for (Long shareId : shareIds) {
            {
                LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
                lqw.eq(ZfShare::getShareId,shareId)
                        .eq(ZfShare::getSysMenuId,shareMore.getSysMenuId())
                lqw.eq(ZfShare::getShareId, shareId)
                        .eq(ZfShare::getSysMenuId, shareMore.getSysMenuId())
                        .eq(ZfShare::getUserId, getUserId());
                List<ZfShare> beanRecords = list(lqw);
                for (ZfShare beanRecord : beanRecords ) {
                for (ZfShare beanRecord : beanRecords) {
                    beanRecord3.add(zfContactService.getById(beanRecord.getShareContent()));
                }
            }
        }
        List<ZfContact>  record =  beanRecord3.stream().skip((pageNo-1)*pageSize).limit(pageSize).collect(Collectors.toList());
        List<ZfContact> record = beanRecord3.stream().skip((pageNo - 1) * pageSize).limit(pageSize).collect(Collectors.toList());
        int totalPage = (beanRecord3.size() -1) / pageSize +1;
        int totalPage = (beanRecord3.size() - 1) / pageSize + 1;
        Page<ZfContact> zfContactPage = new Page<>(pageNo, pageSize,totalPage);
        HashMap<String, Object> data = MapUtils.getShareResult(zfContactPage, record,beanRecord3.size());
        Page<ZfContact> zfContactPage = new Page<>(pageNo, pageSize, totalPage);
        HashMap<String, Object> data = MapUtils.getShareResult(zfContactPage, 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)
            {
        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)
                lqw.eq(ZfShare::getShareId, shareId)
                        .eq(ZfShare::getShareContent, shareContent)
                        .eq(ZfShare::getSysMenuId, shareMore.getSysMenuId())
                        .eq(ZfShare::getUserId, getUserId());
@@ -138,15 +143,15 @@
    @Override
    public AjaxResult listByUserId() {
        HashMap<Long,List<ZfContact>>  bs = new HashMap<>();
        HashMap<Long, List<ZfContact>> bs = new HashMap<>();
        LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
        lqw.eq(ZfShare::getShareId,getUserId());
        lqw.eq(ZfShare::getSysMenuId,2021L);
        lqw.eq(ZfShare::getShareId, getUserId());
        lqw.eq(ZfShare::getSysMenuId, 2021L);
        List<ZfShare> beanRecords = list(lqw);
        List<ZfContact> b1 = new ArrayList<>();
        for (ZfShare beanRecord : beanRecords ) {
        for (ZfShare beanRecord : beanRecords) {
            b1.add(zfContactService.getById(beanRecord.getShareContent()));
            bs.put(beanRecord.getUserId(),b1);
            bs.put(beanRecord.getUserId(), b1);
        }
        log.info("从数据库中查到的为:{}", bs);
        return AjaxResult.success(bs);
@@ -154,23 +159,23 @@
    @Override
    public AjaxResult listUserId(Integer pageNo, Integer pageSize) {
        List<ZfContact>  bs = new ArrayList<>();
        List<ZfContact> bs = new ArrayList<>();
        LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
        lqw.eq(ZfShare::getShareId,getUserId());
        lqw.eq(ZfShare::getSysMenuId,2021L);
        lqw.eq(ZfShare::getShareId, getUserId());
        lqw.eq(ZfShare::getSysMenuId, 2021L);
        List<ZfShare> beanRecords = list(lqw);
        for (ZfShare beanRecord : beanRecords ) {
        for (ZfShare beanRecord : beanRecords) {
            ZfContact bs2 = zfContactService.getById(beanRecord.getShareContent());
            bs2.setShareId(beanRecord.getUserId().intValue());
            bs.add(bs2);
        }
        log.info("从数据库中查到的为:{}", bs);
        List<ZfContact>  record = bs.stream().skip((pageNo-1)*pageSize).limit(pageSize).collect(Collectors.toList());
        List<ZfContact> record = bs.stream().skip((pageNo - 1) * pageSize).limit(pageSize).collect(Collectors.toList());
        int totalPage = (bs.size() -1) / pageSize +1;
        int totalPage = (bs.size() - 1) / pageSize + 1;
        Page<ZfContact> zfCollectionPage = new Page<>(pageNo, pageSize,totalPage);
        HashMap<String, Object> data = MapUtils.getShareResult(zfCollectionPage, record,bs.size());
        Page<ZfContact> zfCollectionPage = new Page<>(pageNo, pageSize, totalPage);
        HashMap<String, Object> data = MapUtils.getShareResult(zfCollectionPage, record, bs.size());
        return AjaxResult.success(data);
    }
@@ -181,12 +186,50 @@
                .eq(ZfShare::getShareContent, zfDownload.getDownloadContent())
                .eq(ZfShare::getSysMenuId, zfDownload.getSysMenuId());
        List<ZfShare> beanRecords = list(lqw);
        if (beanRecords.size() != 0){
        if (beanRecords.size() != 0) {
            return beanRecords.get(0).getUserId();
        }
        else {
        } else {
            return null;
        }
    }
    @Override
    public Boolean deleteByContentId(Long[] ids) {
        List<Long> id = new ArrayList<>();
        LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
        lqw.in(ids != null, ZfShare::getShareContent, ids)
                .eq(ZfShare::getSysMenuId, 2021L);
        List<ZfShare> zfShares = list(lqw);
        if (zfShares.size() == 0) {
            return true;
        }
        for (ZfShare zfShare : zfShares) {
            id.add(zfShare.getId());
        }
        System.out.println(id);
        if (removeByIds(id)) {
            //删除es中的数据
            zfShares.forEach(zfDoctorDownload -> {
                EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "通讯录分享删除");
                if (esModel != null) {
                    DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId());
                    System.out.println(deleteRequest);
                    try {
                        restHighLevelClient.delete(deleteRequest, RequestOptions.DEFAULT);
                    } catch (IOException e) {
                        throw new RuntimeException(e);
                    }
                }
            });
            return true;
        } else {
            return false;
        }
    }
}
zhang-content/src/main/java/com/ruoyi/service/impl/ZfDoctorDownloadServiceImpl.java
@@ -110,14 +110,29 @@
    }
}
    @Override
    public AjaxResult deleteData(Long[] ids) {
        List<ZfDownload> zfDownloads = listByIds(Arrays.asList(ids));
    public Boolean deleteData(Long[] ids) {
        List<Long> id = new ArrayList<>();
        if (zfDoctorShareService.removeByIds(Arrays.asList(ids))) {
        LambdaQueryWrapper<ZfDownload> lqw = new LambdaQueryWrapper<>();
        lqw.in(ids != null, ZfDownload::getDownloadContent,  ids)
                .eq(ZfDownload::getSysMenuId, 2019L);
        List<ZfDownload> zfDownloads = list(lqw);
        System.out.println(zfDownloads);
        if (zfDownloads.size() == 0){
            return true;
        }
        for (ZfDownload zfDownload: zfDownloads) {
            id.add(zfDownload.getId());
        }
        System.out.println(id);
        if (removeByIds(id)) {
            //删除es中的数据
            zfDownloads.stream().forEach(zfDoctorDownload -> {
                EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "家庭小医生下载");
                EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "家庭小医生下载删除");
                if (esModel != null) {
                    DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId());
@@ -128,9 +143,9 @@
                    }
                }
            });
            return AjaxResult.success();
            return true;
        } else {
            return AjaxResult.error();
            return false;
        }
    }
zhang-content/src/main/java/com/ruoyi/service/impl/ZfDoctorServiceImpl.java
@@ -62,6 +62,9 @@
    @Resource
    ZfDoctorShareService zfDoctorShareService;
    @Resource
    ZfDoctorDownloadService zfDoctorDownloadService;
    @Override
    public AjaxResult selectDoctorList(ZfDoctor zfDoctor, Integer pageNum, Integer pageSize) {
@@ -383,7 +386,9 @@
            }
        }
        List<ZfDoctor> zfDoctors = listByIds(Arrays.asList(ids));
        if (! (zfDoctorDownloadService.deleteData(ids) && zfDoctorShareService.deleteByContentId(ids)  ) ){
            return AjaxResult.error();
        }
        if (zfDoctorService.removeByIds(Arrays.asList(ids))) {
            //删除es中的数据
zhang-content/src/main/java/com/ruoyi/service/impl/ZfDoctorShareServiceImpl.java
@@ -4,19 +4,25 @@
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.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.EsService;
import com.ruoyi.service.ZInfoUserService;
import com.ruoyi.service.ZfDoctorService;
import com.ruoyi.service.ZfDoctorShareService;
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.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -32,6 +38,13 @@
    @Resource
    private ZInfoUserService zInfoUserService;
    @Resource
    private RestHighLevelClient restHighLevelClient;
    @Resource
    EsService esService;
    private LambdaQueryWrapper<ZfShare> uniqueCondition(ZfShare zfShare) {
        LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
@@ -212,4 +225,42 @@
        }
    }
    @Override
    public Boolean deleteByContentId(Long[] ids) {
         List<Long> id = new ArrayList<>();
        LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
        lqw.in(ids != null, ZfShare::getShareContent,  ids)
                .eq(ZfShare::getSysMenuId, 2019L);
        List<ZfShare> zfShares = list(lqw);
        if (zfShares.size() == 0){
            return true;
        }
        for (ZfShare zfShare: zfShares) {
            id.add(zfShare.getId());
        }
        System.out.println(id);
        if (removeByIds(id)) {
            //删除es中的数据
            zfShares.forEach(zfDoctorDownload -> {
                EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "小医生分享删除");
                if (esModel != null) {
                    DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId());
                    System.out.println(deleteRequest);
                    try {
                        restHighLevelClient.delete(deleteRequest, RequestOptions.DEFAULT);
                    } catch (IOException e) {
                        throw new RuntimeException(e);
                    }
                }
            });
            return true;
        } else {
            return false;
        }
    }
}
zhang-content/src/main/java/com/ruoyi/service/impl/ZfEconomyDownlServiceImpl.java
@@ -96,14 +96,29 @@
    }
    @Override
    public AjaxResult deleteData(Long[] ids) {
        List<ZfDownload> zfDownloads = listByIds(Arrays.asList(ids));
    public Boolean deleteData(Long[] ids) {
        List<Long> id = new ArrayList<>();
        if (zfEconomyShaService.removeByIds(Arrays.asList(ids))) {
        LambdaQueryWrapper<ZfDownload> lqw = new LambdaQueryWrapper<>();
        lqw.in(ids != null, ZfDownload::getDownloadContent,  ids)
                .eq(ZfDownload::getSysMenuId, 2023L);
        List<ZfDownload> zfDownloads = list(lqw);
        System.out.println(zfDownloads);
        if (zfDownloads.size() == 0){
            return true;
        }
        for (ZfDownload zfDownload: zfDownloads) {
            id.add(zfDownload.getId());
        }
        System.out.println(id);
        if (removeByIds(id)) {
            //删除es中的数据
            zfDownloads.stream().forEach(zfDoctorDownload -> {
                EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "家庭收支台账下载");
                EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "家庭收支台账下载删除");
                if (esModel != null) {
                    DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId());
@@ -114,9 +129,9 @@
                    }
                }
            });
            return AjaxResult.success();
            return true;
        } else {
            return AjaxResult.error();
            return false;
        }
    }
zhang-content/src/main/java/com/ruoyi/service/impl/ZfEconomyServiceImpl.java
@@ -59,6 +59,12 @@
    @Resource
    RestHighLevelClient restHighLevelClient;
    @Resource
    ZfEconomyShaService zfEconomyShaService;
    @Resource
    ZfEconomyDownlService zfEconomyDownlService;
    private LambdaQueryWrapper<ZfEconomy> buildCondition(ZfEconomy zfEconomy,List<Long> familyIdList) {
        LambdaQueryWrapper<ZfEconomy> lqw = new LambdaQueryWrapper<>();
        lqw.orderByDesc(ZfEconomy::getCreateTime);
@@ -549,7 +555,9 @@
            }
        }
        List<ZfEconomy> zfEconomys = listByIds(Arrays.asList(ids));
        if (! (zfEconomyDownlService.deleteData(ids) && zfEconomyShaService.deleteByContentId(ids)  ) ){
            return AjaxResult.error();
        }
        if (zfEconomyService.removeByIds(Arrays.asList(ids))) {
            //删除es中的数据
zhang-content/src/main/java/com/ruoyi/service/impl/ZfEconomySharServiceImpl.java
@@ -5,6 +5,7 @@
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.core.domain.entity.SysUser;
import com.ruoyi.common.utils.MapUtils;
import com.ruoyi.common.utils.SecurityUtils;
@@ -13,9 +14,13 @@
import com.ruoyi.mapper.ZfShareMapper;
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.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -29,6 +34,12 @@
    @Resource
    private ZInfoUserService zInfoUserService;
    @Resource
    private RestHighLevelClient restHighLevelClient;
    @Resource
    EsService esService;
    private LambdaQueryWrapper<ZfShare> uniqueCondition(ZfShare zfShare) {
        LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
@@ -185,5 +196,40 @@
            return null;
        }
    }
    @Override
    public Boolean deleteByContentId(Long[] ids) {
        List<Long> id = new ArrayList<>();
        LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
        lqw.in(ids != null, ZfShare::getShareContent, ids)
                .eq(ZfShare::getSysMenuId, 2023L);
        List<ZfShare> zfShares = list(lqw);
        if (zfShares.size() == 0) {
            return true;
        }
        for (ZfShare zfShare : zfShares) {
            id.add(zfShare.getId());
        }
        System.out.println(id);
        if (removeByIds(id)) {
            //删除es中的数据
            zfShares.forEach(zfDoctorDownload -> {
                EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "家庭台账收支分享删除");
                if (esModel != null) {
                    DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId());
                    System.out.println(deleteRequest);
                    try {
                        restHighLevelClient.delete(deleteRequest, RequestOptions.DEFAULT);
                    } catch (IOException e) {
                        throw new RuntimeException(e);
                    }
                }
            });
            return true;
        } else {
            return false;
        }
    }
}
zhang-content/src/main/java/com/ruoyi/service/impl/ZfEquipDownloadServiceImpl.java
@@ -96,14 +96,29 @@
    }
    @Override
    public AjaxResult deleteData(Long[] ids) {
        List<ZfDownload> zfDownloads = listByIds(Arrays.asList(ids));
    public Boolean deleteData(Long[] ids) {
        List<Long> id = new ArrayList<>();
        if (zfEquipShareService.removeByIds(Arrays.asList(ids))) {
        LambdaQueryWrapper<ZfDownload> lqw = new LambdaQueryWrapper<>();
        lqw.in(ids != null, ZfDownload::getDownloadContent,  ids)
                .eq(ZfDownload::getSysMenuId, 2017L);
        List<ZfDownload> zfDownloads = list(lqw);
        System.out.println(zfDownloads);
        if (zfDownloads.size() == 0){
            return true;
        }
        for (ZfDownload zfDownload: zfDownloads) {
            id.add(zfDownload.getId());
        }
        System.out.println("15102120202121212122222222221");
        System.out.println(id);
        if (removeByIds(id)) {
            System.out.println("4535468486525852");
            //删除es中的数据
            zfDownloads.stream().forEach(zfDoctorDownload -> {
                EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "家庭设备下载");
                EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "家庭设备下载删除" );
                if (esModel != null) {
                    DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId());
@@ -114,9 +129,9 @@
                    }
                }
            });
            return AjaxResult.success();
            return true;
        } else {
            return AjaxResult.error();
            return false;
        }
    }
zhang-content/src/main/java/com/ruoyi/service/impl/ZfEquipShareServiceImpl.java
@@ -5,20 +5,22 @@
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.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.ZfEconomyService;
import com.ruoyi.service.ZfEquipShareService;
import com.ruoyi.service.ZfEquipmentService;
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.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -32,6 +34,14 @@
    @Resource
    private ZInfoUserService zInfoUserService;
    @Resource
    private RestHighLevelClient restHighLevelClient;
    @Resource
    EsService esService;
    private LambdaQueryWrapper<ZfShare> uniqueCondition(ZfShare zfShare) {
        LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
@@ -189,4 +199,41 @@
        }
    }
    @Override
    public Boolean deleteByContentId(Long[] ids) {
        List<Long> id = new ArrayList<>();
        LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
        lqw.in(ids != null, ZfShare::getShareContent,  ids)
                .eq(ZfShare::getSysMenuId, 2017L);
        List<ZfShare> zfShares = list(lqw);
        if (zfShares.size() == 0){
            return true;
        }
        for (ZfShare zfShare: zfShares) {
            id.add(zfShare.getId());
        }
        System.out.println(id);
        if (removeByIds(id)) {
            //删除es中的数据
            zfShares.forEach(zfDoctorDownload -> {
                EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "家大事记分享删除");
                if (esModel != null) {
                    DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId());
                    System.out.println(deleteRequest);
                    try {
                        restHighLevelClient.delete(deleteRequest, RequestOptions.DEFAULT);
                    } catch (IOException e) {
                        throw new RuntimeException(e);
                    }
                }
            });
            return true;
        } else {
            return false;
        }
    }
}
zhang-content/src/main/java/com/ruoyi/service/impl/ZfEquipmentServiceImpl.java
@@ -56,6 +56,12 @@
    @Resource
    private RestHighLevelClient restHighLevelClient;
    @Resource
    private ZfEquipShareService zfEquipShareService;
    @Resource
    private ZfEquipDownloadService zfEquipDownloadService;
    private LambdaQueryWrapper<ZfEquipment> buildCondition(ZfEquipment zfEquipment,List<Long> familyIdList) {
        LambdaQueryWrapper<ZfEquipment> lqw = new LambdaQueryWrapper<>();
        lqw.orderByDesc(ZfEquipment::getCreateTime);
@@ -589,6 +595,9 @@
        }
        List<ZfEquipment> zfEquipments = listByIds(Arrays.asList(ids));
        if (! (zfEquipDownloadService.deleteData(ids) && zfEquipShareService.deleteByContentId(ids)  ) ){
            return AjaxResult.error();
        }
        if (zfEquipmentService.removeByIds(Arrays.asList(ids))) {
@@ -604,6 +613,7 @@
                    }
                }
            });
            return AjaxResult.success();
        }else {
            return AjaxResult.error();
zhang-content/src/main/java/com/ruoyi/service/impl/ZfEventDownloadServiceImpl.java
@@ -81,7 +81,7 @@
            String uuid = UUID.randomUUID().toString().replace("-", "");
            esModel.setId(uuid);
            esModel.setCtId(Long.valueOf(inte));
            esModel.setCtTableName("家庭小医生");
            esModel.setCtTableName("家大事记");
            esModel.setBy1(String.valueOf(zfDownload.getDownloadId()));
            esModel.setBy2(String.valueOf(zfDownload.getDownloadContent()));
@@ -95,17 +95,30 @@
    }
    @Override
    public AjaxResult deleteData(Long[] ids) {
        List<ZfDownload> zfDownloads = listByIds(Arrays.asList(ids));
    public Boolean deleteData(Long[] ids) {
        List<Long> id = new ArrayList<>();
        if (zfEventShareService.removeByIds(Arrays.asList(ids))) {
        LambdaQueryWrapper<ZfDownload> lqw = new LambdaQueryWrapper<>();
            lqw.in(ids != null, ZfDownload::getDownloadContent,  ids)
                    .eq(ZfDownload::getSysMenuId, 2013L);
        List<ZfDownload> zfDownloads = list(lqw);
        System.out.println(zfDownloads);
        if (zfDownloads.size() == 0){
            return true;
        }
        for (ZfDownload zfDownload: zfDownloads) {
            id.add(zfDownload.getId());
        }
        System.out.println(id);
        if (removeByIds(id)) {
            //删除es中的数据
            zfDownloads.stream().forEach(zfDoctorDownload -> {
                EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "家庭小医生下载");
            zfDownloads.forEach(zfDoctorDownload -> {
                EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "家大事记下载删除");
                if (esModel != null) {
                    DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId());
                    System.out.println(deleteRequest);
                    try {
                        restHighLevelClient.delete(deleteRequest, RequestOptions.DEFAULT);
                    } catch (IOException e) {
@@ -113,9 +126,9 @@
                    }
                }
            });
            return AjaxResult.success();
            return true;
        } else {
            return AjaxResult.error();
            return false;
        }
    }
zhang-content/src/main/java/com/ruoyi/service/impl/ZfEventServiceImpl.java
@@ -55,6 +55,12 @@
    private EsService esSer;
    @Resource
    private ZfEventDownloadService zfEventDownloadService;
    @Resource
    private ZfEventShareService zfEventShareService;
    @Resource
    private RestHighLevelClient restHighLevelClient;
    private LambdaQueryWrapper<ZfEvent> buildCondition(ZfEvent zfEvent,List<Long> familyIdList) {
        LambdaQueryWrapper<ZfEvent> lqw = new LambdaQueryWrapper<>();
@@ -567,9 +573,11 @@
        }
        List<ZfEvent> zfEvents = listByIds(Arrays.asList(ids));
        if (! (zfEventDownloadService.deleteData(ids) && zfEventShareService.deleteByContentId(ids)  ) ){
            return AjaxResult.error();
        }
        if (zfEventService.removeByIds(Arrays.asList(ids))) {
            //删除es中的数据
            zfEvents.stream().forEach(zfEvent -> {
                EsModel esModel = esSer.findByCtId(zfEvent.getId(), "家大事记");
@@ -583,6 +591,7 @@
                }
            });
            return AjaxResult.success();
        }else {
            return AjaxResult.error();
zhang-content/src/main/java/com/ruoyi/service/impl/ZfEventShareServiceImpl.java
@@ -4,20 +4,22 @@
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.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.ZfDoctorShareService;
import com.ruoyi.service.ZfEventService;
import com.ruoyi.service.ZfEventShareService;
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.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -36,6 +38,12 @@
    @Resource
    private ZInfoUserService zInfoUserService;
    @Resource
    private RestHighLevelClient restHighLevelClient;
    @Resource
    EsService esService;
    private LambdaQueryWrapper<ZfShare> uniqueCondition(ZfShare zfShare) {
@@ -193,4 +201,42 @@
            return null;
        }
    }
    @Override
    public Boolean deleteByContentId(Long[] ids) {
        List<Long> id = new ArrayList<>();
        LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
        lqw.in(ids != null, ZfShare::getShareContent,  ids)
                .eq(ZfShare::getSysMenuId, 2013L);
        List<ZfShare> zfShares = list(lqw);
        if (zfShares.size() == 0){
            return true;
        }
        for (ZfShare zfShare: zfShares) {
            id.add(zfShare.getId());
        }
        System.out.println(id);
        if (removeByIds(id)) {
            //删除es中的数据
            zfShares.forEach(zfDoctorDownload -> {
                EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "家大事记分享删除");
                if (esModel != null) {
                    DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId());
                    System.out.println(deleteRequest);
                    try {
                        restHighLevelClient.delete(deleteRequest, RequestOptions.DEFAULT);
                    } catch (IOException e) {
                        throw new RuntimeException(e);
                    }
                }
            });
            return true;
        } else {
            return false;
        }
    }
}
zhang-content/src/main/java/com/ruoyi/service/impl/ZfPetDownServiceImpl.java
@@ -96,14 +96,29 @@
    }
    @Override
    public AjaxResult deleteData(Long[] ids) {
        List<ZfDownload> zfDownloads = listByIds(Arrays.asList(ids));
    public Boolean deleteData(Long[] ids) {
        List<Long> id = new ArrayList<>();
        if (zfPetService.removeByIds(Arrays.asList(ids))) {
        LambdaQueryWrapper<ZfDownload> lqw = new LambdaQueryWrapper<>();
        lqw.in(ids != null, ZfDownload::getDownloadContent,  ids)
                .eq(ZfDownload::getSysMenuId, 2022L);
        List<ZfDownload> zfDownloads = list(lqw);
        System.out.println(zfDownloads);
        if (zfDownloads.size() == 0){
            return true;
        }
        for (ZfDownload zfDownload: zfDownloads) {
            id.add(zfDownload.getId());
        }
        System.out.println(id);
        if (removeByIds(id)) {
            //删除es中的数据
            zfDownloads.stream().forEach(zfDoctorDownload -> {
                EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "通讯录下载");
                EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "通讯录下载删除");
                if (esModel != null) {
                    DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId());
@@ -114,9 +129,9 @@
                    }
                }
            });
            return AjaxResult.success();
            return true;
        } else {
            return AjaxResult.error();
            return false;
        }
    }
zhang-content/src/main/java/com/ruoyi/service/impl/ZfPetServiceImpl.java
@@ -49,6 +49,12 @@
    
    @Resource
    ZAuthorityService zAuthorityService;
    @Resource
    ZfPetSharService zfPetSharService;
    @Resource
    ZfPetDownlService zfPetDownlService;
    @Override
    public AjaxResult selectDataList(ZfPet zfPet, Integer pageNum, Integer pageSize) {
//        LambdaQueryWrapper<ZfPet> lqw = buildCondition(zfPet);
@@ -266,6 +272,9 @@
                throw new RuntimeException("你没有权限操作此家庭的数据");
            }
        }
        if (! (zfPetDownlService.deleteData(ids) && zfPetSharService.deleteByContentId(ids)  ) ){
            return AjaxResult.error();
        }
        if (zfPetService.removeByIds(Arrays.asList(ids))) {
            return AjaxResult.success();
zhang-content/src/main/java/com/ruoyi/service/impl/ZfPetSharServiceImpl.java
@@ -5,20 +5,22 @@
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.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.TravelDetailService;
import com.ruoyi.service.ZInfoUserService;
import com.ruoyi.service.ZfPetService;
import com.ruoyi.service.ZfPetSharService;
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.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -34,6 +36,12 @@
    @Resource
    private ZInfoUserService zInfoUserService;
    @Resource
    private RestHighLevelClient restHighLevelClient;
    @Resource
    EsService esService;
    private LambdaQueryWrapper<ZfShare> uniqueCondition(ZfShare zfShare) {
        LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
        lqw.eq(StringUtils.isNotEmpty(String.valueOf(zfShare.getShareId())), ZfShare::getShareId, zfShare.getShareId());
@@ -48,26 +56,24 @@
        Long userId = user.getUserId();
        LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
        lqw.eq(ZfShare::getShareId,userId);
        lqw.eq(ZfShare::getShareId, userId);
        return list(lqw);
    }
    public Long getUserId(){
    public Long getUserId() {
        ZInfoUser myself = zInfoUserService.getMyself();
        return myself.getUserId();
    }
    public void addData(ZfShare za)
    {
    public void addData(ZfShare za) {
        LambdaQueryWrapper<ZfShare> lqw = uniqueCondition(za);
        List<ZfShare> list = list(lqw);
        if(list.size()>0){
        if (list.size() > 0) {
            throw new RuntimeException("请勿分享重复数据");
        }
        else {
        } else {
            save(za);
        }
@@ -75,8 +81,8 @@
    @Override
    public AjaxResult saveZa(ShareMore shareMore) {
        Long [] shareIds = shareMore.getShareIds();
        Long [] shareContents =  shareMore.getShareContents();
        Long[] shareIds = shareMore.getShareIds();
        Long[] shareContents = shareMore.getShareContents();
        for (Long shareId : shareIds) {
            for (Long shareContent : shareContents) {
                ZfShare za = new ZfShare();
@@ -94,39 +100,38 @@
    @Override
    public AjaxResult listByFidAid(ShareMore shareMore, Integer pageNo, Integer pageSize) {
        Long [] shareIds = shareMore.getShareIds();
        Long[] shareIds = shareMore.getShareIds();
        List<ZfPet> beanRecord3 = new ArrayList<>();
        for (Long shareId : shareIds) {
            {
                LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
                lqw.eq(ZfShare::getShareId,shareId)
                        .eq(ZfShare::getSysMenuId,shareMore.getSysMenuId())
                lqw.eq(ZfShare::getShareId, shareId)
                        .eq(ZfShare::getSysMenuId, shareMore.getSysMenuId())
                        .eq(ZfShare::getUserId, getUserId());
                List<ZfShare> beanRecords = list(lqw);
                for (ZfShare beanRecord : beanRecords ) {
                for (ZfShare beanRecord : beanRecords) {
                    beanRecord3.add(zfPetService.getById(beanRecord.getShareContent()));
                }
            }
        }
        List<ZfPet>  record =  beanRecord3.stream().skip((pageNo-1)*pageSize).limit(pageSize).collect(Collectors.toList());
        List<ZfPet> record = beanRecord3.stream().skip((pageNo - 1) * pageSize).limit(pageSize).collect(Collectors.toList());
        int totalPage = (beanRecord3.size() -1) / pageSize +1;
        int totalPage = (beanRecord3.size() - 1) / pageSize + 1;
        Page<ZfPet> zfPetPage = new Page<>(pageNo, pageSize,totalPage);
        HashMap<String, Object> data = MapUtils.getShareResult(zfPetPage, record,beanRecord3.size());
        Page<ZfPet> zfPetPage = new Page<>(pageNo, pageSize, totalPage);
        HashMap<String, Object> data = MapUtils.getShareResult(zfPetPage, 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)
            {
        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)
                lqw.eq(ZfShare::getShareId, shareId)
                        .eq(ZfShare::getShareContent, shareContent)
                        .eq(ZfShare::getSysMenuId, shareMore.getSysMenuId())
                        .eq(ZfShare::getUserId, getUserId());
@@ -139,15 +144,15 @@
    @Override
    public AjaxResult listByUserId() {
        HashMap<Long,List<ZfPet>>  bs = new HashMap<>();
        HashMap<Long, List<ZfPet>> bs = new HashMap<>();
        LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
        lqw.eq(ZfShare::getShareId,getUserId());
        lqw.eq(ZfShare::getSysMenuId,2022L);
        lqw.eq(ZfShare::getShareId, getUserId());
        lqw.eq(ZfShare::getSysMenuId, 2022L);
        List<ZfShare> beanRecords = list(lqw);
        List<ZfPet> b1 = new ArrayList<>();
        for (ZfShare beanRecord : beanRecords ) {
        for (ZfShare beanRecord : beanRecords) {
            b1.add(zfPetService.getById(beanRecord.getShareContent()));
            bs.put(beanRecord.getUserId(),b1);
            bs.put(beanRecord.getUserId(), b1);
        }
        log.info("从数据库中查到的为:{}", bs);
        return AjaxResult.success(bs);
@@ -155,23 +160,23 @@
    @Override
    public AjaxResult listUserId(Integer pageNo, Integer pageSize) {
        List<ZfPet>  bs = new ArrayList<>();
        List<ZfPet> bs = new ArrayList<>();
        LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
        lqw.eq(ZfShare::getShareId,getUserId());
        lqw.eq(ZfShare::getSysMenuId,2022L);
        lqw.eq(ZfShare::getShareId, getUserId());
        lqw.eq(ZfShare::getSysMenuId, 2022L);
        List<ZfShare> beanRecords = list(lqw);
        for (ZfShare beanRecord : beanRecords ) {
        for (ZfShare beanRecord : beanRecords) {
            ZfPet bs2 = zfPetService.getById(beanRecord.getShareContent());
            bs2.setShareId(beanRecord.getUserId().intValue());
            bs.add(bs2);
        }
        log.info("从数据库中查到的为:{}", bs);
        List<ZfPet>  record = bs.stream().skip((pageNo-1)*pageSize).limit(pageSize).collect(Collectors.toList());
        List<ZfPet> record = bs.stream().skip((pageNo - 1) * pageSize).limit(pageSize).collect(Collectors.toList());
        int totalPage = (bs.size() -1) / pageSize +1;
        int totalPage = (bs.size() - 1) / pageSize + 1;
        Page<ZfPet> zfPetPage = new Page<>(pageNo, pageSize,totalPage);
        HashMap<String, Object> data = MapUtils.getShareResult(zfPetPage, record,bs.size());
        Page<ZfPet> zfPetPage = new Page<>(pageNo, pageSize, totalPage);
        HashMap<String, Object> data = MapUtils.getShareResult(zfPetPage, record, bs.size());
        return AjaxResult.success(data);
    }
@@ -182,11 +187,47 @@
                .eq(ZfShare::getShareContent, zfDownload.getDownloadContent())
                .eq(ZfShare::getSysMenuId, zfDownload.getSysMenuId());
        List<ZfShare> beanRecords = list(lqw);
        if (beanRecords.size() != 0){
        if (beanRecords.size() != 0) {
            return beanRecords.get(0).getUserId();
        }
        else {
        } else {
            return null;
        }
    }
    @Override
    public Boolean deleteByContentId(Long[] ids) {
        List<Long> id = new ArrayList<>();
        LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
        lqw.in(ids != null, ZfShare::getShareContent, ids)
                .eq(ZfShare::getSysMenuId, 2022L);
        List<ZfShare> zfShares = list(lqw);
        if (zfShares.size() == 0) {
            return true;
        }
        for (ZfShare zfShare : zfShares) {
            id.add(zfShare.getId());
        }
        System.out.println(id);
        if (removeByIds(id)) {
            //删除es中的数据
            zfShares.forEach(zfDoctorDownload -> {
                EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "宠物分享删除");
                if (esModel != null) {
                    DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId());
                    System.out.println(deleteRequest);
                    try {
                        restHighLevelClient.delete(deleteRequest, RequestOptions.DEFAULT);
                    } catch (IOException e) {
                        throw new RuntimeException(e);
                    }
                }
            });
            return true;
        } else {
            return false;
        }
    }
}