xuxiaofei лет назад: 2
Родитель
Сommit
82f1c967e2

+ 14 - 0
zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/entity/LabSubjectControllerVO.java

@@ -69,6 +69,12 @@ public class LabSubjectControllerVO extends LabSubjectEntity {
 
     @ApiModelProperty("实验室详情")
     private String details;
+
+    /***
+     * 关联的硬件 1海康 2电子信息牌
+     */
+    private Integer hardwareType;
+
     /**
      * 实验室类型ID
      */
@@ -439,4 +445,12 @@ public class LabSubjectControllerVO extends LabSubjectEntity {
     public void setDetails(String details) {
         this.details = details;
     }
+
+    public Integer getHardwareType() {
+        return hardwareType;
+    }
+
+    public void setHardwareType(Integer hardwareType) {
+        this.hardwareType = hardwareType;
+    }
 }

+ 20 - 1
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabSecuritySubjectmaterialController.java

@@ -4,6 +4,9 @@ import java.util.*;
 import java.io.IOException;
 import javax.servlet.http.HttpServletResponse;
 
+import com.zd.common.core.utils.StringUtils;
+import com.zd.laboratory.domain.XxpCardInfo;
+import com.zd.laboratory.service.IXxpCardInfoService;
 import com.zd.model.domain.per.PerFun;
 import com.zd.model.domain.per.PerPrefix;
 import com.zd.model.domain.ResultData;
@@ -54,6 +57,9 @@ public class LabSecuritySubjectmaterialController extends BaseController
     private ILabSecurityMaterialDataService labSecurityMaterialDataService;
 
     @Autowired
+    private IXxpCardInfoService xxpCardInfoService;
+
+    @Autowired
     private TokenService tokenService;
 
     /**
@@ -147,17 +153,30 @@ public class LabSecuritySubjectmaterialController extends BaseController
      * @return
      */
     @GetMapping("/listData")
-    public ResultData  listData() {
+    public ResultData  listData(LabSecurityMaterialDataVO materialDataVO) {
         Map<String,Object> map = new HashMap<String,Object>();
          List<LabSecurityMaterialDataVO> listTeacher= labSecurityMaterialDataService.selectTemplateTeacherList();
          List<LabSecurityMaterialDataVO> listStudent= labSecurityMaterialDataService.selectTemplateStudentList();
 
+         //查询实验室下的电子信息牌
+        XxpCardInfo cardInfo = new XxpCardInfo();;
+        if(StringUtils.isNotNull(materialDataVO.getSubjectId())){
+            cardInfo.setSubjectId(materialDataVO.getSubjectId());
+            List<XxpCardInfo> cardInfoList = xxpCardInfoService.selectXxpCardInfoList(cardInfo);
+            if(cardInfoList.size()>0){
+                cardInfo = cardInfoList.get(0);
+            }
+        }
+
+
+
         /* //教职工模板
         List<LabSecuritySubjectmaterialVO> listTeacher=  labSecuritySubjectmaterialService.selectTeacherList();
         //学生模板
         List<LabSecuritySubjectmaterialVO> listStudent=  labSecuritySubjectmaterialService.selectStudentList();*/
         map.put("listTeacher",listTeacher);
         map.put("listStudent",listStudent);
+        map.put("cardInfo",cardInfo);
         return ResultData.success(map);
     }
 

+ 13 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/LabSubject.java

@@ -240,6 +240,11 @@ public class LabSubject extends BaseEntity implements QCInterface {
      */
     private String details;
 
+    /***
+     * 关联的硬件 1海康 2电子信息牌
+     */
+    private Integer hardwareType;
+
     private List<Long> deptIds;
 
     /**
@@ -627,4 +632,12 @@ public class LabSubject extends BaseEntity implements QCInterface {
     public void setClassifyList(List<XxpClassify> classifyList) {
         this.classifyList = classifyList;
     }
+
+    public Integer getHardwareType() {
+        return hardwareType;
+    }
+
+    public void setHardwareType(Integer hardwareType) {
+        this.hardwareType = hardwareType;
+    }
 }

+ 4 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/XxpCardInfo.java

@@ -76,6 +76,10 @@ public class XxpCardInfo extends BaseEntity {
     @ApiModelProperty(value = "授权方式")
     private Integer authType;
 
+    @Excel(name = "授权密码")
+    @ApiModelProperty(value = "授权密码")
+    private String authPwd;
+
     /**
      * 实验室id
      */

+ 12 - 2
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/vo/LabSecurityMaterialDataVO.java

@@ -19,7 +19,11 @@ import java.util.Map;
  */
 @ApiModel("安全检查模板表")
 public class LabSecurityMaterialDataVO extends LabSecurityMaterialData {
-    //材料表集合
+
+    List<LabSecurityMaterialrelation>  listMr; //材料表集合
+
+    Long subjectId;//实验室id
+
     public List<LabSecurityMaterialrelation> getListMr() {
         return listMr;
     }
@@ -28,5 +32,11 @@ public class LabSecurityMaterialDataVO extends LabSecurityMaterialData {
         this.listMr = listMr;
     }
 
-    List<LabSecurityMaterialrelation>  listMr;
+    public Long getSubjectId() {
+        return subjectId;
+    }
+
+    public void setSubjectId(Long subjectId) {
+        this.subjectId = subjectId;
+    }
 }

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

@@ -24,6 +24,10 @@ public class LabSecuritySubjectmaterialVO extends LabSecuritySubjectmaterial {
 
     private List<LabSecuritySubjectmaterial> publicList;//通用模板
 
+    private Integer authType;//授权方式
+
+    private String authPwd;//授权密码
+
     public Long getIscheck() {        return ischeck;    }
 
     public void setIscheck(Long ischeck) {        this.ischeck = ischeck;    }
@@ -69,4 +73,12 @@ public class LabSecuritySubjectmaterialVO extends LabSecuritySubjectmaterial {
     public void setPublicList(List<LabSecuritySubjectmaterial> publicList) {
         this.publicList = publicList;
     }
+
+    public Integer getAuthType() {        return authType;    }
+
+    public void setAuthType(Integer authType) {        this.authType = authType;    }
+
+    public String getAuthPwd() {        return authPwd;    }
+
+    public void setAuthPwd(String authPwd) {        this.authPwd = authPwd;    }
 }

+ 17 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabSecuritySubjectmaterialServiceImpl.java

@@ -7,7 +7,9 @@ import com.zd.common.core.security.TokenService;
 import com.zd.common.core.utils.SaveUtil;
 
 import com.zd.laboratory.domain.LabSubject;
+import com.zd.laboratory.domain.XxpCardInfo;
 import com.zd.laboratory.domain.vo.LabSecuritySubjectmaterialVO;
+import com.zd.laboratory.service.IXxpCardInfoService;
 import com.zd.model.entity.SysUser;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -31,6 +33,9 @@ public class LabSecuritySubjectmaterialServiceImpl implements ILabSecuritySubjec
     @Autowired
     private TokenService tokenService;
 
+    @Autowired
+    private IXxpCardInfoService xxpCardInfoService;
+
     /**
      * 查询实验室和准入模板关系
      *
@@ -146,6 +151,18 @@ public class LabSecuritySubjectmaterialServiceImpl implements ILabSecuritySubjec
     public int addList(LabSecuritySubjectmaterialVO labSecuritySubjectmaterialVO) {
         SysUser sysUser = tokenService.getLoginUser().getSysUser();
         List<LabSubject> labSubjectList= labSecuritySubjectmaterialVO.getLabSubjectList();//实验室集合
+
+        //配置信息牌 考勤方式和考勤密码
+        XxpCardInfo cardInfo = new XxpCardInfo();
+        cardInfo.setSubjectId(labSubjectList.get(0).getId());
+        List<XxpCardInfo> xxpList =  xxpCardInfoService.selectXxpCardInfoList(cardInfo);
+        if(xxpList.size()>0){
+            cardInfo = xxpList.get(0);
+            cardInfo.setAuthType(labSecuritySubjectmaterialVO.getAuthType());
+            cardInfo.setAuthPwd(labSecuritySubjectmaterialVO.getAuthPwd());
+            xxpCardInfoService.updateXxpCardInfo(cardInfo);
+        }
+
         //删除改实验室模板重新添加
         labSecuritySubjectmaterialMapper.deleteLabSecurityMaterialDataBysubjectId(labSubjectList.get(0).getId());
         int id=0;

+ 14 - 3
zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/LabSubjectMapper.xml

@@ -32,6 +32,7 @@
         <result property="inspectCheckCount" column="inspect_check_count"/>
         <result property="inspectSignTime" column="inspect_sign_time"/>
         <result property="details" column="details"/>
+        <result property="hardwareType" column="hardware_type"/>
     </resultMap>
 
     <resultMap type="com.zd.laboratory.domain.vo.LabSubjectVO" id="LabSubjectResultVO">
@@ -81,6 +82,7 @@
         <result property="inspectCheckCount" column="inspect_check_count"/>
         <result property="inspectSignTime" column="inspect_sign_time"/>
         <result property="details" column="details"/>
+        <result property="hardwareType" column="hardware_type"/>
     </resultMap>
 
     <resultMap type="com.zd.laboratory.domain.vo.LabSubjectDetailVO" id="subjectAndInfoResult">
@@ -123,6 +125,7 @@
         <result property="inspectCheckCount" column="inspect_check_count"/>
         <result property="inspectSignTime" column="inspect_sign_time"/>
         <result property="details" column="details"/>
+        <result property="hardwareType" column="hardware_type"/>
 
         <collection property="hazardSubjectRelations" column="id"
                     ofType="com.zd.laboratory.domain.LabHazardSubjectRelation"
@@ -171,6 +174,7 @@
                inspect_check_count,
                inspect_sign_time,
                details,
+               hardware_type,
                (SELECT GROUP_CONCAT(ur.nick_name)
                 FROM sys_user ur
                 WHERE ur.`user_id`
@@ -256,6 +260,7 @@
                t.inspect_check_count,
                t.inspect_sign_time,
                t.details,
+               t.hardware_type,
                (select i.id from xxp_card_info i where i.subJect_id=t.id LIMIT 1)         xxpCardInfoId,
                CONCAT(su.nick_name, '@', su.phonenumber)                      AS          adminNameAndPhone,
 
@@ -312,7 +317,8 @@
                t.inspect_skipped,
                t.inspect_check_count,
                t.inspect_sign_time,
-               t.details
+               t.details,
+               t.hardware_type
         from lab_subject t
                  left join sys_user su on su.user_id = t.admin_id
                  left join sys_dept sd on sd.dept_id = t.dept_id
@@ -462,7 +468,8 @@
         t.inspect_skipped,
         t.inspect_check_count,
         t.inspect_sign_time,
-        t.details
+        t.details,
+        t.hardware_type
         from lab_subject t
         left join sys_user su on su.user_id = t.admin_id AND su.`del_flag`=0
         left join sys_dept sd on sd.dept_id = t.dept_id
@@ -585,6 +592,7 @@
             <if test="inspectCheckCount != null">inspect_check_count,</if>
             <if test="inspectSignTime != null">inspect_sign_time,</if>
             <if test="details != null">details,</if>
+            <if test="hardwareType != null">hardware_type,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
@@ -625,6 +633,7 @@
             <if test="inspectCheckCount != null">#{inspectCheckCount},</if>
             <if test="inspectSignTime != null">#{inspectSignTime},</if>
             <if test="details != null">#{details},</if>
+            <if test="hardwareType != null">#{hardwareType},</if>
         </trim>
     </insert>
 
@@ -669,6 +678,7 @@
             <if test="inspectCheckCount != null">inspect_check_count = #{inspectCheckCount},</if>
             <if test="inspectSignTime != null">inspect_sign_time = #{inspectSignTime},</if>
             <if test="details != null">details = #{details},</if>
+            <if test="hardwareType != null">hardware_type = #{hardwareType},</if>
         </trim>
         where id = #{id}
     </update>
@@ -1127,7 +1137,8 @@
             <if test="name != null and name !=''">
                 and s.name like concat('%', #{name}, '%')
             </if>
-            and id not in( select subject_id from xxp_card_info <if test="id != null ">where subject_id != #{id}</if> )
+            and id not in( select subject_id from xxp_card_info  )
+            <if test="id != null ">or s.id = #{id}</if>
         </where>
         <!-- 数据范围过滤 -->
         ${params.dataScope}

+ 6 - 0
zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/XxpCardInfoMapper.xml

@@ -13,6 +13,7 @@
         <result property="location" column="location"/>
         <result property="operate" column="operate"/>
         <result property="authType" column="auth_type"/>
+        <result property="authPwd" column="auth_pwd"/>
         <result property="subjectId" column="subject_id"/>
         <result property="subjectName" column="subject_name"/>
         <result property="deptId" column="dept_id"/>
@@ -34,6 +35,7 @@
                location,
                operate,
                auth_type,
+               auth_pwd,
                subject_id,
                subject_name,
                dept_id,
@@ -58,6 +60,7 @@
             <if test="location != null and location != '' ">and t.location = #{location}</if>
             <if test="operate != null ">and t.operate = #{operate}</if>
             <if test="authType != null ">and t.auth_type = #{authType}</if>
+            <if test="authPwd != null ">and t.auth_pwd = #{authPwd}</if>
             <if test="subjectId != null ">and t.subject_id = #{subjectId}</if>
             <if test="subjectName != null ">and t.subject_name = #{subjectName}</if>
             <if test="deptId != null ">and ( t.dept_id in (SELECT dt.dept_id FROM sys_dept dt WHERE
@@ -95,6 +98,7 @@
             <if test="location != null">location,</if>
             <if test="operate != null">operate,</if>
             <if test="authType != null">auth_type,</if>
+            <if test="authPwd != null">auth_pwd,</if>
             <if test="subjectId != null">subject_id,</if>
             <if test="subjectName != null">subject_name,</if>
             <if test="deptId != null">dept_id,</if>
@@ -114,6 +118,7 @@
             <if test="location != null">#{location},</if>
             <if test="operate != null">#{operate},</if>
             <if test="authType != null">#{authType},</if>
+            <if test="authPwd != null">#{authPwd},</if>
             <if test="subjectId != null">#{subjectId},</if>
             <if test="subjectName != null">#{subjectName},</if>
             <if test="deptId != null">#{deptId},</if>
@@ -137,6 +142,7 @@
             <if test="location != null">location = #{location},</if>
             <if test="operate != null">operate = #{operate},</if>
             <if test="authType != null">auth_type = #{authType},</if>
+            <if test="authPwd != null">auth_pwd = #{authPwd},</if>
             <if test="subjectId != null">subject_id = #{subjectId},</if>
             <if test="subjectName != null">subject_name = #{subjectName},</if>
             <if test="deptId != null">dept_id = #{deptId},</if>