Explorar o código

Merge branch 'dev' of http://192.168.1.43:3000/v2/zd-parents into dev

chaiyunlong %!s(int64=3) %!d(string=hai) anos
pai
achega
9b9497611e

+ 5 - 4
zd-model/src/main/java/com/zd/model/constant/HttpStatus.java

@@ -27,6 +27,11 @@ public interface HttpStatus {
     int NO_CONTENT = 204;
 
     /**
+     * 操作执行成功,但有部分失败数据
+     */
+    int NOT_IMPLEMENTED = 205;
+
+    /**
      * 资源已被移除
      */
     int MOVED_PERM = 301;
@@ -81,8 +86,4 @@ public interface HttpStatus {
      */
     int ERROR = 500;
 
-    /**
-     * 接口未实现
-     */
-    int NOT_IMPLEMENTED = 501;
 }

+ 12 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/vo/HaikangSubVo.java

@@ -2,6 +2,7 @@ package com.zd.laboratory.domain.vo;
 
 import com.zd.model.entity.BaseEntity;
 import com.zd.model.enums.HardwareOperate;
+import com.zd.model.enums.HardwareTypeEnum;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 
@@ -42,6 +43,9 @@ public class HaikangSubVo extends BaseEntity {
     @ApiModelProperty(value = "设备应用范围(1 安全准入,2 白名单)")
     private String controlScope;
 
+    @ApiModelProperty("设备类型")
+    private HardwareTypeEnum type;
+
     public String getSearchValue() {
         return searchValue;
     }
@@ -137,4 +141,12 @@ public class HaikangSubVo extends BaseEntity {
     public void setFailNum(Integer failNum) {
         this.failNum = failNum;
     }
+
+    public HardwareTypeEnum getType() {
+        return type;
+    }
+
+    public void setType(HardwareTypeEnum type) {
+        this.type = type;
+    }
 }

+ 3 - 1
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabHaikangUserServiceImpl.java

@@ -15,6 +15,7 @@ import com.zd.laboratory.domain.vo.HaikangUserVo;
 import com.zd.laboratory.mapper.LabHaikangUserMapper;
 import com.zd.laboratory.service.LabHaikangUserService;
 import com.zd.model.domain.per.PerPrefix;
+import com.zd.model.enums.HardwareTypeEnum;
 import org.apache.commons.collections4.CollectionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -88,6 +89,7 @@ public class LabHaikangUserServiceImpl implements LabHaikangUserService {
     @Override
     @DataScope(deptAlias = "dt", userAlias = "har", permi = PerPrefix.HAIKANG_DOOR)
     public List<HaikangSubVo> querySubList(HaikangSubVo haikangSubVo) {
+        haikangSubVo.setType(HardwareTypeEnum.HK_DOOR);
         return labHaikangUserMapper.querySubList(haikangSubVo);
     }
 
@@ -190,7 +192,7 @@ public class LabHaikangUserServiceImpl implements LabHaikangUserService {
     public List<HaikangSubVo> queryMySubList(HaikangSubVo haikangSubVo) {
 
         haikangSubVo.setIds(labHaikangUserMapper.queryHardIdsByUserId(SecurityUtils.getUserId()));
-
+        haikangSubVo.setType(HardwareTypeEnum.HK_DOOR);
         List<HaikangSubVo> list = labHaikangUserMapper.querySubList(haikangSubVo);
 
         return list;

+ 1 - 1
zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/LabHaikangUserMapper.xml

@@ -218,7 +218,7 @@
                 left join lab_subject_layout slt on slt.id = s.layout_id
                 left join sys_dept dt1 on dt1.dept_id = s.dept_id
             where
-                har.type = 10
+                har.type = #{type}
 
                 <if test="operate != null">
                     and har.operate = #{operate}

+ 15 - 2
zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/LabHardwareMapper.xml

@@ -112,7 +112,8 @@
                      he.join_cabinet_time                                          joinCabinetTime,
                      he.lock_id                                                    lockId,
                      he.device_status                                              deviceStatus,
-                     he.manufacturer_type                                          manufacturerType
+                     he.manufacturer_type                                          manufacturerType,
+                     he.har_user, he.har_psw, he.control_scope
               from lab_hardware he
                        LEFT JOIN hxp_smart_terminal_config stc ON he.id = stc.terminal_id) xx
                  left join lab_subject_hardware_position hp on hp.hard_id = xx.id
@@ -273,7 +274,7 @@
         session_index,
         manufacturer_type,
         channels,
-        bit
+        bit, har_user, har_psw, control_scope
         from
         lab_hardware
         <where>
@@ -383,6 +384,10 @@
             <if test="channels != null">channels,</if>
             <if test="lockId != null">lock_id,</if>
             <if test="isPcfire != null">is_pcfire,</if>
+
+            <if test="harUser != null">har_user,</if>
+            <if test="harPsw != null">har_psw,</if>
+            <if test="controlScope != null">control_scope,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
@@ -416,6 +421,10 @@
             <if test="channels != null">#{channels},</if>
             <if test="lockId != null">#{lockId},</if>
             <if test="isPcfire != null">#{isPcfire},</if>
+
+            <if test="harUser != null">#{harUser},</if>
+            <if test="harPsw != null">#{harPsw},</if>
+            <if test="controlScope != null">#{controlScope},</if>
         </trim>
     </insert>
 
@@ -454,6 +463,10 @@
             <if test="deviceStatus != null">device_status=#{deviceStatus},</if>
             <if test="manufacturerType != null">manufacturer_type=#{manufacturerType},</if>
             <if test="isPcfire != null">is_pcfire=#{isPcfire},</if>
+
+            <if test="harUser != null">har_user=#{harUser},</if>
+            <if test="harPsw != null">har_psw=#{harPsw},</if>
+            <if test="controlScope != null">control_scope=#{controlScope},</if>
         </trim>
         where id = #{id}
     </update>