|
|
|
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.common.CommonUtil; |
|
|
|
import com.sun.jna.Pointer; |
|
|
|
import com.yzx.callback.AlarmCallback; |
|
|
|
import com.yzx.pojo.AlarmDataInfo; |
|
|
|
|
|
|
|
import java.io.FileNotFoundException; |
|
|
|
import java.io.FileOutputStream; |
|
|
|
@@ -379,7 +380,7 @@ public class AlarmDataParse { |
|
|
|
break; |
|
|
|
case HCNetSDK.COMM_ALARM_ACS: //门禁主机报警信息 |
|
|
|
//组装数据 |
|
|
|
JSONObject json = new JSONObject(); |
|
|
|
AlarmDataInfo info = new AlarmDataInfo(); |
|
|
|
HCNetSDK.NET_DVR_ACS_ALARM_INFO strACSInfo = new HCNetSDK.NET_DVR_ACS_ALARM_INFO(); |
|
|
|
strACSInfo.write(); |
|
|
|
Pointer pACSInfo = strACSInfo.getPointer(); |
|
|
|
@@ -389,11 +390,13 @@ public class AlarmDataParse { |
|
|
|
主类型:0X5 次类型:0x4c 表示人脸认证失败)*/ |
|
|
|
//System.out.println("【门禁主机报警信息】卡号:" + new String(strACSInfo.struAcsEventInfo.byCardNo).trim() + ",卡类型:" + strACSInfo.struAcsEventInfo.byCardType + ",报警主类型:" + Integer.toHexString(strACSInfo.dwMajor) + ",报警次类型:" + Integer.toHexString(strACSInfo.dwMinor)); |
|
|
|
//System.out.println("工号1:" + strACSInfo.struAcsEventInfo.dwEmployeeNo); |
|
|
|
json.put("dwEmployeeNo",strACSInfo.struAcsEventInfo.dwEmployeeNo); |
|
|
|
json.put("byCardNo",new String(strACSInfo.struAcsEventInfo.byCardNo).trim()); |
|
|
|
json.put("byCardType",strACSInfo.struAcsEventInfo.byCardType); |
|
|
|
json.put("dwMajor",Integer.toHexString(strACSInfo.dwMajor)); |
|
|
|
json.put("dwMinor",Integer.toHexString(strACSInfo.dwMinor)); |
|
|
|
info.setDwEmployeeNo(strACSInfo.struAcsEventInfo.dwEmployeeNo); |
|
|
|
info.setByCardNo(new String(strACSInfo.struAcsEventInfo.byCardNo).trim()); |
|
|
|
info.setByCardType(strACSInfo.struAcsEventInfo.byCardType); |
|
|
|
info.setDwMajor(Integer.toHexString(strACSInfo.dwMajor)); |
|
|
|
info.setDwMinor(Integer.toHexString(strACSInfo.dwMinor)); |
|
|
|
info.setSerialNumber(new String(pAlarmer.sSerialNumber).trim()); |
|
|
|
info.setSerialNo(strACSInfo.struAcsEventInfo.dwSerialNo); |
|
|
|
//温度信息(如果设备支持测温功能,人脸温度信息从NET_DVR_ACS_EVENT_INFO_EXTEND_V20结构体获取) |
|
|
|
if (strACSInfo.byAcsEventInfoExtendV20 == 1) { |
|
|
|
HCNetSDK.NET_DVR_ACS_EVENT_INFO_EXTEND_V20 strAcsInfoExV20 = new HCNetSDK.NET_DVR_ACS_EVENT_INFO_EXTEND_V20(); |
|
|
|
@@ -402,7 +405,7 @@ public class AlarmDataParse { |
|
|
|
pAcsInfoExV20.write(0, strACSInfo.pAcsEventInfoExtendV20.getByteArray(0, strAcsInfoExV20.size()), 0, strAcsInfoExV20.size()); |
|
|
|
strAcsInfoExV20.read(); |
|
|
|
//System.out.println("实时温度值:" + strAcsInfoExV20.fCurrTemperature); |
|
|
|
json.put("currTemperature",strAcsInfoExV20.fCurrTemperature); |
|
|
|
info.setCurrTemperature(strAcsInfoExV20.fCurrTemperature); |
|
|
|
} |
|
|
|
//考勤状态 |
|
|
|
if (strACSInfo.byAcsEventInfoExtend == 1) { |
|
|
|
@@ -413,8 +416,8 @@ public class AlarmDataParse { |
|
|
|
strAcsInfoEx.read(); |
|
|
|
//System.out.println("考勤状态:" + strAcsInfoEx.byAttendanceStatus); |
|
|
|
//System.out.println("工号2:" + new String(strAcsInfoEx.byEmployeeNo).trim()); |
|
|
|
json.put("byEmployeeNo",new String(strAcsInfoEx.byEmployeeNo).trim()); |
|
|
|
json.put("attendanceStatus",strAcsInfoEx.byAttendanceStatus); |
|
|
|
info.setByEmployeeNo(new String(strAcsInfoEx.byEmployeeNo).trim()); |
|
|
|
info.setAttendanceStatus(strAcsInfoEx.byAttendanceStatus); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
@@ -430,9 +433,9 @@ public class AlarmDataParse { |
|
|
|
byte[] bytes = new byte[strACSInfo.dwPicDataLen]; |
|
|
|
buffers.rewind(); |
|
|
|
buffers.get(bytes); |
|
|
|
json.put("pic",bytes); |
|
|
|
info.setPic(bytes); |
|
|
|
} |
|
|
|
callback.process(json); |
|
|
|
callback.process(info); |
|
|
|
break; |
|
|
|
|
|
|
|
case HCNetSDK.COMM_ID_INFO_ALARM: //身份证信息 |
|
|
|
|