From ca054d1db9256bc8d367486b0d78e89cd4fd7fdb Mon Sep 17 00:00:00 2001
From: zqy <2522236926@qq.com>
Date: 星期二, 22 十月 2024 20:41:10 +0800
Subject: [PATCH] 删除时会连着分享和下载的数据一起删掉

---
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZPropertyController.java |   18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZPropertyController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZPropertyController.java
index 8b60c42..f8f393f 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZPropertyController.java
+++ b/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.*;
@@ -39,6 +41,12 @@
     @Autowired
     private ZPropertyService zPropertyService;
 
+    @Autowired
+    private ZPropertyDownloadService zPropertyDownloadService;
+
+    @Autowired
+    private ZPropertyShareService zPropertyShareService;
+
     /**
      * 鏌ヨ鎵�鏈夎褰�
      */
@@ -47,6 +55,11 @@
         Integer pageNum = Convert.toInt(ServletUtils.getParameter(PAGE_NUM), 1);
         Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
         return zPropertyService.selectDataList(zProperty,pageNum,pageSize);
+    }
+
+    @GetMapping("/type")
+    public AjaxResult listType(){
+        return zPropertyService.listType();
     }
 
     /**
@@ -60,7 +73,7 @@
     /**
      * 妯℃澘
      */
-    @GetMapping("/model")
+    @PostMapping("/model")
     public void getModel(HttpServletResponse response){
         ZProperty zProperty = new ZProperty();
         List<ZProperty> emptyList = Collections.singletonList(zProperty);
@@ -132,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)));
     }
 

--
Gitblit v1.9.1