Selaa lähdekoodia

新增人证模式写入记录表

fllmoyu 5 vuotta sitten
vanhempi
commit
ce408c2f4a

+ 2 - 0
common/src/main/java/com/jpsoft/smart/modules/base/dao/PersonInfoDAO.java

@@ -37,4 +37,6 @@ public interface PersonInfoDAO {
     long countByCompanyId(String companyId);
 
     long countByCompanyIds(List<String> companyIds);
+
+    PersonInfo findByIdCardAndCompanyId(String idCard,String companyId);
 }

+ 12 - 0
common/src/main/java/com/jpsoft/smart/modules/base/entity/PersonDeviceLog.java

@@ -40,6 +40,12 @@ public class PersonDeviceLog {
     @ApiModelProperty(value = "人员id")
     private Integer personId;
 
+    /**
+     * 人员姓名
+     */
+    @ApiModelProperty(value = "人员姓名")
+    private String personName;
+
     @ApiModelProperty(value = "人员信息")
     private PersonInfo person;
 
@@ -49,6 +55,12 @@ public class PersonDeviceLog {
     @ApiModelProperty(value = "记录温度")
     private BigDecimal temperature;
 
+    /**
+     * 验证号码
+     */
+    @ApiModelProperty(value = "验证号码")
+    private String identityNo;
+
 
     /**
      * 匹配状态

+ 2 - 0
common/src/main/java/com/jpsoft/smart/modules/base/service/PersonInfoService.java

@@ -36,4 +36,6 @@ public interface PersonInfoService {
     long countByCompanyId(String companyId);
 
     long countByCompanyIds(List<String> companyIds);
+
+    PersonInfo addPersonForCompany(PersonInfo personInfo, String deviceNo);
 }

+ 8 - 5
common/src/main/java/com/jpsoft/smart/modules/base/service/impl/PersonDeviceFilterLogServiceImpl.java

@@ -90,12 +90,15 @@ public class PersonDeviceFilterLogServiceImpl implements PersonDeviceFilterLogSe
             //记录的时间段
             String recordTimeZons = DateUtil.format(date, "yyyy-MM-dd-HH-mm");
             String timeZones = TimeZonesUtil.getUpperTimeZone(recordTimeZons);
-            Integer personId = LApiUtil.getPersonCode(libMatInfoListJson, matchPersonInfo);
+            PersonInfo personInfo = LApiUtil.getPersonCode(libMatInfoListJson, matchPersonInfo);
+
+            PersonInfo personInfoReturn = personInfoService.addPersonForCompany(personInfo,deviceNo);
+           // Integer personId = LApiUtil.getPersonCode(libMatInfoListJson, matchPersonInfo);
             LApiUtil lApiUtil = new LApiUtil();
-            if (personId != 0 && temperature.compareTo(BigDecimal.ZERO) == 1) {
+            if (personInfoReturn.getId() != 0L && temperature.compareTo(BigDecimal.ZERO) == 1) {
 
 
-                PersonDeviceFilterLog personDeviceFilterLog = personDeviceFilterLogDAO.findByPersonIdAndDeviceNoAndTimeZones(personId, deviceNo, timeZones);
+                PersonDeviceFilterLog personDeviceFilterLog = personDeviceFilterLogDAO.findByPersonIdAndDeviceNoAndTimeZones(Math.toIntExact(personInfoReturn.getId()), deviceNo, timeZones);
 
                 if (personDeviceFilterLog != null) {
                     BigDecimal oldTemper = personDeviceFilterLog.getTemperature();
@@ -127,7 +130,7 @@ public class PersonDeviceFilterLogServiceImpl implements PersonDeviceFilterLogSe
                 } else {
                     PersonDeviceFilterLog personDeviceFilterLog1 = new PersonDeviceFilterLog();
                     personDeviceFilterLog1.setDeviceNo(deviceNo);
-                    personDeviceFilterLog1.setPersonId(personId);
+                    personDeviceFilterLog1.setPersonId(Math.toIntExact(personInfoReturn.getId()));
                     personDeviceFilterLog1.setTemperature(temperature);
                     if (StringUtils.isNotBlank(libMatInfoListJson.getStr("MatchStatus"))) {
                         personDeviceFilterLog1.setMatchStatus(libMatInfoListJson.getInt("MatchStatus"));
@@ -148,7 +151,7 @@ public class PersonDeviceFilterLogServiceImpl implements PersonDeviceFilterLogSe
 
                 new Thread(() -> {
                     try {
-                        addCheckNumForCompany(personId, temperature, date);
+                        addCheckNumForCompany(Math.toIntExact(personInfoReturn.getId()), temperature, date);
                     } catch (Exception e) {
                         log.error(e.getMessage(), e);
                     }

+ 11 - 3
common/src/main/java/com/jpsoft/smart/modules/base/service/impl/PersonDeviceLogServiceImpl.java

@@ -10,6 +10,7 @@ import com.jpsoft.smart.config.WxConfig;
 import com.jpsoft.smart.modules.base.dao.*;
 import com.jpsoft.smart.modules.base.entity.*;
 import com.jpsoft.smart.modules.base.service.PersonDeviceLogService;
+import com.jpsoft.smart.modules.base.service.PersonInfoService;
 import com.jpsoft.smart.modules.base.service.WarningPusherService;
 import com.jpsoft.smart.modules.common.dto.Sort;
 import com.jpsoft.smart.modules.common.utils.*;
@@ -52,6 +53,8 @@ public class PersonDeviceLogServiceImpl implements PersonDeviceLogService {
     @Autowired
     private WarningPusherService warningPusherService;
 
+    @Autowired
+    private PersonInfoService personInfoService;
 
     @Resource(name = "personDeviceLogDAO")
     private PersonDeviceLogDAO personDeviceLogDAO;
@@ -89,12 +92,17 @@ public class PersonDeviceLogServiceImpl implements PersonDeviceLogService {
             log.error("保存图片路径错误" + e.getMessage());
         }
 
-        Integer personId = LApiUtil.getPersonCode(libMatInfoListJson, matchPersonInfo);
+        PersonInfo personInfo = LApiUtil.getPersonCode(libMatInfoListJson, matchPersonInfo);
+
+        PersonInfo peronInfoReturn = personInfoService.addPersonForCompany(personInfo,deviceNo);
+      //  Integer personId = LApiUtil.getPersonCode(libMatInfoListJson, matchPersonInfo);
 
         PersonDeviceLog personDeviceLog = new PersonDeviceLog();
         personDeviceLog.setId(UUID.randomUUID().toString());
         personDeviceLog.setDeviceNo(deviceNo);
-        personDeviceLog.setPersonId(personId);
+        personDeviceLog.setPersonId(Math.toIntExact(peronInfoReturn.getId()));
+        personDeviceLog.setPersonName(personInfo.getName());
+        personDeviceLog.setIdentityNo(personInfo.getIdCard());
 
         personDeviceLog.setTemperature(temperature);
         LApiUtil lApiUtil = new LApiUtil();
@@ -116,7 +124,7 @@ public class PersonDeviceLogServiceImpl implements PersonDeviceLogService {
         //人员识别成功,温度超过限定时发送模板消息给监管者
         new Thread(()->{
             try {
-                if (personId != 0) {
+                if (personInfo.getId() != 0L) {
                     sendTemperatureAlarmsyncTask(personDeviceLog);
                 }
             }

+ 43 - 0
common/src/main/java/com/jpsoft/smart/modules/base/service/impl/PersonInfoServiceImpl.java

@@ -1,11 +1,16 @@
 package com.jpsoft.smart.modules.base.service.impl;
 
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 import java.util.UUID;
 import javax.annotation.Resource;
 
 import com.jpsoft.smart.modules.base.entity.CompanyInfo;
+import com.jpsoft.smart.modules.base.entity.DeviceInfo;
+import com.jpsoft.smart.modules.base.service.DeviceInfoService;
+import org.apache.commons.lang.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 import org.springframework.transaction.annotation.Transactional;
 import com.jpsoft.smart.modules.base.dao.PersonInfoDAO;
@@ -21,6 +26,9 @@ public class PersonInfoServiceImpl implements PersonInfoService {
 	@Resource(name="personInfoDAO")
 	private PersonInfoDAO personInfoDAO;
 
+	@Autowired
+	private DeviceInfoService deviceInfoService;
+
 	@Override
 	public PersonInfo get(Long id) {
 		// TODO Auto-generated method stub
@@ -130,4 +138,39 @@ public class PersonInfoServiceImpl implements PersonInfoService {
 	public long countByCompanyIds(List<String> companyIds) {
 		return personInfoDAO.countByCompanyIds(companyIds);
 	}
+
+	@Override
+	public PersonInfo addPersonForCompany(PersonInfo personInfo, String deviceNo) {
+
+		if (StringUtils.isNotBlank(personInfo.getName()) && StringUtils.isNotBlank(personInfo.getIdCard())){
+			DeviceInfo deviceInfo = deviceInfoService.getByDeviceNo(deviceNo);
+			if (deviceInfo!=null){
+				PersonInfo personInfo1 = personInfoDAO.findByIdCardAndCompanyId(personInfo.getIdCard(),deviceInfo.getCompanyId());
+				if (personInfo1 == null){
+					PersonInfo personInfo2 = new PersonInfo();
+					personInfo2.setCompanyId(deviceInfo.getCompanyId());
+					personInfo2.setName(personInfo.getName());
+					personInfo2.setIdCard(personInfo.getIdCard());
+					personInfo2.setDelFlag(false);
+					personInfo2.setCreateTime(new Date());
+					personInfo2.setPopedom("1");
+					personInfo2.setWechatNoticeEnabled(false);
+					personInfo2.setAllowViewLocal(false);
+					personInfoDAO.insert(personInfo2);
+					return personInfo2;
+				}else {
+					return personInfo1;
+				}
+
+
+			}else {
+				return personInfo;
+			}
+
+
+		}
+		else {
+			return personInfo;
+		}
+	}
 }

+ 77 - 80
common/src/main/java/com/jpsoft/smart/modules/common/utils/LApiUtil.java

@@ -3,6 +3,8 @@ package com.jpsoft.smart.modules.common.utils;
 import cn.hutool.http.HttpRequest;
 import com.alibaba.fastjson.JSONObject;
 import com.jpsoft.smart.config.TemperatureConfig;
+import com.jpsoft.smart.modules.base.entity.PersonInfo;
+import com.jpsoft.smart.modules.base.service.PersonInfoService;
 import com.jpsoft.smart.modules.lapi.channel.LapiChannel;
 import io.netty.handler.codec.http.DefaultHttpRequest;
 import io.netty.handler.codec.http.HttpMethod;
@@ -11,6 +13,7 @@ import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
+
 import java.math.BigDecimal;
 import java.util.HashMap;
 import java.util.Map;
@@ -23,10 +26,13 @@ import java.util.concurrent.TimeUnit;
 @Slf4j
 @Component
 public class LApiUtil {
-    private final static int TIMEOUT = 10*1000;
+    private final static int TIMEOUT = 10 * 1000;
+
+    @Autowired
+    private PersonInfoService personInfoService;
 
 
-    public static JSONObject postRequest(String url, HashMap map){
+    public static JSONObject postRequest(String url, HashMap map) {
         String body = HttpRequest.post(url)
                 .timeout(TIMEOUT)
                 .body(new JSONObject(map).toJSONString()).execute().body();
@@ -34,7 +40,7 @@ public class LApiUtil {
         return jsonbody;
     }
 
-    public static JSONObject getRequest(String url) throws Exception{
+    public static JSONObject getRequest(String url) throws Exception {
         String body = HttpRequest.get(url)
                 .timeout(TIMEOUT)
                 .execute().body();
@@ -44,14 +50,14 @@ public class LApiUtil {
     }
 
     public static JSONObject deleteRequest(String url) {
-       String body = HttpRequest.delete(url)
-               .timeout(TIMEOUT)
-               .execute().body();
-       JSONObject jsonbody = JSONObject.parseObject(body);
-       return jsonbody;
+        String body = HttpRequest.delete(url)
+                .timeout(TIMEOUT)
+                .execute().body();
+        JSONObject jsonbody = JSONObject.parseObject(body);
+        return jsonbody;
     }
 
-    public static JSONObject putRequest(String url){
+    public static JSONObject putRequest(String url) {
         String body = HttpRequest.put(url)
                 .timeout(TIMEOUT)
                 .execute().body();
@@ -60,7 +66,7 @@ public class LApiUtil {
         return jsonbody;
     }
 
-    public static JSONObject putRequest(String url,HashMap map){
+    public static JSONObject putRequest(String url, HashMap map) {
         String body = HttpRequest.put(url)
                 .timeout(TIMEOUT)
                 .body(new JSONObject(map).toJSONString()).execute().body();
@@ -69,152 +75,143 @@ public class LApiUtil {
         return jsonbody;
     }
 
-    public static JSONObject getResponse(JSONObject dataJson) throws Exception{
-        if (dataJson.getInteger("ResponseCode") == 1){
+    public static JSONObject getResponse(JSONObject dataJson) throws Exception {
+        if (dataJson.getInteger("ResponseCode") == 1) {
             throw new Exception("通用错误");
         }
-        if (dataJson.getInteger("ResponseCode") == 2){
+        if (dataJson.getInteger("ResponseCode") == 2) {
             throw new Exception("参数非法");
         }
-        if (dataJson.getInteger("ResponseCode") == 3){
+        if (dataJson.getInteger("ResponseCode") == 3) {
             throw new Exception("用户无权限");
         }
-        if (dataJson.getInteger("ResponseCode") == 4){
+        if (dataJson.getInteger("ResponseCode") == 4) {
             throw new Exception("设备不支持");
         }
-        if (dataJson.getInteger("ResponseCode") == 5){
+        if (dataJson.getInteger("ResponseCode") == 5) {
             throw new Exception("用户状态异常");
         }
-        if (dataJson.getInteger("StatusCode") == 1){
+        if (dataJson.getInteger("StatusCode") == 1) {
             throw new Exception("执行失败");
         }
-        if (dataJson.getInteger("StatusCode") == 2){
+        if (dataJson.getInteger("StatusCode") == 2) {
             throw new Exception("输入参数非法");
         }
-        if (dataJson.getInteger("StatusCode") == 3){
+        if (dataJson.getInteger("StatusCode") == 3) {
             throw new Exception("系统内存不足");
         }
-        if (dataJson.getInteger("StatusCode") == 8){
+        if (dataJson.getInteger("StatusCode") == 8) {
             throw new Exception("功能不支持");
         }
-        if (dataJson.getInteger("StatusCode") == 10){
+        if (dataJson.getInteger("StatusCode") == 10) {
             throw new Exception("序列化执行失败");
         }
-        if (dataJson.getInteger("StatusCode") == 11){
+        if (dataJson.getInteger("StatusCode") == 11) {
             throw new Exception("Basic 鉴权失败");
         }
-        if (dataJson.getInteger("StatusCode") == 12){
+        if (dataJson.getInteger("StatusCode") == 12) {
             throw new Exception("Digest 鉴权失败");
         }
-        if (dataJson.getInteger("StatusCode") == 13){
+        if (dataJson.getInteger("StatusCode") == 13) {
             throw new Exception("订阅已满");
         }
-        if (dataJson.getInteger("StatusCode") == 14){
+        if (dataJson.getInteger("StatusCode") == 14) {
             throw new Exception("重复订阅");
         }
 
         return dataJson.getJSONObject("Data");
     }
 
-    public  String getMatchMsg(Integer matchStatus,Integer maskFlag,BigDecimal temperature,TemperatureConfig temperatureConfig){
+    public String getMatchMsg(Integer matchStatus, Integer maskFlag, BigDecimal temperature, TemperatureConfig temperatureConfig) {
         String matchMsg = "";
-        if (matchStatus ==1){
+        if (matchStatus == 1) {
             matchMsg = "核验成功";
-        }
-        else if (matchStatus == 2){
+        } else if (matchStatus == 2) {
             matchMsg = "对比失败";
-        }
-        else if (matchStatus == 3){
+        } else if (matchStatus == 3) {
             matchMsg = "对比成功,不在布控时间";
-        }
-        else if (matchStatus == 7){
+        } else if (matchStatus == 7) {
             matchMsg = "刷脸开门模式下,刷脸成功";
-        }
-
-        else if (matchStatus == 10){
-            if (temperature.compareTo(new BigDecimal(temperatureConfig.getMax())) ==1){
+        } else if (matchStatus == 10) {
+            if (temperature.compareTo(new BigDecimal(temperatureConfig.getMax())) == 1) {
                 matchMsg = "对比成功,体温异常";
-            }else if (maskFlag == 1){
+            } else if (maskFlag == 1) {
                 matchMsg = "对比成功,未戴口罩";
-            }else {
+            } else {
                 matchMsg = "对比成功,人脸属性异常";
             }
 
-        }
-        else {
+        } else {
             matchMsg = "未知匹配消息";
         }
 
         return matchMsg;
     }
 
-    public static Integer imageSize(String imageBase64Str){
+    public static Integer imageSize(String imageBase64Str) {
 
         //1.找到等号,把等号也去掉(=用来填充base64字符串长度用)
-        Integer equalIndex= imageBase64Str.indexOf("=");
-        if(imageBase64Str.indexOf("=")>0) {
-            imageBase64Str=imageBase64Str.substring(0, equalIndex);
+        Integer equalIndex = imageBase64Str.indexOf("=");
+        if (imageBase64Str.indexOf("=") > 0) {
+            imageBase64Str = imageBase64Str.substring(0, equalIndex);
         }
         //2.原来的字符流大小,单位为字节
-        Integer strLength=imageBase64Str.length();
-     //   System.out.println("imageBase64Str Length = "+strLength);
+        Integer strLength = imageBase64Str.length();
+        //   System.out.println("imageBase64Str Length = "+strLength);
         //3.计算后得到的文件流大小,单位为字节
-        Integer size=strLength-(strLength/8)*2;
+        Integer size = strLength - (strLength / 8) * 2;
         return size;
     }
 
-    public static Integer getPersonCode(cn.hutool.json.JSONObject libMatInfoListJson, cn.hutool.json.JSONObject matchPersonInfo){
-        if (org.apache.commons.lang.StringUtils.isNotBlank(libMatInfoListJson.getStr("MatchPersonID"))){
-            if (!libMatInfoListJson.getStr("MatchPersonID").equals("0") && org.apache.commons.lang3.StringUtils.isNotBlank(matchPersonInfo.getStr("PersonCode"))){
-                return matchPersonInfo.getInt("PersonCode");
-
-            }else if (!libMatInfoListJson.getStr("MatchPersonID").equals("0") && org.apache.commons.lang3.StringUtils.isBlank(matchPersonInfo.getStr("PersonCode")) && StringUtils.isNotBlank(matchPersonInfo.getStr("PersonName"))){
-                String personName = matchPersonInfo.getStr("PersonName");
-                if (personName.contains("_")){
-                    log.warn(personName+"校验成功但未找到personCode");
-                    Integer personId =Integer.valueOf(personName.substring(personName.indexOf("_")+1)) ;
-                    return personId;
-                }else {
-                    log.warn(personName+"校验成功但姓名中无personCode后缀");
-                    return 0;
-                }
+    public static PersonInfo getPersonCode(cn.hutool.json.JSONObject libMatInfoListJson, cn.hutool.json.JSONObject matchPersonInfo) {
+        PersonInfo personInfo = new PersonInfo();
+        String personName = "";
+        Long personId = 0L;
+        String identityNo = "";
+        if (org.apache.commons.lang.StringUtils.isNotBlank(libMatInfoListJson.getStr("MatchPersonID"))) {
+            personName = matchPersonInfo.getStr("PersonName");
+            personId = libMatInfoListJson.getLong("MatchPersonID");
+            identityNo = matchPersonInfo.getStr("IdentityNo");
+            if (personName.contains("_")) {
+                personId = Long.valueOf(personName.substring(personName.indexOf("_") + 1));
+                personName = personName.substring(0, personName.indexOf("_"));
 
 
             }
 
-            else {
-                return 0;
-            }
-        }else {
-            return 0;
+
         }
 
 
+        personInfo.setId(personId);
+        personInfo.setName(personName);
+        personInfo.setIdCard(identityNo);
+        return personInfo;
+
+
     }
 
-    public static boolean compareToInterval(BigDecimal bigDecimal, float min,float max){
-        if (bigDecimal.compareTo(new BigDecimal(min))==-1 || bigDecimal.compareTo(new BigDecimal(max)) ==1){
+    public static boolean compareToInterval(BigDecimal bigDecimal, float min, float max) {
+        if (bigDecimal.compareTo(new BigDecimal(min)) == -1 || bigDecimal.compareTo(new BigDecimal(max)) == 1) {
             return false;
-        }
-        else {
+        } else {
             return true;
         }
 
     }
 
 
-
     public static void main(String[] args) {
-     //   Date date = new Date(1584405803000L);
-    //    Date date = new
-     //   Date date = new Date();
-      // long time = date.getTime();
-     //   System.out.println(date);
-      //  192.168.11.13:80/V1.0/PeopleLibraries/1584409665/People/1111?LastChange=1584428390872
+        //   Date date = new Date(1584405803000L);
+        //    Date date = new
+        //   Date date = new Date();
+        // long time = date.getTime();
+        //   System.out.println(date);
+        //  192.168.11.13:80/V1.0/PeopleLibraries/1584409665/People/1111?LastChange=1584428390872
 //        cn.hutool.json.JSONObject jsonObject = new cn.hutool.json.JSONObject();
 //        Integer integer = getPersonCode(jsonObject,jsonObject);
 //        System.out.println(integer);
-        Map<String,Object> map = new HashMap<>();
+        Map<String, Object> map = new HashMap<>();
 
 //        String requestStr = HttpRequest.post("http://www.baidu.com")
 //                .timeout(TIMEOUT)

+ 7 - 1
common/src/main/resources/mapper/base/PersonDeviceLog.xml

@@ -6,7 +6,9 @@
     <sql id="Base_Column_List">
 	device_no,
 	person_id,
+	person_name,
 	id_,
+	identity_no,
 	create_by,
 	create_time,
 	update_by,
@@ -35,7 +37,9 @@
         <result property="delFlag" column="del_flag" />
         <result property="deviceNo" column="device_no" />
         <result property="personId" column="person_id" />
+        <result property="personName" column="person_name"/>
         <result property="temperature" column="temperature_" />
+        <result property="identityNo" column="identity_no"/>
         <result property="matchStatus" column="match_status" />
         <result property="matchMsg" column="match_msg" />
         <result property="matchFaceId" column="match_face_id" />
@@ -56,7 +60,7 @@
         -->
         <![CDATA[
 		insert into base_person_device_log
-	    (id_,create_by,create_time,update_by,update_time,is_effective,del_flag,device_no,person_id,temperature_,match_status,match_msg,match_face_id,face_image,record_time)
+	    (id_,create_by,create_time,update_by,update_time,is_effective,del_flag,device_no,person_id,person_name,temperature_,identity_no,match_status,match_msg,match_face_id,face_image,record_time)
 		values
 		(
         #{id,jdbcType=VARCHAR}
@@ -68,7 +72,9 @@
         ,#{delFlag,jdbcType= NUMERIC }
         ,#{deviceNo,jdbcType=VARCHAR}
         ,#{personId,jdbcType=VARCHAR}
+        ,#{personName,jdbcType=VARCHAR}
         ,#{temperature,jdbcType=NUMERIC}
+        ,#{identityNo,jdbcType=VARCHAR}
         ,#{matchStatus,jdbcType=INTEGER}
         ,#{matchMsg,jdbcType=VARCHAR}
         ,#{matchFaceId,jdbcType= INTEGER}

+ 10 - 0
common/src/main/resources/mapper/base/PersonInfo.xml

@@ -359,4 +359,14 @@
             #{item}
         </foreach>
     </select>
+
+    <select id="findByIdCardAndCompanyId" resultMap="PersonInfoMap">
+        <![CDATA[
+         select * from base_person_info where del_flag = 0
+            and id_card = #{idCard}
+            and company_id = #{companyId}
+                ]]>
+
+
+</select>
 </mapper>

+ 5 - 3
lapi/src/main/java/com/jpsoft/smart/lapi/handler/PersonVerificationHandler.java

@@ -2,6 +2,7 @@ package com.jpsoft.smart.lapi.handler;
 
 import cn.hutool.json.JSONObject;
 import com.jpsoft.smart.lapi.dto.PersonVerification;
+import com.jpsoft.smart.modules.base.entity.PersonInfo;
 import com.jpsoft.smart.modules.base.service.PersonDeviceFilterLogService;
 import com.jpsoft.smart.modules.base.service.PersonDeviceLogService;
 import com.jpsoft.smart.modules.business.service.WorkAttendanceService;
@@ -115,12 +116,13 @@ public class PersonVerificationHandler extends SimpleChannelInboundHandler<Perso
 
         //记录考勤信息
         try {
-            final Integer personId = LApiUtil.getPersonCode(libMatInfoListJson, matchPersonInfo);
+          //  final Integer personId = LApiUtil.getPersonCode(libMatInfoListJson, matchPersonInfo);
+            final PersonInfo personInfo = LApiUtil.getPersonCode(libMatInfoListJson, matchPersonInfo);
             final BigDecimal fTemperature = temperature;
             final Date recordDate = date;
 
-            if(personId!=null && personId!=0) {
-                new Thread(() -> workAttendanceService.punchIn(personId.longValue(), fTemperature, recordDate)).start();
+            if(personInfo.getId()!=null && personInfo.getId()!=0L) {
+                new Thread(() -> workAttendanceService.punchIn(personInfo.getId(), fTemperature, recordDate)).start();
             }
         }
         catch (Exception ex){