双重预防项目-国泰新华二开定制版
heheng
2025-04-15 7be0d5b901b999d2347774df3cc1a64927838bb3
src/main/java/com/ruoyi/project/tr/hiddenDangerCheck/controller/DangerReportController.java
@@ -8,6 +8,7 @@
import com.ruoyi.doublePrevention.entity.PreventRiskDangerInfo;
import com.ruoyi.doublePrevention.entity.dto.resp.PreventRiskUnitCodeAndNameListQueryRespDTO;
import com.ruoyi.doublePrevention.service.RiskService;
import com.ruoyi.doublePrevention.service.baseService.PreventRiskDangerConfirmLogService;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.controller.BaseController;
@@ -57,6 +58,9 @@
    @Autowired
    private RiskService riskService;
    @Autowired
    private PreventRiskDangerConfirmLogService confirmLogService;
    @GetMapping()
    public String hiddenDangerCheck(ModelMap mmap) {
@@ -158,6 +162,12 @@
    @ResponseBody
    @Transactional
    public AjaxResult addDangerReportSave(HiddenDangerCheckPoint hdcp) {
        if (ObjectUtils.isEmpty(hdcp.getCheckPerson())){
            throw new RuntimeException("检查人不能为空");
        }
        if (ObjectUtils.isEmpty(hdcp.getFindTime())){
            throw new RuntimeException("发现时间不能为空");
        }
        HiddenDangerCheck hiddenDangerCheck  = new HiddenDangerCheck();
        hiddenDangerCheck.setCreateBy(ShiroUtils.getLoginName());//创建者
        hiddenDangerCheck.setCreateTime(DateUtils.getNowDate());//获取创建时间
@@ -230,7 +240,12 @@
        HiddenDangerCheck hiddenDangerCheck  = new HiddenDangerCheck();
//        hiddenDangerCheck.setCreateBy(ShiroUtils.getLoginName());//创建者
//        hiddenDangerCheck.setCreateTime(DateUtils.getNowDate());//获取创建时间
        if (ObjectUtils.isEmpty(hdcp.getCheckPerson())){
            throw new RuntimeException("检查人不能为空");
        }
        if (ObjectUtils.isEmpty(hdcp.getFindTime())){
            throw new RuntimeException("发现时间不能为空");
        }
        hiddenDangerCheck.setCreateBy(ShiroUtils.getLoginName());//创建者
        hiddenDangerCheck.setCreateTime(hdcp.getRectifyCreateTime());//获取创建时间
@@ -276,7 +291,6 @@
                hdcp.setExamineStatus(TrHiddenDangerCheckConstants.EXAMINE_STATUS_NOT_EXAMINE);//核查状态(待核查)
            }
        }
        //2.全流程隐患提交信息封装-未操作
        //隐患核查
@@ -292,7 +306,6 @@
            }
        }
        //3.全流程隐患核查信息封装-未操作
        //隐患整改
//        hdcp.setRectifyCreateTime(DateUtils.getNowDate());//设置整改时间
@@ -340,11 +353,6 @@
    /**
     * 修改隐患上报
     */
@@ -354,11 +362,13 @@
        // todo-2022 修改前查询
        PreventRiskDangerInfo dangerInfo = riskService.getDangerInfoById(hdcp.getId());
        hdcp.setHazardCode(dangerInfo.getHazardCode());
        hdcp.setDangerSrc(dangerInfo.getDangerSrc());
        hdcp.setDangerReason(dangerInfo.getDangerReason());
        hdcp.setHazardDangerType(dangerInfo.getHazardDangerType());
        hdcp.setDangerResult(dangerInfo.getDangerResult());
        if (ObjectUtils.isNotEmpty(dangerInfo)){
            hdcp.setHazardCode(dangerInfo.getHazardCode());
            hdcp.setDangerSrc(dangerInfo.getDangerSrc());
            hdcp.setDangerReason(dangerInfo.getDangerReason());
            hdcp.setHazardDangerType(dangerInfo.getHazardDangerType());
            hdcp.setDangerResult(dangerInfo.getDangerResult());
        }
        mmap.put("hiddenDangerCheckPoint", hdcp);
@@ -442,7 +452,6 @@
    /**
     * 修改判定隐患上报保存
     * todo-2022 隐患核查(判定隐患) 以判定的隐患,才需要上报
     */
    @Log(title = "修改判定隐患上报保存", businessType = BusinessType.UPDATE)
    @PostMapping("/editJudgeDangerReportSave")
@@ -461,7 +470,7 @@
                hiddenDangerCheckPoint.setStage(TrHiddenDangerCheckConstants.DANGER_STAGE_PLAN_EXAMINE);//隐患核查阶段(数据进入到隐患核查阶段)
                hiddenDangerCheckPoint.setExamineStatus(TrHiddenDangerCheckConstants.EXAMINE_STATUS_NOT_EXAMINE);//核查状态(待核查)
//                // todo-2022 隐患信息判定
//                //
//                int result = riskService.updateDangerInfoJudge(hiddenDangerCheckPoint);
//                if (result < 1){
//                    throw new RuntimeException("整改信息保存失败");
@@ -471,6 +480,11 @@
        }
        int i = hiddenDangerCheckPointService.updateHiddenDangerCheckPoint(hiddenDangerCheckPoint);
        int result = confirmLogService.saveConfirmLog(hiddenDangerCheckPoint);
        if (result < 1){
            return AjaxResult.error("操作失败");
        }
        hiddenDangerCheckPointService.getTaskCountTotal(getSysUser().getUserId());//查询未执行任务总数量并推送
        return toAjax(i);