Ver código fonte

验证方式修改,通知电子信息牌

xuxiaofei 2 anos atrás
pai
commit
dc1674a5da

+ 12 - 1
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabSecuritySubjectmaterialServiceImpl.java

@@ -2,15 +2,19 @@ package com.zd.laboratory.service.impl;
 
 import java.util.Date;
 import java.util.List;
-import com.zd.common.core.utils.DateUtils;
 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.mqtt.entiy.MessageBody;
+import com.zd.laboratory.mqtt.service.impl.CommonSend;
 import com.zd.laboratory.service.IXxpCardInfoService;
+import com.zd.model.constant.MqttConstants;
 import com.zd.model.entity.SysUser;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.zd.laboratory.mapper.LabSecuritySubjectmaterialMapper;
@@ -27,6 +31,7 @@ import org.springframework.transaction.annotation.Transactional;
 @Service
 public class LabSecuritySubjectmaterialServiceImpl implements ILabSecuritySubjectmaterialService
 {
+    private static Logger logger = LoggerFactory.getLogger(LabSecuritySubjectmaterialServiceImpl.class);
     @Autowired
     private LabSecuritySubjectmaterialMapper labSecuritySubjectmaterialMapper;
 
@@ -36,6 +41,8 @@ public class LabSecuritySubjectmaterialServiceImpl implements ILabSecuritySubjec
     @Autowired
     private IXxpCardInfoService xxpCardInfoService;
 
+    @Autowired
+    private CommonSend commonSend;
     /**
      * 查询实验室和准入模板关系
      *
@@ -158,6 +165,10 @@ public class LabSecuritySubjectmaterialServiceImpl implements ILabSecuritySubjec
         List<XxpCardInfo> xxpList =  xxpCardInfoService.selectXxpCardInfoList(cardInfo);
         if(xxpList.size()>0){
             cardInfo = xxpList.get(0);
+            if(!labSecuritySubjectmaterialVO.getAuthType().equals(cardInfo.getAuthType())){
+                commonSend.send(MqttConstants.TOPIC_LAB_SUB_INFO + labSubjectList.get(0).getId(), new MessageBody(labSecuritySubjectmaterialVO.getAuthType()+""));
+                logger.info("通知电子信息牌,实验室验证方式已经修改");
+            }
             cardInfo.setAuthType(labSecuritySubjectmaterialVO.getAuthType());
             cardInfo.setAuthPwd(labSecuritySubjectmaterialVO.getAuthPwd());
             xxpCardInfoService.updateXxpCardInfo(cardInfo);