From ca054d1db9256bc8d367486b0d78e89cd4fd7fdb Mon Sep 17 00:00:00 2001 From: zqy <2522236926@qq.com> Date: 星期二, 22 十月 2024 20:41:10 +0800 Subject: [PATCH] 删除时会连着分享和下载的数据一起删掉 --- zhang-content/src/main/java/com/ruoyi/service/impl/ZfEquipmentServiceImpl.java | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/zhang-content/src/main/java/com/ruoyi/service/impl/ZfEquipmentServiceImpl.java b/zhang-content/src/main/java/com/ruoyi/service/impl/ZfEquipmentServiceImpl.java index efac001..dcdcb16 100644 --- a/zhang-content/src/main/java/com/ruoyi/service/impl/ZfEquipmentServiceImpl.java +++ b/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(); -- Gitblit v1.9.1