From 6522a12bd74cf6bf8d96c87e3d46412314ea6500 Mon Sep 17 00:00:00 2001
From: 马宇豪 <978517621@qq.com>
Date: 星期五, 28 四月 2023 15:30:13 +0800
Subject: [PATCH] 添加包保责任制查看

---
 src/main/java/com/ruoyi/project/tr/selectRiskAndPeopleInfo/controller/selectRiskAndPeopleInfoController.java |   19 ++++++---
 src/main/java/com/ruoyi/doublePrevention/entity/dto/req/RiskAndPeopleInfoReqBO.java                          |    2 +
 src/main/java/com/ruoyi/doublePrevention/repository/RiskAndPeopleInfoRepository.java                         |    2 +
 src/main/resources/mybatis/doublePrevention/RiskAndPeopleMapper.xml                                          |    8 ++++
 src/main/resources/templates/tr/riskAndPeopleInfo/riskAndPeopleInfo.html                                     |   45 +++++++++-------------
 src/main/java/com/ruoyi/doublePrevention/service/baseService/RiskAndPeopleInfoService.java                   |    2 +
 src/main/resources/templates/tr/riskAndPeopleInfo/detailRiskAndPeopleInfo.html                               |   22 ----------
 src/main/java/com/ruoyi/doublePrevention/service/baseService/impl/RiskAndPeopleInfoServiceImpl.java          |    6 +++
 8 files changed, 51 insertions(+), 55 deletions(-)

diff --git a/src/main/java/com/ruoyi/doublePrevention/entity/dto/req/RiskAndPeopleInfoReqBO.java b/src/main/java/com/ruoyi/doublePrevention/entity/dto/req/RiskAndPeopleInfoReqBO.java
index 7cdf793..80fcbfc 100644
--- a/src/main/java/com/ruoyi/doublePrevention/entity/dto/req/RiskAndPeopleInfoReqBO.java
+++ b/src/main/java/com/ruoyi/doublePrevention/entity/dto/req/RiskAndPeopleInfoReqBO.java
@@ -12,4 +12,6 @@
     private String  hazardName;
 
     private String  hazardRank;
+
+    private Long  id;
 }
diff --git a/src/main/java/com/ruoyi/doublePrevention/repository/RiskAndPeopleInfoRepository.java b/src/main/java/com/ruoyi/doublePrevention/repository/RiskAndPeopleInfoRepository.java
index e7d26dd..1a555c1 100644
--- a/src/main/java/com/ruoyi/doublePrevention/repository/RiskAndPeopleInfoRepository.java
+++ b/src/main/java/com/ruoyi/doublePrevention/repository/RiskAndPeopleInfoRepository.java
@@ -12,4 +12,6 @@
 public interface RiskAndPeopleInfoRepository extends BaseMapper<RiskAndPeopleInfo> {
 
     List<RiskAndPeopleInfo> listRiskAndPeoplePage(@Param("reqBO") RiskAndPeopleInfoReqBO reqBO);
+
+    RiskAndPeopleInfo selectRiskAndPeopleInfoById(Long id);
 }
diff --git a/src/main/java/com/ruoyi/doublePrevention/service/baseService/RiskAndPeopleInfoService.java b/src/main/java/com/ruoyi/doublePrevention/service/baseService/RiskAndPeopleInfoService.java
index 9f242cb..0b3feae 100644
--- a/src/main/java/com/ruoyi/doublePrevention/service/baseService/RiskAndPeopleInfoService.java
+++ b/src/main/java/com/ruoyi/doublePrevention/service/baseService/RiskAndPeopleInfoService.java
@@ -9,4 +9,6 @@
 public interface RiskAndPeopleInfoService extends IService<RiskAndPeopleInfo> {
 
     ResultVO<RiskAndPeopleInfoRespDTO> listRiskAndPeoplePage(RiskAndPeopleInfoReqBO reqBO);
+
+    RiskAndPeopleInfo selectRiskAndPeopleInfoById(Long id);
 }
diff --git a/src/main/java/com/ruoyi/doublePrevention/service/baseService/impl/RiskAndPeopleInfoServiceImpl.java b/src/main/java/com/ruoyi/doublePrevention/service/baseService/impl/RiskAndPeopleInfoServiceImpl.java
index dbe8f12..66babe9 100644
--- a/src/main/java/com/ruoyi/doublePrevention/service/baseService/impl/RiskAndPeopleInfoServiceImpl.java
+++ b/src/main/java/com/ruoyi/doublePrevention/service/baseService/impl/RiskAndPeopleInfoServiceImpl.java
@@ -155,4 +155,10 @@
 
         return resultVO;
     }
+
+
+    @Override
+    public RiskAndPeopleInfo selectRiskAndPeopleInfoById(Long id) {
+        return repository.selectRiskAndPeopleInfoById(id);
+    }
 }
diff --git a/src/main/java/com/ruoyi/project/tr/selectRiskAndPeopleInfo/controller/selectRiskAndPeopleInfoController.java b/src/main/java/com/ruoyi/project/tr/selectRiskAndPeopleInfo/controller/selectRiskAndPeopleInfoController.java
index 56364c4..593b2bd 100644
--- a/src/main/java/com/ruoyi/project/tr/selectRiskAndPeopleInfo/controller/selectRiskAndPeopleInfoController.java
+++ b/src/main/java/com/ruoyi/project/tr/selectRiskAndPeopleInfo/controller/selectRiskAndPeopleInfoController.java
@@ -1,5 +1,6 @@
 package com.ruoyi.project.tr.selectRiskAndPeopleInfo.controller;
 
+import com.ruoyi.doublePrevention.entity.RiskAndPeopleInfo;
 import com.ruoyi.doublePrevention.entity.dto.req.RiskAndPeopleInfoReqBO;
 import com.ruoyi.doublePrevention.entity.dto.req.RiskOldInfoQueryReqDTO;
 import com.ruoyi.doublePrevention.entity.dto.resp.RiskAndPeopleInfoRespDTO;
@@ -9,14 +10,12 @@
 import com.ruoyi.doublePrevention.vo.ResultVO;
 import com.ruoyi.framework.web.controller.BaseController;
 import com.ruoyi.framework.web.page.TableDataInfo;
+import com.ruoyi.project.tr.hiddenDangerCheck.domain.HiddenDangerCheck;
 import com.ruoyi.project.tr.hiddenDangerCheckPoint.service.IHiddenDangerCheckPointService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.ModelMap;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
 
@@ -26,10 +25,10 @@
  * @date 2020-05-08
  */
 @Controller
-@RequestMapping("/tr/selectRiskAndPeoplePage")
+@RequestMapping("/tr/riskAndPeopleInfo")
 public class selectRiskAndPeopleInfoController extends BaseController
 {
-    private String prefix = "tr/selectRiskAndPeoplePage";
+    private String prefix = "tr/riskAndPeopleInfo";
 
     @Autowired
     private RiskAndPeopleInfoService riskAndPeopleInfoService;
@@ -51,7 +50,6 @@
     @GetMapping("/getCountInfo")
     public String countInfo(RiskAndPeopleInfoReqBO reqBO, ModelMap mmap)
     {
-        System.out.println("11111111111111111111111111111111111111111");
 //        ResultVO resultVO = new ResultVO<>();
 //        resultVO.setCode("200");
 //        resultVO.setMsg("查询成功");
@@ -110,6 +108,13 @@
     }
 
 
+    @GetMapping("/detailRiskAndPeopleInfo/{id}")
+    public String detailDangerPlanFormulate(@PathVariable("id") Long id, ModelMap mmap) {
+        RiskAndPeopleInfo riskAndPeopleInfo = riskAndPeopleInfoService.selectRiskAndPeopleInfoById(id);
+        mmap.put("riskAndPeopleInfo", riskAndPeopleInfo);
+        return prefix + "/detailRiskAndPeopleInfo";
+    }
+
 }
 
 
diff --git a/src/main/resources/mybatis/doublePrevention/RiskAndPeopleMapper.xml b/src/main/resources/mybatis/doublePrevention/RiskAndPeopleMapper.xml
index 59ecb8d..fc69574 100644
--- a/src/main/resources/mybatis/doublePrevention/RiskAndPeopleMapper.xml
+++ b/src/main/resources/mybatis/doublePrevention/RiskAndPeopleMapper.xml
@@ -50,6 +50,14 @@
         <if test="reqBO.hazardRank != null and reqBO.hazardRank != '' ">
             and hazard_rank = #{reqBO.hazardRank}
         </if>
+        <if test="reqBO.id != null and reqBO.id != '' ">
+            and id = #{reqBO.id}
+        </if>
+    </select>
+
+
+    <select id="selectRiskAndPeopleInfoById" resultMap="Result">
+        select * from risk_and_people_info where delete_status = 0 and id = #{id}
     </select>
 
 
diff --git a/src/main/resources/templates/tr/riskAndPeopleInfo/detailRiskAndPeopleInfo.html b/src/main/resources/templates/tr/riskAndPeopleInfo/detailRiskAndPeopleInfo.html
index 3fce4bc..8c8b013 100644
--- a/src/main/resources/templates/tr/riskAndPeopleInfo/detailRiskAndPeopleInfo.html
+++ b/src/main/resources/templates/tr/riskAndPeopleInfo/detailRiskAndPeopleInfo.html
@@ -6,7 +6,7 @@
 </head>
 <body class="white-bg">
     <div class="wrapper wrapper-content animated fadeInRight ibox-content">
-        <form class="form-horizontal m" id="form-riskCheckPoint-edit" th:object="${riskCheckPoint}">
+        <form class="form-horizontal m" id="form-riskCheckPoint-edit" th:object="${riskAndPeopleInfo}">
             <input name="checkPointId" th:field="*{id}" type="hidden">
 
             <!--现有分值-->
@@ -61,25 +61,5 @@
     </div>
     <th:block th:include="include :: footer" />
     <th:block th:include="include :: datetimepicker-js" />
-    <script type="text/javascript">
-        var prefix = ctx + "/detailRiskAndPeopleInfo";
-        $("#form-riskCheckPoint-edit").validate({
-            focusCleanup: true
-        });
-
-        function submitHandler() {
-            if ($.validate.form()) {
-                $.operate.save(prefix + "/edit", $('#form-riskCheckPoint-edit').serialize());
-            }
-        }
-
-        $("input[name='reviewTime']").datetimepicker({
-            format: "yyyy-mm-dd",
-            minView: "month",
-            autoclose: true
-        });
-
-
-    </script>
 </body>
 </html>
\ No newline at end of file
diff --git a/src/main/resources/templates/tr/riskAndPeopleInfo/riskAndPeopleInfo.html b/src/main/resources/templates/tr/riskAndPeopleInfo/riskAndPeopleInfo.html
index 56eed5b..246c0a3 100644
--- a/src/main/resources/templates/tr/riskAndPeopleInfo/riskAndPeopleInfo.html
+++ b/src/main/resources/templates/tr/riskAndPeopleInfo/riskAndPeopleInfo.html
@@ -73,7 +73,7 @@
 </div>
 <th:block th:include="include :: footer"/>
 <script th:inline="javascript">
-    var prefix = ctx + "tr/selectRiskAndPeoplePage";
+    var prefix = ctx + "tr/riskAndPeopleInfo";
 
     $(function () {
         $("#count").text([[${count}]]);
@@ -99,9 +99,15 @@
             // exportUrl: prefix + "/export",
             detailUrl: prefix + "/detailRiskAndPeopleInfo/{id}",
             modalName: "包保责任制",
-            detailView: true,
-            detailFormatter: detailFormatter,
             columns: [
+                {
+                    field: 'id',
+                    title: 'id',
+                },
+                {
+                    field: 'areaCode',
+                    title: '行政区划',
+                },
                 {
                     field: 'companyName',
                     title: '企业名称',
@@ -126,34 +132,19 @@
                     field: 'parkName',
                     title: '所在园区'
                 },
-                // {
-                //     title: '操作',
-                //     align: 'center',
-                //     formatter: function (value, row, index) {
-                //         var actions = [];
-                //         actions.push('<a class="btn btn-default btn-xs " href="javascript:void(0)" onclick="$.operate.detail(\'' + row.id + '\')"><i class="fa fa-search"></i>查看</a> ');
-                //         return actions.join('');
-                //     }
-                // }
+                {
+                    title: '操作',
+                    align: 'center',
+                    formatter: function (value, row, index) {
+                        var actions = [];
+                        actions.push('<a class="btn btn-default btn-xs " href="javascript:void(0)" onclick="$.operate.detail(\'' + row.id + '\')"><i class="fa fa-search"></i>查看</a> ');
+                        return actions.join('');
+                    }
+                }
             ]
         };
         $.table.init(options);
     });
-    function detailFormatter(index, row) {
-        var html = [];
-        html.push('<p><b>id:</b> ' + row.id + '</p>');
-        html.push('<p><b>行政区划:</b> ' + row.areaCode + '</p>');
-        html.push('<p><b>企业名称:</b> ' + row.companyName + '</p>');
-        html.push('<p><b>企业类型:</b> ' + row.companyNatureName + '</p>');
-        html.push('<p><b>危险源编码:</b> ' + row.hazardCode + '</p>');
-        html.push('<p><b>危险源名称:</b> ' + row.hazardName + '</p>');
-        html.push('<p><b>危险级别:</b> ' + row.hazardRankName + '</p>');
-        html.push('<p><b>所在园区:</b> ' + row.parkName + '</p>');
-        // $.each(row, function(key, value) {
-        // 	html.push('<p><b>' + key + ':</b> ' + value + '</p>');
-        // });
-        return html.join('');
-    }
 </script>
 </body>
 </html>
\ No newline at end of file

--
Gitblit v1.9.2