双重预防项目-国泰新华二开定制版
16639036659
2023-03-13 d22c9af5a9e461ebabd9ef6c776a66f238940fe0
src/main/java/com/ruoyi/project/tr/hiddenDangerCheck/controller/DangerReportController.java
@@ -5,6 +5,8 @@
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.security.ShiroUtils;
import com.ruoyi.doublePrevention.entity.PreventRiskDangerInfo;
import com.ruoyi.doublePrevention.entity.dto.resp.PreventRiskUnitCodeAndNameListQueryRespDTO;
import com.ruoyi.doublePrevention.service.RiskService;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
@@ -19,6 +21,7 @@
import com.ruoyi.project.tr.hiddenDangerCheckPoint.service.IHiddenDangerCheckPointService;
import com.ruoyi.project.tr.hiddenTroubleType.domain.HiddenTroubleType;
import com.ruoyi.project.tr.hiddenTroubleType.service.IHiddenTroubleTypeService;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
@@ -107,7 +110,22 @@
        // 第二:1.隐患上报创建人(register_user_id) 或者 2.(判定人(judge_user_id),report_status 不为null )------为本登录帐号userId的
        hiddenDangerCheckPoint.setJudgeQueryByUserId(getSysUser().getUserId());
        List<HiddenDangerCheckPoint> list = hiddenDangerCheckPointService.selectHiddenDangerCheckPointList(hiddenDangerCheckPoint);
        return getDataTable(list);
        List<HiddenDangerCheckPoint> resultList = new ArrayList<>();
        for (HiddenDangerCheckPoint dangerCheckPoint : list) {
            // todo-2022 修改前查询
            PreventRiskDangerInfo dangerInfo = riskService.getDangerInfoById(dangerCheckPoint.getId());
            if (ObjectUtils.isNotEmpty(dangerInfo)){
                dangerCheckPoint.setHazardCode(dangerInfo.getHazardCode());
                dangerCheckPoint.setDangerSrc(dangerInfo.getDangerSrc());
                dangerCheckPoint.setDangerReason(dangerInfo.getDangerReason());
                dangerCheckPoint.setHazardDangerType(dangerInfo.getHazardDangerType());
                dangerCheckPoint.setDangerResult(dangerInfo.getDangerResult());
            }
            resultList.add(dangerCheckPoint);
        }
        return getDataTable(resultList);
    }
    /**
@@ -129,7 +147,8 @@
        hiddenTroubleType.setCompanyId(sysUser.getCompanyId());
        List<HiddenTroubleType> hiddenTroubleTypeList = hiddenTroubleTypeService.selectHiddenTroubleTypeList(hiddenTroubleType);
        mmap.put("hiddenTroubleTypeList", hiddenTroubleTypeList);
        List<PreventRiskUnitCodeAndNameListQueryRespDTO> respDTOS = riskService.listRiskUnitCodeAndName();
        mmap.put("riskUnits", respDTOS);
        return prefix + "/addDangerReport";
    }
@@ -336,6 +355,15 @@
    @GetMapping("/editDangerReport/{id}")
    public String editDangerReport(@PathVariable("id") Long id, ModelMap mmap) {
        HiddenDangerCheckPoint hdcp = hiddenDangerCheckPointService.selectHiddenDangerCheckPointById(id);
        // 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());
        mmap.put("hiddenDangerCheckPoint", hdcp);
        //获取所在公司人员信息