双重预防项目-国泰新华二开定制版
16639036659
2022-09-27 7e7195766eb018b4ba00b2d0663f6dcb11adefc8
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);
    }