|
|
|
@@ -4,10 +4,12 @@ import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.common.CommonUtil; |
|
|
|
import com.sun.jna.Pointer; |
|
|
|
import com.yzx.callback.AlarmCallback; |
|
|
|
import sun.misc.BASE64Encoder; |
|
|
|
|
|
|
|
import java.io.*; |
|
|
|
import java.nio.ByteBuffer; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.util.Base64; |
|
|
|
import java.util.Date; |
|
|
|
|
|
|
|
/** |
|
|
|
@@ -582,6 +584,11 @@ public class AlarmDataParse { |
|
|
|
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)); |
|
|
|
//温度信息(如果设备支持测温功能,人脸温度信息从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(); |
|
|
|
@@ -590,6 +597,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); |
|
|
|
} |
|
|
|
//考勤状态 |
|
|
|
if (strACSInfo.byAcsEventInfoExtend == 1) { |
|
|
|
@@ -600,6 +608,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); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
@@ -631,6 +641,7 @@ public class AlarmDataParse { |
|
|
|
buffers.get(bytes); |
|
|
|
fout.write(bytes); |
|
|
|
fout.close(); |
|
|
|
json.put("pic_bytes",bytes); |
|
|
|
} catch (FileNotFoundException e) { |
|
|
|
// TODO Auto-generated catch block |
|
|
|
e.printStackTrace(); |
|
|
|
@@ -639,6 +650,7 @@ public class AlarmDataParse { |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
} |
|
|
|
callback.process(json); |
|
|
|
break; |
|
|
|
|
|
|
|
case HCNetSDK.COMM_ID_INFO_ALARM: //身份证信息 |
|
|
|
|