双重预防项目-国泰新华二开定制版
16639036659
2022-10-31 bec2f0453d651e8b567ba14c596eca452526a2bd
src/main/java/com/ruoyi/project/tr/hiddenDangerCheck/controller/DangerReportController.java
@@ -5,6 +5,7 @@
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.service.RiskService;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
@@ -19,6 +20,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;
@@ -91,6 +93,7 @@
        hiddenDangerCheckPoint.setJudgeQueryByUserIdList(userIdList);//隐患整改人ID 为登陆账号companyId下的userId的
        startPage();
        List<HiddenDangerCheckPoint> list = hiddenDangerCheckPointService.selectHiddenDangerCheckPointList(hiddenDangerCheckPoint);
        return getDataTable(list);
    }
@@ -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);
    }
    /**
@@ -336,6 +354,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);
        //获取所在公司人员信息