双重预防项目-国泰新华二开定制版
马宇豪
2023-08-25 aa2051a2327c079105110f5424f3a44ffaa0c7bb
src/main/java/com/ruoyi/project/tr/hiddenDangerCheck/controller/DangerAcceptController.java
@@ -4,6 +4,7 @@
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.StringUtils;
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;
@@ -14,6 +15,7 @@
import com.ruoyi.project.tr.hiddenDangerCheckPoint.service.IHiddenDangerCheckPointService;
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.*;
@@ -32,6 +34,9 @@
    @Autowired
    private IHiddenDangerCheckPointService hiddenDangerCheckPointService;
    @Autowired
    private RiskService riskService;
    @GetMapping()
    public String hiddenDangerCheckPoint() {
@@ -70,6 +75,7 @@
    @Log(title = "隐患验收--保存", businessType = BusinessType.UPDATE)
    @PostMapping("/editDangerAcceptSave")
    @ResponseBody
    @Transactional
    public AjaxResult editDangerAcceptSave(HiddenDangerCheckPoint hiddenDangerCheckPoint) {
        //获取当前更新用户信息
        User sysUser = getSysUser();
@@ -88,6 +94,13 @@
            }
        }
        int i = hiddenDangerCheckPointService.updateHiddenDangerCheckPoint(hiddenDangerCheckPoint);
        // todo-2022 验收通过,修改为已验收状态
        int result = riskService.updateDangerInfoAccept(hiddenDangerCheckPoint);
        if (result < 1){
            throw new RuntimeException("隐患验收信息保存失败");
        }
        hiddenDangerCheckPointService.getTaskCountTotal(getSysUser().getUserId());//查询未执行任务总数量并推送
        return toAjax(i);
    }