From 574ca20940dec24f836ef9ae25b14de55d128efe Mon Sep 17 00:00:00 2001
From: 16639036659 <577530412@qq.com>
Date: 星期二, 11 七月 2023 17:40:30 +0800
Subject: [PATCH] 临时提交

---
 src/main/java/com/ruoyi/project/tr/hiddenDangerCheck/controller/DangerReportController.java |   60 +++++++++++++++++++++++++++---------------------------------
 1 files changed, 27 insertions(+), 33 deletions(-)

diff --git a/src/main/java/com/ruoyi/project/tr/hiddenDangerCheck/controller/DangerReportController.java b/src/main/java/com/ruoyi/project/tr/hiddenDangerCheck/controller/DangerReportController.java
index ec626b0..2c6c26a 100644
--- a/src/main/java/com/ruoyi/project/tr/hiddenDangerCheck/controller/DangerReportController.java
+++ b/src/main/java/com/ruoyi/project/tr/hiddenDangerCheck/controller/DangerReportController.java
@@ -6,6 +6,7 @@
 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;
@@ -93,7 +94,6 @@
         hiddenDangerCheckPoint.setJudgeQueryByUserIdList(userIdList);//隐患整改人ID 为登陆账号companyId下的userId的
         startPage();
         List<HiddenDangerCheckPoint> list = hiddenDangerCheckPointService.selectHiddenDangerCheckPointList(hiddenDangerCheckPoint);
-
         return getDataTable(list);
     }
 
@@ -113,7 +113,6 @@
         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());
@@ -122,10 +121,9 @@
                 dangerCheckPoint.setHazardDangerType(dangerInfo.getHazardDangerType());
                 dangerCheckPoint.setDangerResult(dangerInfo.getDangerResult());
             }
-
             resultList.add(dangerCheckPoint);
         }
-        return getDataTable(resultList);
+        return getDataTable(list);
     }
 
     /**
@@ -147,13 +145,13 @@
         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";
     }
 
     /**
      * 新增保存隐患上报
-     * todo-2022 隐患上报   tr_hidden_danger_check_point
      */
     @Log(title = "隐患上报", businessType = BusinessType.INSERT)
     @PostMapping("/addDangerReportSave")
@@ -183,13 +181,13 @@
             throw new RuntimeException("添加隐患信息失败");
         }
 
-        // todo-2022 此处插入附属表
-        //获取Id返回值
-        hdcp.getId();
-        int result = riskService.insertDangerInfo(hdcp.getId(), hdcp);
-        if (result< 1){
-            throw new RuntimeException("添加隐患附属信息失败");
-        }
+//        // 此处插入附属表  ---  此处已弃用,在核查整改后插入
+//        //获取Id返回值
+//        hdcp.getId();
+//        int result = riskService.insertDangerInfo(hdcp.getId(), hdcp);
+//        if (result< 1){
+//            throw new RuntimeException("添加隐患附属信息失败");
+//        }
 
         hiddenDangerCheckPointService.getTaskCountTotal(getSysUser().getUserId());//查询未执行任务总数量并推送
 
@@ -242,7 +240,7 @@
         hiddenDangerCheck.setDangerPlaceName(hdcp.getDangerPlaceName());
         hiddenDangerCheckService.insertHiddenDangerCheck(hiddenDangerCheck);//构造隐患排查对象保存,主要保存隐患责任部门,隐患地点
 
-        // todo-2022 1.全流程隐患上报信息封装
+        //1.全流程隐患上报信息封装
 
 
         hdcp.setCheckId(hiddenDangerCheck.getCheckId());
@@ -278,7 +276,6 @@
                 hdcp.setExamineStatus(TrHiddenDangerCheckConstants.EXAMINE_STATUS_NOT_EXAMINE);//核查状态(待核查)
             }
         }
-        // todo-2022 2.全流程隐患提交信息封装-未操作
 
         //隐患核查
 
@@ -294,8 +291,6 @@
             }
         }
 
-        // todo-2022 3.全流程隐患核查信息封装-未操作
-
 
         //隐患整改
 //        hdcp.setRectifyCreateTime(DateUtils.getNowDate());//设置整改时间
@@ -304,7 +299,7 @@
         hdcp.setStage(TrHiddenDangerCheckConstants.DANGER_STAGE_PLAN_ACCEPT);//隐患验收阶段(数据进入到隐患验收阶段)
 
 
-        // todo-2022 4.全流程隐患整改信息封装-未操作
+        //4.全流程隐患整改信息封装-未操作
 
         //隐患验收
         if (!StringUtils.isEmpty(hdcp.getAcceptResult())) {
@@ -318,7 +313,7 @@
 //              hdcp.setAcceptCreateTime(DateUtils.getNowDate());//设置验收时间
                 hdcp.setAcceptStatus(TrHiddenDangerCheckConstants.ACCEPT_STATUS_ALREADY_ACCEPT_PASS);//验收状态(验收通过)
 
-                // todo-2022 5.全流程隐患验收信息封装-未操作
+                //5.全流程隐患验收信息封装-未操作
 
             }
         }
@@ -401,10 +396,10 @@
             hiddenDangerCheckPointService.updateHiddenDangerCheckPoint(hiddenDangerCheckPoint);
 
             // todo-2022 此处修改附属表
-            int result = riskService.updateDangerInfo(hiddenDangerCheckPoint);
-            if (result < 1){
-                throw new RuntimeException("修改失败");
-            }
+//            int result = riskService.updateDangerInfo(hiddenDangerCheckPoint);
+//            if (result < 1){
+//                throw new RuntimeException("修改失败");
+//            }
 
             hiddenDangerCheckPointService.getTaskCountTotal(getSysUser().getUserId());//查询未执行任务总数量并推送
             return AjaxResult.success();
@@ -464,11 +459,11 @@
                 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("整改信息保存失败");
-                }
+//                // todo-2022 隐患信息判定
+//                int result = riskService.updateDangerInfoJudge(hiddenDangerCheckPoint);
+//                if (result < 1){
+//                    throw new RuntimeException("整改信息保存失败");
+//                }
 
             }
         }
@@ -497,11 +492,10 @@
             hiddenDangerCheckService.deleteHiddenDangerCheckById(hdcp.getCheckId());
 
             // todo-2022 此处删除附属表
-            int result = riskService.deleteDangerInfo(hdcp.getId());
-
-            if (result < 1){
-                throw  new RuntimeException("删除失败");
-            }
+//            int result = riskService.deleteDangerInfo(hdcp.getId());
+//            if (result < 1){
+//                throw  new RuntimeException("删除失败");
+//            }
 
             hiddenDangerCheckPointService.getTaskCountTotal(getSysUser().getUserId());//查询未执行任务总数量并推送
             return AjaxResult.success();

--
Gitblit v1.9.2