Sfoglia il codice sorgente

硬件表增加是否灭火设备字段

xuxiaofei 3 anni fa
parent
commit
3288e95a99

+ 7 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/LabHardware.java

@@ -195,6 +195,9 @@ public class LabHardware extends BaseEntity {
     @ApiModelProperty(value = "供应厂商")
     @ApiModelProperty(value = "供应厂商")
     private Integer manufacturerType;
     private Integer manufacturerType;
 
 
+    @ApiModelProperty(value = "是否灭火主机")
+    private Integer isPcfire;
+
     public Integer getManufacturerType() {
     public Integer getManufacturerType() {
         return manufacturerType;
         return manufacturerType;
     }
     }
@@ -457,4 +460,8 @@ public class LabHardware extends BaseEntity {
     public void setDeviceStatus(Integer deviceStatus) {
     public void setDeviceStatus(Integer deviceStatus) {
         this.deviceStatus = deviceStatus;
         this.deviceStatus = deviceStatus;
     }
     }
+
+    public Integer getIsPcfire() {        return isPcfire;    }
+
+    public void setIsPcfire(Integer isPcfire) {        this.isPcfire = isPcfire;    }
 }
 }

+ 5 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabSubjectManagerService.java

@@ -187,6 +187,11 @@ public class LabSubjectManagerService {
             logger.error("未关联继电器位!id:{},名称:{}", id, labHardwareVO.getName());
             logger.error("未关联继电器位!id:{},名称:{}", id, labHardwareVO.getName());
             return false;
             return false;
         }
         }
+        if (1==labHardwareVO.getIsPcfire()) {
+            //一键灭火的设备不允许做开关操作
+            logger.error("不支持做该设备开关操作!");
+            return false;
+        }
         if (labHardwareVO.getHardwareType() == 2) {
         if (labHardwareVO.getHardwareType() == 2) {
             ResultData ResultData = socketService.sendMqttCommand(labHardwareVO.getId(), labHardwareVO.getRelayCode(), command, labHardwareVO.getBit(),labHardwareVO.getSubjectId());
             ResultData ResultData = socketService.sendMqttCommand(labHardwareVO.getId(), labHardwareVO.getRelayCode(), command, labHardwareVO.getBit(),labHardwareVO.getSubjectId());
             boolean equals = ResultData.getCode().equals(HttpStatus.SUCCESS);
             boolean equals = ResultData.getCode().equals(HttpStatus.SUCCESS);

+ 5 - 0
zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/LabHardwareMapper.xml

@@ -38,6 +38,7 @@
         <result property="joinCabinet" column="join_cabinet"/>
         <result property="joinCabinet" column="join_cabinet"/>
         <result property="deviceStatus" column="device_status"/>
         <result property="deviceStatus" column="device_status"/>
         <result property="manufacturerType" column="manufacturer_type"/>
         <result property="manufacturerType" column="manufacturer_type"/>
+        <result property="isPcfire" column="is_pcfire"/>
     </resultMap>
     </resultMap>
 
 
     <resultMap type="com.zd.laboratory.domain.vo.LabHardwareVO" id="LabHardwareVOResult">
     <resultMap type="com.zd.laboratory.domain.vo.LabHardwareVO" id="LabHardwareVOResult">
@@ -55,6 +56,7 @@
                      he.name,
                      he.name,
                      he.factory,
                      he.factory,
                      he.type,
                      he.type,
+                     he.is_pcfire,
                      he.pc_type,
                      he.pc_type,
                      he.mac_add,
                      he.mac_add,
                      he.subject_id,
                      he.subject_id,
@@ -373,6 +375,7 @@
             <if test="channels != null">channels,</if>
             <if test="channels != null">channels,</if>
 
 
             <if test="lockId != null">lock_id,</if>
             <if test="lockId != null">lock_id,</if>
+            <if test="isPcfire != null">is_pcfire,</if>
         </trim>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
             <if test="id != null">#{id},</if>
@@ -405,6 +408,7 @@
             <if test="sessionIndex != null">#{sessionIndex},</if>
             <if test="sessionIndex != null">#{sessionIndex},</if>
             <if test="channels != null">#{channels},</if>
             <if test="channels != null">#{channels},</if>
             <if test="lockId != null">#{lockId},</if>
             <if test="lockId != null">#{lockId},</if>
+            <if test="isPcfire != null">#{isPcfire},</if>
         </trim>
         </trim>
     </insert>
     </insert>
 
 
@@ -442,6 +446,7 @@
             <if test="operateTime != null">operate_time=#{operateTime},</if>
             <if test="operateTime != null">operate_time=#{operateTime},</if>
             <if test="deviceStatus != null">device_status=#{deviceStatus},</if>
             <if test="deviceStatus != null">device_status=#{deviceStatus},</if>
             <if test="manufacturerType != null">manufacturer_type=#{manufacturerType},</if>
             <if test="manufacturerType != null">manufacturer_type=#{manufacturerType},</if>
+            <if test="isPcfire != null">is_pcfire=#{isPcfire},</if>
         </trim>
         </trim>
         where id = #{id}
         where id = #{id}
     </update>
     </update>