zqy
5 天以前 b02beccf4567068cb47a3f1181a00039456c872d
zhang-content/src/main/java/com/ruoyi/service/impl/ZfCollectionDownlServiceImpl.java
@@ -1,5 +1,6 @@
package com.ruoyi.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -93,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());
@@ -111,9 +125,9 @@
                    }
                }
            });
            return AjaxResult.success();
            return true;
        } else {
            return AjaxResult.error();
            return false;
        }
    }
@@ -138,4 +152,5 @@
        HashMap<String, Object> data = MapUtils.getShareResult(zfCollectionPage, record,bs.size());
        return AjaxResult.success(data);
    }
}