Эх сурвалжийг харах

-修改代码生成代码
-修改删除逻辑

jiangbiao 2 жил өмнө
parent
commit
30fe218aa7

+ 175 - 98
master/src/main/java/com/ruoyi/project/base/domain/TBaseDevice.java

@@ -1,6 +1,8 @@
 package com.ruoyi.project.base.domain;
 
 import java.util.Date;
+
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
@@ -13,68 +15,157 @@ import com.ruoyi.common.core.domain.BaseEntity;
  * @author ruoyi
  * @date 2022-11-15
  */
-public class TBaseDevice extends BaseEntity
-{
+public class TBaseDevice extends BaseEntity {
     private static final long serialVersionUID = 1L;
 
-    /** 唯一标识id */
+    /**
+     * 唯一标识id
+     */
     private Long id;
 
-    /** 装置id */
-    @Excel(name = "装置id")
+    /**
+     * 装置id
+     */
     private Long plantId;
 
-    /** 区域id */
-    @Excel(name = "区域id")
+    /**
+     * 区域id
+     */
     private Long regionId;
 
-    /** 设备/管线编号 */
+    /**
+     * 审核状态
+     */
+    @Excel(name = "审核状态")
+    private Long approveStatus;
+
+    @Excel(name = "装置名称")
+    @TableField(exist = false)
+    private String plantName;
+
+    @Excel(name = "装置编码")
+    @TableField(exist = false)
+    private String plantCode;
+
+    @Excel(name = "区域名称")
+    @TableField(exist = false)
+    private String regionName;
+
+    @Excel(name = "区域编号")
+    @TableField(exist = false)
+    private String regionCode;
+
+    /**
+     * 设备/管线编号
+     */
     @Excel(name = "设备/管线编号")
     private String code;
 
-    /** 设备/管线描述 */
+    /**
+     * 设备/管线描述
+     */
     @Excel(name = "设备/管线描述")
     private String describe;
 
-    /** 审核状态 */
-    @Excel(name = "审核状态")
-    private Long approveStatus;
 
-    /** 最新申请时间 */
+    /**
+     * 主要物料/产品
+     */
+    @Excel(name = "主要物料/产品")
+    private String material;
+
+    /**
+     * 物料状态
+     */
+    @Excel(name = "物料状态")
+    private String materialStatus;
+
+    /**
+     * 设备/管线描述
+     */
+    @Excel(name = "合成相应因子")
+    private String responseFactor;
+
+    /**
+     * 设备/管线描述
+     */
+    @Excel(name = "相应因子来源")
+    private String responseFactorFrom;
+
+    /**
+     * 最新申请时间
+     */
     @JsonFormat(pattern = "yyyy-MM-dd")
-    @Excel(name = "最新申请时间", width = 30, dateFormat = "yyyy-MM-dd")
     private Date approveTime;
 
-    /** 部门编号 */
-    @Excel(name = "部门编号")
+    /**
+     * 部门编号
+     */
     private Long deptId;
 
-    /** 状态 1 :正常 ;0:删除 */
+    /**
+     * 状态 1 :正常 ;0:删除
+     */
     private Integer delFlag;
 
-    /** 创建人 */
-    @Excel(name = "创建人")
+    /**
+     * 创建人
+     */
     private Long createrCode;
 
-    /** 创建时间 */
+    /**
+     * 创建时间
+     */
     @JsonFormat(pattern = "yyyy-MM-dd")
-    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
     private Date createdate;
 
-    /** 修改人 */
-    @Excel(name = "修改人")
+    /**
+     * 修改人
+     */
     private Long updaterCode;
 
-    /** 修改时间 */
+    @Excel(name = "维护人")
+    @TableField(exist = false)
+    private String updater;
+
+    /**
+     * 修改时间
+     */
     @JsonFormat(pattern = "yyyy-MM-dd")
-    @Excel(name = "修改时间", width = 30, dateFormat = "yyyy-MM-dd")
+    @Excel(name = "维护时间", width = 30, dateFormat = "yyyy-MM-dd")
     private Date updatedate;
 
-    private String plantName;
-    private String plantCode;
-    private String regionName;
-    private String regionCode;
-    private String updater;
+    public String getMaterial() {
+        return material;
+    }
+
+    public void setMaterial(String material) {
+        this.material = material;
+    }
+
+    public String getMaterialStatus() {
+        return materialStatus;
+    }
+
+    public void setMaterialStatus(String materialStatus) {
+        this.materialStatus = materialStatus;
+    }
+
+    public String getResponseFactor() {
+        return responseFactor;
+    }
+
+    public void setResponseFactor(String responseFactor) {
+        this.responseFactor = responseFactor;
+    }
+
+    public String getResponseFactorFrom() {
+        return responseFactorFrom;
+    }
+
+    public void setResponseFactorFrom(String responseFactorFrom) {
+        this.responseFactorFrom = responseFactorFrom;
+    }
 
     public String getPlantName() {
         return plantName;
@@ -116,141 +207,127 @@ public class TBaseDevice extends BaseEntity
         this.updater = updater;
     }
 
-    public void setId(Long id)
-    {
+    public void setId(Long id) {
         this.id = id;
     }
 
-    public Long getId()
-    {
+    public Long getId() {
         return id;
     }
-    public void setPlantId(Long plantId)
-    {
+
+    public void setPlantId(Long plantId) {
         this.plantId = plantId;
     }
 
-    public Long getPlantId()
-    {
+    public Long getPlantId() {
         return plantId;
     }
-    public void setRegionId(Long regionId)
-    {
+
+    public void setRegionId(Long regionId) {
         this.regionId = regionId;
     }
 
-    public Long getRegionId()
-    {
+    public Long getRegionId() {
         return regionId;
     }
-    public void setCode(String code)
-    {
+
+    public void setCode(String code) {
         this.code = code;
     }
 
-    public String getCode()
-    {
+    public String getCode() {
         return code;
     }
-    public void setDescribe(String describe)
-    {
+
+    public void setDescribe(String describe) {
         this.describe = describe;
     }
 
-    public String getDescribe()
-    {
+    public String getDescribe() {
         return describe;
     }
-    public void setApproveStatus(Long approveStatus)
-    {
+
+    public void setApproveStatus(Long approveStatus) {
         this.approveStatus = approveStatus;
     }
 
-    public Long getApproveStatus()
-    {
+    public Long getApproveStatus() {
         return approveStatus;
     }
-    public void setApproveTime(Date approveTime)
-    {
+
+    public void setApproveTime(Date approveTime) {
         this.approveTime = approveTime;
     }
 
-    public Date getApproveTime()
-    {
+    public Date getApproveTime() {
         return approveTime;
     }
-    public void setDeptId(Long deptId)
-    {
+
+    public void setDeptId(Long deptId) {
         this.deptId = deptId;
     }
 
-    public Long getDeptId()
-    {
+    public Long getDeptId() {
         return deptId;
     }
-    public void setDelFlag(Integer delFlag)
-    {
+
+    public void setDelFlag(Integer delFlag) {
         this.delFlag = delFlag;
     }
 
-    public Integer getDelFlag()
-    {
+    public Integer getDelFlag() {
         return delFlag;
     }
-    public void setCreaterCode(Long createrCode)
-    {
+
+    public void setCreaterCode(Long createrCode) {
         this.createrCode = createrCode;
     }
 
-    public Long getCreaterCode()
-    {
+    public Long getCreaterCode() {
         return createrCode;
     }
-    public void setCreatedate(Date createdate)
-    {
+
+    public void setCreatedate(Date createdate) {
         this.createdate = createdate;
     }
 
-    public Date getCreatedate()
-    {
+    public Date getCreatedate() {
         return createdate;
     }
-    public void setUpdaterCode(Long updaterCode)
-    {
+
+    public void setUpdaterCode(Long updaterCode) {
         this.updaterCode = updaterCode;
     }
 
-    public Long getUpdaterCode()
-    {
+    public Long getUpdaterCode() {
         return updaterCode;
     }
-    public void setUpdatedate(Date updatedate)
-    {
+
+    public void setUpdatedate(Date updatedate) {
         this.updatedate = updatedate;
     }
 
-    public Date getUpdatedate()
-    {
+    public Date getUpdatedate() {
         return updatedate;
     }
 
     @Override
     public String toString() {
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("id", getId())
-            .append("plantId", getPlantId())
-            .append("regionId", getRegionId())
-            .append("code", getCode())
-            .append("describe", getDescribe())
-            .append("remark", getRemark())
-            .append("approveStatus", getApproveStatus())
-            .append("approveTime", getApproveTime())
-            .append("deptId", getDeptId())
-            .append("delFlag", getDelFlag())
-            .append("createrCode", getCreaterCode())
-            .append("createdate", getCreatedate())
-            .append("updaterCode", getUpdaterCode())
-            .append("updatedate", getUpdatedate())
-            .toString();
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("id", getId())
+                .append("plantId", getPlantId())
+                .append("regionId", getRegionId())
+                .append("code", getCode())
+                .append("describe", getDescribe())
+                .append("remark", getRemark())
+                .append("approveStatus", getApproveStatus())
+                .append("approveTime", getApproveTime())
+                .append("deptId", getDeptId())
+                .append("delFlag", getDelFlag())
+                .append("createrCode", getCreaterCode())
+                .append("createdate", getCreatedate())
+                .append("updaterCode", getUpdaterCode())
+                .append("updatedate", getUpdatedate())
+                .toString();
     }
 }

+ 7 - 10
master/src/main/java/com/ruoyi/project/base/domain/TBasePlant.java

@@ -46,30 +46,32 @@ public class TBasePlant extends BaseEntity
 
     /** 最新申请时间 */
     @JsonFormat(pattern = "yyyy-MM-dd")
-    @Excel(name = "最新申请时间", width = 30, dateFormat = "yyyy-MM-dd")
     private Date approveTime;
 
     /** 部门编号 */
-    @Excel(name = "部门编号")
     private Long deptId;
 
     /** 状态 1 :正常 ;0:删除 */
     private Integer delFlag;
 
     /** 创建人 */
-    @Excel(name = "创建人")
     private Long createrCode;
 
     /** 创建时间 */
     @JsonFormat(pattern = "yyyy-MM-dd")
-    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
     private Date createdate;
 
     /** 修改人 */
-    @Excel(name = "修改人")
+    @Excel(name = "维护人")
     private String updater;
+
     private Long updaterCode;
 
+    /** 修改时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "维护时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date updatedate;
+
     public String getUpdater() {
         return updater;
     }
@@ -78,11 +80,6 @@ public class TBasePlant extends BaseEntity
         this.updater = updater;
     }
 
-    /** 修改时间 */
-    @JsonFormat(pattern = "yyyy-MM-dd")
-    @Excel(name = "修改时间", width = 30, dateFormat = "yyyy-MM-dd")
-    private Date updatedate;
-
     public void setId(Long id)
     {
         this.id = id;

+ 22 - 5
master/src/main/resources/mybatis/base/TBaseDeviceMapper.xml

@@ -24,14 +24,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="updaterCode"    column="updater_code"    />
         <result property="updater"    column="updater"    />
         <result property="updatedate"    column="updatedate"    />
+        <result property="material"    column="material"    />
+        <result property="materialStatus"    column="material_status"    />
+        <result property="responseFactor"    column="response_factor"    />
+        <result property="responseFactorFrom"    column="response_factor_from"    />
     </resultMap>
 
     <sql id="selectTBaseDeviceVo">
-        select id, plant_id, region_id, `code`, `describe`, remark, approve_status, approve_time, dept_id, del_flag, creater_code, createdate, updater_code, updatedate from t_base_device
+        select id, plant_id, region_id, `code`, `describe`, remark, approve_status, approve_time, dept_id, del_flag, creater_code, createdate, updater_code, updatedate,material,material_status,response_factor,response_factor_from from t_base_device
     </sql>
 
     <select id="selectTBaseDeviceList" parameterType="TBaseDevice" resultMap="TBaseDeviceResult">
-        select d.id, d.plant_id,bp.plant_name,bp.plant_type,bp.plant_code, d.region_id,br.region_code,br.region_name, d.code, d.describe, d.remark, d.approve_status, d.approve_time, d.dept_id, d.del_flag, d.creater_code, d.createdate, d.updater_code,su.user_name updater, d.updatedate from t_base_device d
+        select d.id, d.plant_id,bp.plant_name,bp.plant_type,bp.plant_code, d.region_id,br.region_code,br.region_name, d.code, d.describe, d.remark, d.approve_status, d.approve_time, d.dept_id, d.del_flag, d.creater_code, d.createdate, d.updater_code,su.user_name updater, d.updatedate,d.material,d.material_status,d.response_factor,d.response_factor_from from t_base_device d
         left join sys_user su on su.user_id = d.updater_code
         left join t_base_plant bp on bp.id = d.plant_id
         left join t_base_region br on br.id = d.region_id
@@ -47,11 +51,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createdate != null "> and d.createdate = #{createdate}</if>
             <if test="updaterCode != null "> and d.updater_code = #{updaterCode}</if>
             <if test="updatedate != null "> and d.updatedate = #{updatedate}</if>
+            and d.del_flag=0
         </where>
     </select>
 
     <select id="selectAllDeviceByRegionId" parameterType="long" resultMap="TBaseDeviceResult">
-        select d.id, concat(d.code, '+',d.describe) `describe` from t_base_device d where d.region_id=#{regionId}
+        select d.id, concat(d.code, '+',d.describe) `describe` from t_base_device d where d.region_id=#{regionId} and d.del_flag=0
     </select>
 
     <select id="selectTBaseDeviceById" parameterType="Long" resultMap="TBaseDeviceResult">
@@ -75,6 +80,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createdate != null">createdate,</if>
             <if test="updaterCode != null">updater_code,</if>
             <if test="updatedate != null">updatedate,</if>
+            <if test="material != null">material,</if>
+            <if test="materialStatus != null">material_status,</if>
+            <if test="responseFactor != null">response_factor,</if>
+            <if test="responseFactorFrom != null">response_factor_from,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="plantId != null">#{plantId},</if>
@@ -90,6 +99,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createdate != null">#{createdate},</if>
             <if test="updaterCode != null">#{updaterCode},</if>
             <if test="updatedate != null">#{updatedate},</if>
+            <if test="material != null">#{material},</if>
+            <if test="materialStatus != null">#{materialStatus},</if>
+            <if test="responseFactor != null">#{responseFactor},</if>
+            <if test="responseFactorFrom != null">#{responseFactorFrom},</if>
          </trim>
     </insert>
 
@@ -109,16 +122,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createdate != null">createdate = #{createdate},</if>
             <if test="updaterCode != null">updater_code = #{updaterCode},</if>
             <if test="updatedate != null">updatedate = #{updatedate},</if>
+            <if test="material != null">material=#{material},</if>
+            <if test="materialStatus != null">material_status=#{materialStatus},</if>
+            <if test="responseFactor != null">response_factor=#{responseFactor},</if>
+            <if test="responseFactorFrom != null">response_factor_from=#{responseFactorFrom},</if>
         </trim>
         where id = #{id}
     </update>
 
     <delete id="deleteTBaseDeviceById" parameterType="Long">
-        delete from t_base_device where id = #{id}
+        update t_base_device set del_flag=1 where id = #{id}
     </delete>
 
     <delete id="deleteTBaseDeviceByIds" parameterType="String">
-        delete from t_base_device where id in
+        update t_base_device set del_flag=1 where id in
         <foreach item="id" collection="array" open="(" separator="," close=")">
             #{id}
         </foreach>

+ 4 - 3
master/src/main/resources/mybatis/base/TBasePlantMapper.xml

@@ -27,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </sql>
 
     <select id="selectAllPlantName" resultMap="TBasePlantResult">
-        select d.id,d.plant_name from t_base_plant d
+        select d.id,d.plant_name from t_base_plant d where del_flag=0
     </select>
 
     <select id="selectTBasePlantList" parameterType="TBasePlant" resultMap="TBasePlantResult">
@@ -46,6 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createdate != null "> and createdate = #{createdate}</if>
             <if test="updaterCode != null "> and updater_code = #{updaterCode}</if>
             <if test="updatedate != null "> and updatedate = #{updatedate}</if>
+            and d.del_flag=0
         </where>
     </select>
 
@@ -109,11 +110,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </update>
 
     <delete id="deleteTBasePlantById" parameterType="Long">
-        delete from t_base_plant where id = #{id}
+        update t_base_plant set del_flag=1 where id = #{id}
     </delete>
 
     <delete id="deleteTBasePlantByIds" parameterType="String">
-        delete from t_base_plant where id in
+        update t_base_plant set del_flag=1 where id in
         <foreach item="id" collection="array" open="(" separator="," close=")">
             #{id}
         </foreach>

+ 3 - 2
master/src/main/resources/mybatis/base/TBasePointMapper.xml

@@ -100,6 +100,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createdate != null "> and d.createdate = #{createdate}</if>
             <if test="updaterCode != null "> and d.updater_code = #{updaterCode}</if>
             <if test="updatedate != null "> and d.updatedate = #{updatedate}</if>
+            and d.del_flag=0
         </where>
     </select>
 
@@ -235,11 +236,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </update>
 
     <delete id="deleteTBasePointById" parameterType="Long">
-        delete from t_base_point where id = #{id}
+        update t_base_point set del_flag=1 where id = #{id}
     </delete>
 
     <delete id="deleteTBasePointByIds" parameterType="String">
-        delete from t_base_point where id in
+        update t_base_point set del_flag=1 where id in
         <foreach item="id" collection="array" open="(" separator="," close=")">
             #{id}
         </foreach>

+ 4 - 3
master/src/main/resources/mybatis/base/TBaseRegionMapper.xml

@@ -46,10 +46,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createdate != null "> and d.createdate = #{createdate}</if>
             <if test="updaterCode != null "> and d.updater_code = #{updaterCode}</if>
             <if test="updatedate != null "> and d.updatedate = #{updatedate}</if>
+            and d.del_flag=0
         </where>
     </select>
     <select id="selectAllRegionByPlantId" parameterType="long"  resultMap="TBaseRegionResult">
-        select d.id, d.region_code, d.region_name from t_base_region d where d.plant_id=#{plantId}
+        select d.id, d.region_code, d.region_name from t_base_region d where d.plant_id=#{plantId} and d.del_flag=0
     </select>
 
     <select id="selectTBaseRegionById" parameterType="Long" resultMap="TBaseRegionResult">
@@ -109,11 +110,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </update>
 
     <delete id="deleteTBaseRegionById" parameterType="Long">
-        delete from t_base_region where id = #{id}
+        update t_base_region set del_flag=1 where id = #{id}
     </delete>
 
     <delete id="deleteTBaseRegionByIds" parameterType="String">
-        delete from t_base_region where id in
+        update t_base_region set del_flag=1 where id in
         <foreach item="id" collection="array" open="(" separator="," close=")">
             #{id}
         </foreach>

+ 7 - 1
master/src/main/resources/vm/vue/index.vue.vm

@@ -113,7 +113,7 @@
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
-    <el-table v-loading="loading" :data="${businessName}List" @selection-change="handleSelectionChange">
+    <el-table v-loading="loading" :data="${businessName}List" @selection-change="handleSelectionChange" :height="clientHeight" border>
       <el-table-column type="selection" width="55" align="center" />
 #foreach($column in $columns)
 #set($javaField=$column.javaField)
@@ -356,6 +356,8 @@ export default {
 #end
   data() {
     return {
+      // 页面高度
+      clientHeight:300,
       // 遮罩层
       loading: true,
       // 选中数组
@@ -421,6 +423,10 @@ export default {
   },
   created() {
     this.getList();
+    //设置表格高度对应屏幕高度
+    this.$nextTick(() => {
+      this.clientHeight = (document.body.clientHeight - 80) * 0.8
+    });
   },
   methods: {
     /** 查询${functionName}列表 */

+ 11 - 10
master/src/main/resources/vm/xml/mapper.xml.vm

@@ -3,7 +3,7 @@
 PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="${packageName}.mapper.${ClassName}Mapper">
-    
+
     <resultMap type="${ClassName}" id="${ClassName}Result">
 #foreach ($column in $columns)
         <result property="${column.javaField}"    column="${column.columnName}"    />
@@ -28,7 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="select${ClassName}List" parameterType="${ClassName}" resultMap="${ClassName}Result">
         <include refid="select${ClassName}Vo"/>
-        <where>  
+        <where>
 #foreach($column in $columns)
 #set($queryType=$column.queryType)
 #set($javaField=$column.javaField)
@@ -56,8 +56,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 #end
 #end
         </where>
+        and del_flag = 0
     </select>
-    
+
     <select id="select${ClassName}By${pkColumn.capJavaField}" parameterType="${pkColumn.javaType}" resultMap="#if($table.sub)${ClassName}${subClassName}Result#else${ClassName}Result#end">
 #if($table.crud || $table.tree)
         <include refid="select${ClassName}Vo"/>
@@ -71,7 +72,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where a.${pkColumn.columnName} = #{${pkColumn.javaField}}
 #end
     </select>
-        
+
     <insert id="insert${ClassName}" parameterType="${ClassName}"#if($pkColumn.increment) useGeneratedKeys="true" keyProperty="$pkColumn.javaField"#end>
         insert into ${tableName}
         <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -103,26 +104,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </update>
 
     <delete id="delete${ClassName}By${pkColumn.capJavaField}" parameterType="${pkColumn.javaType}">
-        delete from ${tableName} where ${pkColumn.columnName} = #{${pkColumn.javaField}}
+        update ${tableName} set del_flag=1 where ${pkColumn.columnName} = #{${pkColumn.javaField}}
     </delete>
 
     <delete id="delete${ClassName}By${pkColumn.capJavaField}s" parameterType="String">
-        delete from ${tableName} where ${pkColumn.columnName} in 
+        update ${tableName} set del_flag=1 where ${pkColumn.columnName} in
         <foreach item="${pkColumn.javaField}" collection="array" open="(" separator="," close=")">
             #{${pkColumn.javaField}}
         </foreach>
     </delete>
 #if($table.sub)
-    
+
     <delete id="delete${subClassName}By${subTableFkClassName}s" parameterType="String">
-        delete from ${subTableName} where ${subTableFkName} in 
+        update ${subTableName} set del_flag=1 where ${subTableFkName} in
         <foreach item="${subTableFkclassName}" collection="array" open="(" separator="," close=")">
             #{${subTableFkclassName}}
         </foreach>
     </delete>
 
     <delete id="delete${subClassName}By${subTableFkClassName}" parameterType="${pkColumn.javaType}">
-        delete from ${subTableName} where ${subTableFkName} = #{${subTableFkclassName}}
+        update ${subTableName} set del_flag=1 where ${subTableFkName} = #{${subTableFkclassName}}
     </delete>
 
     <insert id="batch${subClassName}">
@@ -132,4 +133,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </foreach>
     </insert>
 #end
-</mapper>
+</mapper>

+ 78 - 30
ui/src/views/base/device/index.vue

@@ -43,7 +43,8 @@
           size="mini"
           @click="handleAdd"
           v-hasPermi="['base:device:add']"
-        >新增</el-button>
+        >新增
+        </el-button>
       </el-col>
       <el-col :span="1.5">
         <el-button
@@ -54,7 +55,8 @@
           :disabled="single"
           @click="handleUpdate"
           v-hasPermi="['base:device:edit']"
-        >修改</el-button>
+        >修改
+        </el-button>
       </el-col>
       <el-col :span="1.5">
         <el-button
@@ -65,7 +67,8 @@
           :disabled="multiple"
           @click="handleDelete"
           v-hasPermi="['base:device:remove']"
-        >删除</el-button>
+        >删除
+        </el-button>
       </el-col>
       <el-col :span="1.5">
         <el-button
@@ -75,7 +78,8 @@
           size="mini"
           @click="handleExport"
           v-hasPermi="['base:device:export']"
-        >导出</el-button>
+        >导出
+        </el-button>
       </el-col>
       <el-col :span="1.5">
         <el-button
@@ -100,22 +104,23 @@
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
-    <el-table v-loading="loading" :data="deviceList" :cell-style="tableCellStyle" @selection-change="handleSelectionChange" :height="clientHeight" border>
-      <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="审核状态" align="center" prop="approveStatus" :formatter="approveStatusFormat" />
-      <el-table-column label="装置名称" align="center" prop="plantName" />
-      <el-table-column label="装置编编码" align="center" prop="plantCode" />
-      <el-table-column label="区域名称" align="center" prop="regionName" />
-      <el-table-column label="区域编号" align="center" prop="regionCode" />
-      <el-table-column label="设备/管线编号" align="center" prop="code" />
-      <el-table-column label="设备/管线描述" align="center" prop="describe" />
-      <el-table-column label="维护人" align="center" prop="updater" />
+    <el-table v-loading="loading" :data="deviceList" :cell-style="tableCellStyle"
+              @selection-change="handleSelectionChange" :height="clientHeight" border>
+      <el-table-column type="selection" width="55" align="center"/>
+      <el-table-column label="审核状态" align="center" prop="approveStatus" :formatter="approveStatusFormat"/>
+      <el-table-column label="装置名称" align="center" prop="plantName"/>
+      <el-table-column label="装置编编码" align="center" prop="plantCode"/>
+      <el-table-column label="区域名称" align="center" prop="regionName"/>
+      <el-table-column label="区域编号" align="center" prop="regionCode"/>
+      <el-table-column label="设备/管线编号" align="center" prop="code"/>
+      <el-table-column label="设备/管线描述" align="center" prop="describe"/>
+      <el-table-column label="维护人" align="center" prop="updater"/>
       <el-table-column label="维护时间" align="center" prop="updatedate" width="180">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.updatedate, '{y}-{m}-{d}') }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="备注" align="center" prop="remark" />
+      <el-table-column label="备注" align="center" prop="remark"/>
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -124,14 +129,16 @@
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
             v-hasPermi="['base:device:edit']"
-          >修改</el-button>
+          >修改
+          </el-button>
           <el-button
             size="mini"
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
             v-hasPermi="['base:device:remove']"
-          >删除</el-button>
+          >删除
+          </el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -169,13 +176,25 @@
           </el-select>
         </el-form-item>
         <el-form-item label="设备/管线编号" prop="code">
-          <el-input v-model="form.code" placeholder="请输入设备/管线编号" />
+          <el-input v-model="form.code" placeholder="请输入设备/管线编号"/>
         </el-form-item>
         <el-form-item label="设备/管线描述" prop="describe">
-          <el-input v-model="form.describe" placeholder="请输入设备/管线描述" />
+          <el-input v-model="form.describe" placeholder="请输入设备/管线描述"/>
+        </el-form-item>
+        <el-form-item label="主要物料/产品" prop="material">
+          <el-input v-model="form.material" placeholder="请输入主要物料/产品"/>
+        </el-form-item>
+        <el-form-item label="物料状态" prop="materialStatus">
+          <el-input v-model="form.materialStatus" placeholder="请输入物料状态"/>
+        </el-form-item>
+        <el-form-item label="合成相应因子" prop="responseFactor">
+          <el-input v-model="form.responseFactor" placeholder="请输入合成相应因子"/>
+        </el-form-item>
+        <el-form-item label="相应因子来源" prop="responseFactorFrom">
+          <el-input v-model="form.responseFactorFrom" placeholder="请输入相应因子来源"/>
         </el-form-item>
         <el-form-item label="备注" prop="remark">
-          <el-input v-model="form.remark" placeholder="请输入备注" />
+          <el-input v-model="form.remark" placeholder="请输入备注"/>
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -187,9 +206,10 @@
 </template>
 
 <script>
-import { listDevice, getDevice, delDevice, addDevice, updateDevice } from "@/api/base/device";
+import {listDevice, getDevice, delDevice, addDevice, updateDevice} from "@/api/base/device";
 import {getAllPlantName} from "@/api/base/plant";
 import {getAllRegion} from "@/api/base/region";
+import {MessageBox} from 'element-ui'
 
 export default {
   name: "Device",
@@ -197,12 +217,13 @@ export default {
     return {
       plantOperation: [],
       regionOperation: [],
-      approveStatusOperation:[],
-      clientHeight:300,
+      approveStatusOperation: [],
+      clientHeight: 300,
       // 遮罩层
       loading: true,
       // 选中数组
       ids: [],
+      status: [],
       // 非单个禁用
       single: true,
       // 非多个禁用
@@ -231,7 +252,11 @@ export default {
         createrCode: null,
         createdate: null,
         updaterCode: null,
-        updatedate: null
+        updatedate: null,
+        responseFactorFrom: null,
+        responseFactor: null,
+        materialStatus: null,
+        material: null
       },
       // 表单参数
       form: {},
@@ -321,10 +346,14 @@ export default {
         createrCode: null,
         createdate: null,
         updaterCode: null,
-        updatedate: null
+        updatedate: null,
+        responseFactorFrom: null,
+        responseFactor: null,
+        materialStatus: null,
+        material: null
       };
       this.resetForm("form");
-      this.regionOperation=[];
+      this.regionOperation = [];
     },
     /** 搜索按钮操作 */
     handleQuery() {
@@ -339,7 +368,8 @@ export default {
     // 多选框选中数据
     handleSelectionChange(selection) {
       this.ids = selection.map(item => item.id)
-      this.single = selection.length!==1
+      this.status = selection.map(item => item.approveStatus)
+      this.single = selection.length !== 1
       this.multiple = !selection.length
     },
     /** 新增按钮操作 */
@@ -352,11 +382,17 @@ export default {
     handleUpdate(row) {
       this.reset();
       const id = row.id || this.ids
+      if (row.approveStatus != 0) {
+        MessageBox.alert('已送审/已审核的数据不可修改!', '注意!', {
+          confirmButtonText: '确定',
+        })
+        return;
+      }
       getDevice(id).then(response => {
         this.form = response.data;
         getAllRegion(this.form.plantId).then(response => {
             this.regionOperation = response.data;
-          console.log(this.regionOperation)
+            console.log(this.regionOperation)
           }
         )
         this.open = true;
@@ -386,12 +422,24 @@ export default {
     /** 删除按钮操作 */
     handleDelete(row) {
       const ids = row.id || this.ids;
-      this.$modal.confirm('是否确认删除设备/管线编号为"' + ids + '"的数据项?').then(function() {
+      const status = (row.approveStatus==0?'0':row.approveStatus) || this.status;
+      let list=[];
+      list.push(status)
+      for (const s of list) {
+        if (s != 0) {
+          MessageBox.alert('已送审/已审核的数据不可删除!', '注意!', {
+            confirmButtonText: '确定',
+          })
+          return
+        }
+      }
+      this.$modal.confirm('是否确认删除设备/管线编号为"' + ids + '"的数据项?').then(function () {
         return delDevice(ids);
       }).then(() => {
         this.getList();
         this.$modal.msgSuccess("删除成功");
-      }).catch(() => {});
+      }).catch(() => {
+      });
     },
     /** 导出按钮操作 */
     handleExport() {

+ 20 - 0
ui/src/views/base/plant/index.vue

@@ -194,6 +194,7 @@
 
 <script>
 import {listPlant, getPlant, delPlant, addPlant, updatePlant} from "@/api/base/plant";
+import {MessageBox} from "element-ui";
 
 export default {
   name: "Plant",
@@ -206,6 +207,7 @@ export default {
       loading: true,
       // 选中数组
       ids: [],
+      status: [],
       // 非单个禁用
       single: true,
       // 非多个禁用
@@ -346,6 +348,7 @@ export default {
     // 多选框选中数据
     handleSelectionChange(selection) {
       this.ids = selection.map(item => item.id)
+      this.status = selection.map(item => item.approveStatus)
       this.single = selection.length !== 1
       this.multiple = !selection.length
     },
@@ -358,6 +361,12 @@ export default {
     /** 修改按钮操作 */
     handleUpdate(row) {
       this.reset();
+      if (row.approveStatus!=0){
+        MessageBox.alert('已送审/已审核的数据不可修改!', '注意!', {
+          confirmButtonText: '确定',
+        })
+        return;
+      }
       const id = row.id || this.ids
       getPlant(id).then(response => {
         this.form = response.data;
@@ -388,6 +397,17 @@ export default {
     /** 删除按钮操作 */
     handleDelete(row) {
       const ids = row.id || this.ids;
+      const status = (row.approveStatus==0?'0':row.approveStatus) || this.status;
+      let list=[];
+      list.push(status)
+      for (const s of list) {
+        if (s != 0) {
+          MessageBox.alert('已送审/已审核的数据不可删除!', '注意!', {
+            confirmButtonText: '确定',
+          })
+          return
+        }
+      }
       this.$modal.confirm('是否确认删除装置编号为"' + ids + '"的数据项?').then(function () {
         return delPlant(ids);
       }).then(() => {

+ 20 - 0
ui/src/views/base/point/index.vue

@@ -472,6 +472,7 @@ import {listPoint, getPoint, delPoint, addPoint, updatePoint} from "@/api/base/p
 import {getAllPlantName} from "@/api/base/plant";
 import {getAllRegion} from "@/api/base/region";
 import {getAllDeviceByRegionId} from "@/api/base/device";
+import {MessageBox} from "element-ui";
 
 export default {
   name: "Point",
@@ -486,6 +487,7 @@ export default {
       loading: true,
       // 选中数组
       ids: [],
+      status: [],
       // 非单个禁用
       single: true,
       // 非多个禁用
@@ -737,6 +739,7 @@ export default {
     // 多选框选中数据
     handleSelectionChange(selection) {
       this.ids = selection.map(item => item.id)
+      this.status = selection.map(item => item.approveStatus)
       this.single = selection.length !== 1
       this.multiple = !selection.length
     },
@@ -750,6 +753,12 @@ export default {
     handleUpdate(row) {
       this.reset();
       const id = row.id || this.ids
+      if (row.approveStatus != 0) {
+        MessageBox.alert('已送审/已审核的数据不可删除!', '注意!', {
+          confirmButtonText: '确定',
+        })
+        return
+      }
       getPoint(id).then(response => {
         this.form = response.data;
         getAllRegion(this.form.plantId).then(response => {
@@ -787,6 +796,17 @@ export default {
     /** 删除按钮操作 */
     handleDelete(row) {
       const ids = row.id || this.ids;
+      const status = (row.approveStatus==0?'0':row.approveStatus) || this.status;
+      let list=[];
+      list.push(status)
+      for (const s of list) {
+        if (s != 0) {
+          MessageBox.alert('已送审/已审核的数据不可删除!', '注意!', {
+            confirmButtonText: '确定',
+          })
+          return
+        }
+      }
       this.$modal.confirm('是否确认删除密封点编号为"' + ids + '"的数据项?').then(function () {
         return delPoint(ids);
       }).then(() => {

+ 20 - 0
ui/src/views/base/region/index.vue

@@ -176,6 +176,7 @@
 <script>
 import { listRegion, getRegion, delRegion, addRegion, updateRegion } from "@/api/base/region";
 import {getAllPlantName} from "@/api/base/plant";
+import {MessageBox} from "element-ui";
 
 export default {
   name: "Region",
@@ -188,6 +189,7 @@ export default {
       loading: true,
       // 选中数组
       ids: [],
+      status: [],
       // 非单个禁用
       single: true,
       // 非多个禁用
@@ -308,6 +310,7 @@ export default {
     // 多选框选中数据
     handleSelectionChange(selection) {
       this.ids = selection.map(item => item.id)
+      this.status = selection.map(item => item.approveStatus)
       this.single = selection.length!==1
       this.multiple = !selection.length
     },
@@ -321,6 +324,12 @@ export default {
     handleUpdate(row) {
       this.reset();
       const id = row.id || this.ids
+      if (row.approveStatus != 0) {
+        MessageBox.alert('已送审/已审核的数据不可删除!', '注意!', {
+          confirmButtonText: '确定',
+        })
+        return;
+      }
       getRegion(id).then(response => {
         this.form = response.data;
         this.open = true;
@@ -350,6 +359,17 @@ export default {
     /** 删除按钮操作 */
     handleDelete(row) {
       const ids = row.id || this.ids;
+      const status = (row.approveStatus==0?'0':row.approveStatus) || this.status;
+      let list=[];
+      list.push(status)
+      for (const s of list) {
+        if (s != 0) {
+          MessageBox.alert('已送审/已审核的数据不可删除!', '注意!', {
+            confirmButtonText: '确定',
+          })
+          return
+        }
+      }
       this.$modal.confirm('是否确认删除区域编号为"' + ids + '"的数据项?').then(function() {
         return delRegion(ids);
       }).then(() => {