双重预防项目-国泰新华二开定制版
16639036659
2022-10-11 7e8d51b6a2d2892c8eca2c8cefd91f7d1b6f8f40
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();
@@ -85,9 +91,17 @@
            } else if ("1".equals(hiddenDangerCheckPoint.getAcceptResult())) {
                hiddenDangerCheckPoint.setAcceptCreateTime(DateUtils.getNowDate());//设置验收时间
                hiddenDangerCheckPoint.setAcceptStatus(TrHiddenDangerCheckConstants.ACCEPT_STATUS_ALREADY_ACCEPT_PASS);//验收状态(验收通过)
            }
        }
        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);
    }