From 909ec438fe86a183dece9aa453d8b1bcf7f689ac Mon Sep 17 00:00:00 2001
From: genggeng <1390391562@qq.com>
Date: Thu, 6 Oct 2022 16:40:25 +0800
Subject: [PATCH] =?UTF-8?q?=E6=B3=95=E5=BE=8B=E6=B3=95=E8=A7=84=E7=AE=A1?=
 =?UTF-8?q?=E7=90=86=E4=BF=AE=E6=94=B9=20gengdidi?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../system/domain/TEnterpriseSystem.java      | 148 ++++++++++++------
 .../mapper/system/TEnterpriseSystemMapper.xml |  57 ++++---
 .../src/components/FileUpload/index.vue       |   2 +-
 .../src/views/safetyManagement/laws/index.vue |  52 +++++-
 4 files changed, 189 insertions(+), 70 deletions(-)

diff --git a/danger-manage-system/src/main/java/com/zehong/system/domain/TEnterpriseSystem.java b/danger-manage-system/src/main/java/com/zehong/system/domain/TEnterpriseSystem.java
index dde8545..5b72cf6 100644
--- a/danger-manage-system/src/main/java/com/zehong/system/domain/TEnterpriseSystem.java
+++ b/danger-manage-system/src/main/java/com/zehong/system/domain/TEnterpriseSystem.java
@@ -6,10 +6,10 @@ import com.zehong.common.annotation.Excel;
 import com.zehong.common.core.domain.BaseEntity;
 
 /**
- * 企业制度管理对象 t_enterprise_system
- * 
+ * 企业制度对象 t_enterprise_system
+ *
  * @author zehong
- * @date 2022-06-21
+ * @date 2022-10-06
  */
 public class TEnterpriseSystem extends BaseEntity
 {
@@ -18,14 +18,30 @@ public class TEnterpriseSystem extends BaseEntity
     /** 制度id */
     private Long systemId;
 
-    /** 预案标题 */
-    @Excel(name = "预案标题")
+    /** 制度标题 */
+    @Excel(name = "制度标题")
     private String systemTitle;
 
     /** 制度类型(1企业规章制度,2法律法规) */
     @Excel(name = "制度类型", readConverterExp = "1=企业规章制度,2法律法规")
     private String systemType;
 
+    /** 层级:1.国家法律 2.行政法规 3.部委规章 4.地方性法规 5.国家标准 6.行业标准 7.地方标准 8.国际通用规则 9.政策解读 10.其他 */
+    @Excel(name = "层级:1.国家法律 2.行政法规 3.部委规章 4.地方性法规 5.国家标准 6.行业标准 7.地方标准 8.国际通用规则 9.政策解读 10.其他")
+    private String hierarchy;
+
+    /** 文号 */
+    @Excel(name = "文号")
+    private String referenceNum;
+
+    /** 颁布部门 */
+    @Excel(name = "颁布部门")
+    private String issueDept;
+
+    /** 有效性:1.现行有效 2.尚未实施 3.废除 4.废止 */
+    @Excel(name = "有效性:1.现行有效 2.尚未实施 3.废除 4.废止")
+    private String availability;
+
     /** 内容分类(仅用于企业规章制度分类) */
     @Excel(name = "内容分类", readConverterExp = "仅=用于企业规章制度分类")
     private String contentType;
@@ -42,113 +58,153 @@ public class TEnterpriseSystem extends BaseEntity
     @Excel(name = "文件路径")
     private String fileUrl;
 
+    /** 状态(0待发布,1待审批,2审批通过,3作废) */
+    @Excel(name = "状态", readConverterExp = "0=待发布,1待审批,2审批通过,3作废")
+    private String status;
+
     /** 是否删除(0正常,1删除) */
     @Excel(name = "是否删除(0正常,1删除)")
     private String isDel;
 
-    /** 状态 */
-    @Excel(name = "状态")
-    private String status;
-
-    public void setSystemId(Long systemId) 
+    public void setSystemId(Long systemId)
     {
         this.systemId = systemId;
     }
 
-    public Long getSystemId() 
+    public Long getSystemId()
     {
         return systemId;
     }
-    public void setSystemTitle(String systemTitle) 
+    public void setSystemTitle(String systemTitle)
     {
         this.systemTitle = systemTitle;
     }
 
-    public String getSystemTitle() 
+    public String getSystemTitle()
     {
         return systemTitle;
     }
-    public void setSystemType(String systemType) 
+    public void setSystemType(String systemType)
     {
         this.systemType = systemType;
     }
 
-    public String getSystemType() 
+    public String getSystemType()
     {
         return systemType;
     }
-    public void setContentType(String contentType) 
+    public void setHierarchy(String hierarchy)
+    {
+        this.hierarchy = hierarchy;
+    }
+
+    public String getHierarchy()
+    {
+        return hierarchy;
+    }
+    public void setReferenceNum(String referenceNum)
+    {
+        this.referenceNum = referenceNum;
+    }
+
+    public String getReferenceNum()
+    {
+        return referenceNum;
+    }
+    public void setIssueDept(String issueDept)
+    {
+        this.issueDept = issueDept;
+    }
+
+    public String getIssueDept()
+    {
+        return issueDept;
+    }
+    public void setAvailability(String availability)
+    {
+        this.availability = availability;
+    }
+
+    public String getAvailability()
+    {
+        return availability;
+    }
+    public void setContentType(String contentType)
     {
         this.contentType = contentType;
     }
 
-    public String getContentType() 
+    public String getContentType()
     {
         return contentType;
     }
-    public void setContent(String content) 
+    public void setContent(String content)
     {
         this.content = content;
     }
 
-    public String getContent() 
+    public String getContent()
     {
         return content;
     }
-    public void setFileName(String fileName) 
+    public void setFileName(String fileName)
     {
         this.fileName = fileName;
     }
 
-    public String getFileName() 
+    public String getFileName()
     {
         return fileName;
     }
-    public void setFileUrl(String fileUrl) 
+    public void setFileUrl(String fileUrl)
     {
         this.fileUrl = fileUrl;
     }
 
-    public String getFileUrl() 
+    public String getFileUrl()
     {
         return fileUrl;
     }
-    public void setIsDel(String isDel) 
+    public void setStatus(String status)
     {
-        this.isDel = isDel;
+        this.status = status;
     }
 
-    public String getIsDel() 
+    public String getStatus()
     {
-        return isDel;
+        return status;
     }
-    public void setStatus(String status) 
+    public void setIsDel(String isDel)
     {
-        this.status = status;
+        this.isDel = isDel;
     }
 
-    public String getStatus() 
+    public String getIsDel()
     {
-        return status;
+        return isDel;
     }
 
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("systemId", getSystemId())
-            .append("systemTitle", getSystemTitle())
-            .append("systemType", getSystemType())
-            .append("contentType", getContentType())
-            .append("content", getContent())
-            .append("fileName", getFileName())
-            .append("fileUrl", getFileUrl())
-            .append("createBy", getCreateBy())
-            .append("createTime", getCreateTime())
-            .append("updateBy", getUpdateBy())
-            .append("updateTime", getUpdateTime())
-            .append("isDel", getIsDel())
-            .append("status", getStatus())
-            .append("remark", getRemark())
-            .toString();
+                .append("systemId", getSystemId())
+                .append("systemTitle", getSystemTitle())
+                .append("systemType", getSystemType())
+                .append("hierarchy", getHierarchy())
+                .append("referenceNum", getReferenceNum())
+                .append("issueDept", getIssueDept())
+                .append("availability", getAvailability())
+                .append("contentType", getContentType())
+                .append("content", getContent())
+                .append("fileName", getFileName())
+                .append("fileUrl", getFileUrl())
+                .append("createBy", getCreateBy())
+                .append("createTime", getCreateTime())
+                .append("updateBy", getUpdateBy())
+                .append("updateTime", getUpdateTime())
+                .append("status", getStatus())
+                .append("isDel", getIsDel())
+                .append("remark", getRemark())
+                .toString();
     }
 }
diff --git a/danger-manage-system/src/main/resources/mapper/system/TEnterpriseSystemMapper.xml b/danger-manage-system/src/main/resources/mapper/system/TEnterpriseSystemMapper.xml
index 595c30c..bba56fa 100644
--- a/danger-manage-system/src/main/resources/mapper/system/TEnterpriseSystemMapper.xml
+++ b/danger-manage-system/src/main/resources/mapper/system/TEnterpriseSystemMapper.xml
@@ -1,13 +1,17 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper
-PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.zehong.system.mapper.TEnterpriseSystemMapper">
-    
+
     <resultMap type="TEnterpriseSystem" id="TEnterpriseSystemResult">
         <result property="systemId"    column="system_id"    />
         <result property="systemTitle"    column="system_title"    />
         <result property="systemType"    column="system_type"    />
+        <result property="hierarchy"    column="hierarchy"    />
+        <result property="referenceNum"    column="reference_num"    />
+        <result property="issueDept"    column="issue_dept"    />
+        <result property="availability"    column="availability"    />
         <result property="contentType"    column="content_type"    />
         <result property="content"    column="content"    />
         <result property="fileName"    column="file_name"    />
@@ -16,44 +20,47 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="createTime"    column="create_time"    />
         <result property="updateBy"    column="update_by"    />
         <result property="updateTime"    column="update_time"    />
-        <result property="isDel"    column="is_del"    />
         <result property="status"    column="status"    />
+        <result property="isDel"    column="is_del"    />
         <result property="remark"    column="remark"    />
     </resultMap>
 
     <sql id="selectTEnterpriseSystemVo">
-        select system_id, system_title, system_type, content_type, content, file_name, file_url, create_by, create_time, update_by, update_time, is_del, status, remark from t_enterprise_system
+        select system_id, system_title, system_type, hierarchy, reference_num, issue_dept, availability, content_type, content, file_name, file_url, create_by, create_time, update_by, update_time, status, is_del, remark from t_enterprise_system
     </sql>
 
     <select id="selectTEnterpriseSystemList" parameterType="TEnterpriseSystem" resultMap="TEnterpriseSystemResult">
         <include refid="selectTEnterpriseSystemVo"/>
-        <where>  is_del = '0'
-            <if test="systemTitle != null  and systemTitle != ''"> and system_title like concat('%', #{systemTitle}, '%')</if>
+        <where>
+            <if test="systemTitle != null  and systemTitle != ''"> and system_title = #{systemTitle}</if>
             <if test="systemType != null  and systemType != ''"> and system_type = #{systemType}</if>
+            <if test="hierarchy != null  and hierarchy != ''"> and hierarchy = #{hierarchy}</if>
+            <if test="referenceNum != null  and referenceNum != ''"> and reference_num = #{referenceNum}</if>
+            <if test="issueDept != null  and issueDept != ''"> and issue_dept = #{issueDept}</if>
+            <if test="availability != null  and availability != ''"> and availability = #{availability}</if>
             <if test="contentType != null  and contentType != ''"> and content_type = #{contentType}</if>
             <if test="content != null  and content != ''"> and content = #{content}</if>
             <if test="fileName != null  and fileName != ''"> and file_name like concat('%', #{fileName}, '%')</if>
             <if test="fileUrl != null  and fileUrl != ''"> and file_url = #{fileUrl}</if>
             <if test="status != null  and status != ''"> and status = #{status}</if>
-            <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
-                AND date_format(create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
-            </if>
-            <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
-                AND date_format(create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
-            </if>
+            <if test="isDel != null  and isDel != ''"> and is_del = #{isDel}</if>
         </where>
     </select>
-    
+
     <select id="selectTEnterpriseSystemById" parameterType="Long" resultMap="TEnterpriseSystemResult">
         <include refid="selectTEnterpriseSystemVo"/>
         where system_id = #{systemId}
     </select>
-        
+
     <insert id="insertTEnterpriseSystem" parameterType="TEnterpriseSystem" useGeneratedKeys="true" keyProperty="systemId">
         insert into t_enterprise_system
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="systemTitle != null">system_title,</if>
             <if test="systemType != null">system_type,</if>
+            <if test="hierarchy != null">hierarchy,</if>
+            <if test="referenceNum != null">reference_num,</if>
+            <if test="issueDept != null">issue_dept,</if>
+            <if test="availability != null">availability,</if>
             <if test="contentType != null">content_type,</if>
             <if test="content != null">content,</if>
             <if test="fileName != null">file_name,</if>
@@ -62,13 +69,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createTime != null">create_time,</if>
             <if test="updateBy != null">update_by,</if>
             <if test="updateTime != null">update_time,</if>
-            <if test="isDel != null">is_del,</if>
             <if test="status != null">status,</if>
+            <if test="isDel != null">is_del,</if>
             <if test="remark != null">remark,</if>
-         </trim>
+        </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="systemTitle != null">#{systemTitle},</if>
             <if test="systemType != null">#{systemType},</if>
+            <if test="hierarchy != null">#{hierarchy},</if>
+            <if test="referenceNum != null">#{referenceNum},</if>
+            <if test="issueDept != null">#{issueDept},</if>
+            <if test="availability != null">#{availability},</if>
             <if test="contentType != null">#{contentType},</if>
             <if test="content != null">#{content},</if>
             <if test="fileName != null">#{fileName},</if>
@@ -77,10 +88,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createTime != null">#{createTime},</if>
             <if test="updateBy != null">#{updateBy},</if>
             <if test="updateTime != null">#{updateTime},</if>
-            <if test="isDel != null">#{isDel},</if>
             <if test="status != null">#{status},</if>
+            <if test="isDel != null">#{isDel},</if>
             <if test="remark != null">#{remark},</if>
-         </trim>
+        </trim>
     </insert>
 
     <update id="updateTEnterpriseSystem" parameterType="TEnterpriseSystem">
@@ -88,6 +99,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <trim prefix="SET" suffixOverrides=",">
             <if test="systemTitle != null">system_title = #{systemTitle},</if>
             <if test="systemType != null">system_type = #{systemType},</if>
+            <if test="hierarchy != null">hierarchy = #{hierarchy},</if>
+            <if test="referenceNum != null">reference_num = #{referenceNum},</if>
+            <if test="issueDept != null">issue_dept = #{issueDept},</if>
+            <if test="availability != null">availability = #{availability},</if>
             <if test="contentType != null">content_type = #{contentType},</if>
             <if test="content != null">content = #{content},</if>
             <if test="fileName != null">file_name = #{fileName},</if>
@@ -96,8 +111,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
-            <if test="isDel != null">is_del = #{isDel},</if>
             <if test="status != null">status = #{status},</if>
+            <if test="isDel != null">is_del = #{isDel},</if>
             <if test="remark != null">remark = #{remark},</if>
         </trim>
         where system_id = #{systemId}
@@ -108,7 +123,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </delete>
 
     <delete id="deleteTEnterpriseSystemByIds" parameterType="String">
-        delete from t_enterprise_system where system_id in 
+        delete from t_enterprise_system where system_id in
         <foreach item="systemId" collection="array" open="(" separator="," close=")">
             #{systemId}
         </foreach>
diff --git a/danger-manage-web/src/components/FileUpload/index.vue b/danger-manage-web/src/components/FileUpload/index.vue
index 8eb7bc0..940f4ec 100644
--- a/danger-manage-web/src/components/FileUpload/index.vue
+++ b/danger-manage-web/src/components/FileUpload/index.vue
@@ -79,7 +79,7 @@
       // 大小限制(MB)
       fileSize: {
         type: Number,
-        default: 5,
+        default: 50,
       },
       fileArr: {
         type: Array,
diff --git a/danger-manage-web/src/views/safetyManagement/laws/index.vue b/danger-manage-web/src/views/safetyManagement/laws/index.vue
index 537276f..118552e 100644
--- a/danger-manage-web/src/views/safetyManagement/laws/index.vue
+++ b/danger-manage-web/src/views/safetyManagement/laws/index.vue
@@ -53,6 +53,10 @@
 
     <el-table v-loading="loading" :data="enterpriseSystemList" >
       <el-table-column label="法律法规标题" align="center" prop="systemTitle" />
+      <el-table-column label="颁布部门" align="center" prop="issueDept" />
+      <el-table-column label="文号" align="center" prop="referenceNum" />
+      <el-table-column label="层级" align="center" prop="hierarchy" :formatter="hierarchyFormat"/>
+      <el-table-column label="有效性" align="center" prop="availability" :formatter="availabilityFormat"/>
       <el-table-column label="附件" align="center" prop="fileUrl" width="260px">
         <template slot-scope="scope">
           <span
@@ -125,6 +129,32 @@
             <el-form-item label="法律法规标题" prop="systemTitle">
               <el-input v-model="form.systemTitle" placeholder="请输入法律法规标题" :disabled="readOnly"/>
             </el-form-item>
+            <el-form-item label="层级" prop="hierarchy">
+              <el-select v-model="form.hierarchy" placeholder="请选择层级" clearable size="small" :disabled="readOnly" style="width: 100%">
+                <el-option
+                  v-for = "dict in hierarchys"
+                  :key = "dict.dictValue"
+                  :label = "dict.dictLabel"
+                  :value = "dict.dictValue"
+                />
+              </el-select>
+            </el-form-item>
+            <el-form-item label="文号" prop="referenceNum">
+              <el-input v-model="form.referenceNum" placeholder="请输入文号" :disabled="readOnly"/>
+            </el-form-item>
+            <el-form-item label="颁布部门" prop="issueDept">
+              <el-input v-model="form.issueDept" placeholder="请输入颁布部门" :disabled="readOnly"/>
+            </el-form-item>
+            <el-form-item label="有效性" prop="availability">
+              <el-select v-model="form.availability" placeholder="请选择有效性" clearable size="small" :disabled="readOnly" style="width: 100%">
+                <el-option
+                  v-for = "dict in availabilitys"
+                  :key = "dict.dictValue"
+                  :label = "dict.dictLabel"
+                  :value = "dict.dictValue"
+                />
+              </el-select>
+            </el-form-item>
             <el-form-item label="备注" prop="remark">
               <el-input v-model="form.remark" placeholder="请输入备注" :disabled="readOnly" />
             </el-form-item>
@@ -214,7 +244,7 @@ export default {
         systemType: '2',
         systemTitle: null,
         content: null,
-        isDel: null,
+        isDel: '0',
       },
       // 表单参数
       form: {},
@@ -223,7 +253,12 @@ export default {
         systemTitle: [
           { required: true, message: "标题不能为空", trigger: "blur" }
         ],
-      }
+        hierarchy: [
+          { required: true, message: "请选择层级", trigger: "change" }
+        ],
+      },
+      hierarchys:[],
+      availabilitys:[]
     };
   },
   created() {
@@ -231,6 +266,13 @@ export default {
     this.getDicts("t_enterprise_system_status").then(response =>{
       this.statusOptions = response.data;
     })
+    this.getDicts("t_hierarchy").then(response =>{
+        this.hierarchys = response.data;
+    })
+    this.getDicts("t_availability").then(response =>{
+        this.availabilitys = response.data;
+    })
+
   },
   methods: {
     // 状态
@@ -429,6 +471,12 @@ export default {
     checkFile(url) {
       window.open(url,'_blank');
     },
+    hierarchyFormat(row,colum){
+      return this.selectDictLabel(this.hierarchys, row.hierarchy);
+    },
+    availabilityFormat(row,colum){
+      return this.selectDictLabel(this.availabilitys, row.availability);
+    }
   }
 };
 </script>
-- 
2.18.1