From b47b351ba838b9ca0c70fae7cc3a64d4026e7356 Mon Sep 17 00:00:00 2001
From: Your Name <123456>
Date: 星期五, 11 十一月 2022 14:59:38 +0800
Subject: [PATCH] controller中首页调用方法

---
 src/main/java/com/ruoyi/project/tr/hiddenDangerCheck/controller/DangerScheduleController.java |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/src/main/java/com/ruoyi/project/tr/hiddenDangerCheck/controller/DangerScheduleController.java b/src/main/java/com/ruoyi/project/tr/hiddenDangerCheck/controller/DangerScheduleController.java
index 67c1a5a..cf7d7e7 100644
--- a/src/main/java/com/ruoyi/project/tr/hiddenDangerCheck/controller/DangerScheduleController.java
+++ b/src/main/java/com/ruoyi/project/tr/hiddenDangerCheck/controller/DangerScheduleController.java
@@ -6,6 +6,7 @@
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.common.utils.security.ShiroUtils;
+import com.ruoyi.doublePrevention.service.RiskService;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
 import com.ruoyi.framework.web.controller.BaseController;
@@ -32,6 +33,7 @@
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.ui.ModelMap;
 import org.springframework.web.bind.annotation.*;
 
@@ -72,6 +74,9 @@
 
     @Autowired
     private IRoleService roleService;
+
+    @Autowired
+    private RiskService riskService;
 
     @GetMapping()
     public String hiddenDangerCheck(ModelMap mmap) {
@@ -536,8 +541,18 @@
     @Log(title = "删除定时隐患排查", businessType = BusinessType.DELETE)
     @PostMapping("/remove")
     @ResponseBody
+    @Transactional
     public AjaxResult remove(String ids) {
-        return toAjax(hiddenDangerCheckService.deleteHiddenDangerCheckByIds(ids));
+        //老代码
+        int result = hiddenDangerCheckService.deleteHiddenDangerCheckByIds(ids);
+
+        // todo-2022 删除定时核查任务 新代码添加
+        int result1 = riskService.deleteDangerCheck(ids);
+        if (result1 < 1){
+            throw new RuntimeException("删除核查任务附属表失败");
+        }
+
+        return toAjax(result);
     }
 
 

--
Gitblit v1.9.2