|
@@ -1,6 +1,9 @@
|
|
|
package com.ruoyi.web.controller.camera;
|
|
|
|
|
|
+import com.alibaba.fastjson2.JSON;
|
|
|
+import com.alibaba.fastjson2.JSONException;
|
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
|
+import com.ruoyi.Common.ConfigFileUtil;
|
|
|
import com.ruoyi.alarm.Alarm;
|
|
|
import com.ruoyi.common.annotation.Log;
|
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
@@ -9,9 +12,11 @@ import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
import com.ruoyi.common.core.redis.RedisCache;
|
|
|
import com.ruoyi.common.enums.BusinessType;
|
|
|
import com.ruoyi.common.exception.ServiceException;
|
|
|
+import com.ruoyi.common.utils.DateUtils;
|
|
|
import com.ruoyi.common.utils.StringUtils;
|
|
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
|
import com.ruoyi.hksdk.HCNetSDK;
|
|
|
+import com.ruoyi.system.domain.BomanReservat;
|
|
|
import com.ruoyi.system.domain.EquipmentConfiguration;
|
|
|
import com.ruoyi.system.domain.OpeningDoorRecord;
|
|
|
import com.ruoyi.system.domain.PersonnelManagement;
|
|
@@ -21,13 +26,21 @@ import com.ruoyi.system.service.IEquipmentConfigurationService;
|
|
|
import com.ruoyi.system.service.IOpeningDoorRecordService;
|
|
|
import com.ruoyi.system.service.IPersonnelManagementService;
|
|
|
import com.sun.jna.Pointer;
|
|
|
+import com.sun.jna.ptr.IntByReference;
|
|
|
import org.apache.commons.lang3.ObjectUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.context.annotation.Configuration;
|
|
|
+import org.springframework.scheduling.annotation.Async;
|
|
|
+import org.springframework.scheduling.annotation.EnableScheduling;
|
|
|
+import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
+import java.io.UnsupportedEncodingException;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
import static com.ruoyi.common.constant.CommonConstants.LOGIN_USER_SMS;
|
|
|
import static com.ruoyi.common.constant.CommonConstants.OPEN_DOOR;
|
|
@@ -38,6 +51,8 @@ import static com.ruoyi.common.constant.CommonConstants.OPEN_DOOR;
|
|
|
* @author ruoyi
|
|
|
* @date 2024-02-28
|
|
|
*/
|
|
|
+@Configuration
|
|
|
+@EnableScheduling
|
|
|
@RestController
|
|
|
@RequestMapping("/camera")
|
|
|
public class CameraController extends BaseController {
|
|
@@ -51,6 +66,18 @@ public class CameraController extends BaseController {
|
|
|
@Autowired
|
|
|
private RedisCache redisCache;
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 在考勤机器获取考勤数据 一小时一次
|
|
|
+ */
|
|
|
+ @Async
|
|
|
+ @Scheduled(cron = "0 0 * * * ? ")
|
|
|
+ public void configureTasks() {
|
|
|
+ System.out.println(DateUtils.getNowDate() +"开始执行定时任务");
|
|
|
+ cameraService.configureTasks();
|
|
|
+ System.out.println(DateUtils.getNowDate() +"定时任务结束");
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 查询安防设备列表
|
|
|
*/
|
|
@@ -248,4 +275,325 @@ public class CameraController extends BaseController {
|
|
|
return AjaxResult.success(ret);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 下发人员信息
|
|
|
+ * @param equipmentConfiguration 下发的设备信息
|
|
|
+ * @param bomanReservat 下发的人员信息
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public void issueUser(EquipmentConfiguration equipmentConfiguration, BomanReservat bomanReservat) {
|
|
|
+ String employeeNo = "tem"+bomanReservat.getReservatId();
|
|
|
+ //验证码校验
|
|
|
+ Object cacheObject = redisCache.getCacheObject(OPEN_DOOR + equipmentConfiguration.getPhoneNumber());
|
|
|
+ if(ObjectUtils.isEmpty(cacheObject) || !equipmentConfiguration.getCode().equals(cacheObject)){
|
|
|
+ throw new ServiceException("验证码错误");
|
|
|
+ }
|
|
|
+ redisCache.deleteObject(LOGIN_USER_SMS + equipmentConfiguration.getPhoneNumber());
|
|
|
+ equipmentConfiguration = equipmentConfigurationService.selectEquipmentConfigurationByEquipmentName(equipmentConfiguration.getEquipmentName());
|
|
|
+ if(StringUtils.isEmpty(equipmentConfiguration.getEquipmentName())){
|
|
|
+ //return AjaxResult.error("设备列表暂无当前设备");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ String ip = equipmentConfiguration.getEquipmentIp();
|
|
|
+ short prot = (short) Short.parseShort(equipmentConfiguration.getEquipmentPort());
|
|
|
+ String login = equipmentConfiguration.getLoginName();
|
|
|
+ String pwd = equipmentConfiguration.getLoginPwd();
|
|
|
+
|
|
|
+ int lUserID = Alarm.login_V40( ip, prot, login, pwd); //登录设备
|
|
|
+ //Alarm.setAlarm();
|
|
|
+ //String ret="起竿失败!";
|
|
|
+ try {
|
|
|
+ HCNetSDK.BYTE_ARRAY ptrByteArray = new HCNetSDK.BYTE_ARRAY(1024); //数组
|
|
|
+ String strInBuffer = "POST /ISAPI/AccessControl/UserInfo/Record?format=json"; //此URL也是下发人员
|
|
|
+// String strInBuffer = "PUT /ISAPI/AccessControl/UserInfo/SetUp?format=json";
|
|
|
+ System.arraycopy(strInBuffer.getBytes(), 0, ptrByteArray.byValue, 0, strInBuffer.length());//字符串拷贝到数组中
|
|
|
+ ptrByteArray.write();
|
|
|
+ //长连接
|
|
|
+ int lHandler = Alarm.startRemote(lUserID,HCNetSDK.NET_DVR_JSON_CONFIG, ptrByteArray.getPointer(), strInBuffer.length());
|
|
|
+ //int lHandler = Alarm.hCNetSDK.NET_DVR_StartRemoteConfig(lUserID, HCNetSDK.NET_DVR_JSON_CONFIG, ptrByteArray.getPointer(), strInBuffer.length(), null, null);
|
|
|
+ if (lHandler < 0) {
|
|
|
+ System.out.println("AddUserInfo NET_DVR_StartRemoteConfig 失败,错误码为" + Alarm.controlsDzError());
|
|
|
+ return;
|
|
|
+ } else {
|
|
|
+ System.out.println("AddUserInfo NET_DVR_StartRemoteConfig 成功!");
|
|
|
+
|
|
|
+ //输入参数,XML或者JSON数据,下发人员信息json报文,其他参数设置参考conf/acs/AddUserInfoParam.json中报文参数
|
|
|
+ Map<String, Object> parameter = new HashMap<>();
|
|
|
+ parameter.put("employeeNo", employeeNo); // 员工ID
|
|
|
+ parameter.put("name", bomanReservat.getVisitName()); // 员工名称
|
|
|
+ parameter.put("enable", true); // 是否启用
|
|
|
+ parameter.put("doorNo", 1); // 门编号
|
|
|
+ String input = ConfigFileUtil.getReqBodyFromTemplate("conf/acs/AddUserInfoParam.json", parameter);
|
|
|
+ System.out.println("下发人员参数:"+input);
|
|
|
+
|
|
|
+ byte[] byInbuffer = input.getBytes("utf-8");
|
|
|
+ int iInBufLen = byInbuffer.length;
|
|
|
+
|
|
|
+ HCNetSDK.BYTE_ARRAY ptrInBuffer = new HCNetSDK.BYTE_ARRAY(iInBufLen);
|
|
|
+ ptrInBuffer.read();
|
|
|
+ System.arraycopy(byInbuffer,0,ptrInBuffer.byValue,0, iInBufLen);
|
|
|
+ ptrInBuffer.write();
|
|
|
+ //下发人员信息
|
|
|
+ HCNetSDK.BYTE_ARRAY ptrOutuff = new HCNetSDK.BYTE_ARRAY(1024);
|
|
|
+// Pointer ptr =new PointerByReference()
|
|
|
+ IntByReference pInt = new IntByReference(0);
|
|
|
+ while (true) {
|
|
|
+ int dwState = Alarm.sendWith(lHandler, ptrInBuffer.getPointer(), iInBufLen, ptrOutuff.getPointer(), 1024, pInt);
|
|
|
+ if (dwState == -1) {
|
|
|
+ System.out.println("NET_DVR_SendWithRecvRemoteConfig接口调用失败,错误码:" + Alarm.controlsDzError());
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ //读取返回的json并解析
|
|
|
+ ptrOutuff.read();
|
|
|
+ String strResult = new String(ptrOutuff.byValue).trim();
|
|
|
+ System.out.println("dwState:" + dwState + ",strResult:" + strResult);
|
|
|
+ JSONObject jsonResult = JSON.parseObject(strResult);
|
|
|
+ int statusCode = (int) jsonResult.get("statusCode");
|
|
|
+ String statusString = jsonResult.getString("statusString");
|
|
|
+ if (dwState == HCNetSDK.NET_SDK_CONFIG_STATUS_NEED_WAIT) {
|
|
|
+ System.out.println("配置等待");
|
|
|
+ Thread.sleep(10);
|
|
|
+ continue;
|
|
|
+ } else if (dwState == HCNetSDK.NET_SDK_CONFIG_STATUS_FAILED) {
|
|
|
+ System.out.println("下发人员失败, json retun:" + jsonResult.toString());
|
|
|
+ break;
|
|
|
+ } else if (dwState == HCNetSDK.NET_SDK_CONFIG_STATUS_EXCEPTION) {
|
|
|
+ System.out.println("下发人员异常, json retun:" + jsonResult.toString());
|
|
|
+ break;
|
|
|
+ } else if (dwState == HCNetSDK.NET_SDK_CONFIG_STATUS_SUCCESS) {//返回NET_SDK_CONFIG_STATUS_SUCCESS代表流程走通了,但并不代表下发成功,比如有些设备可能因为人员已存在等原因下发失败,所以需要解析Json报文
|
|
|
+ if (statusCode != 1) {
|
|
|
+ System.out.println("下发人员成功,但是有异常情况:" + jsonResult.toString());
|
|
|
+ } else {
|
|
|
+ System.out.println("下发人员成功: json retun:" + jsonResult.toString());
|
|
|
+ }
|
|
|
+ //按URL方式下发人脸图片
|
|
|
+ addFaceByUrl(lUserID,employeeNo,bomanReservat.getHumanFaceData());
|
|
|
+ break;
|
|
|
+ } else if (dwState == HCNetSDK.NET_SDK_CONFIG_STATUS_FINISH) {
|
|
|
+ //下发人员时:dwState其实不会走到这里,因为设备不知道我们会下发多少个人,所以长连接需要我们主动关闭
|
|
|
+ System.out.println("下发人员完成");
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!Alarm.stopRemote(lHandler)) {
|
|
|
+ System.out.println("NET_DVR_StopRemoteConfig接口调用失败,错误码:" + Alarm.controlsDzError());
|
|
|
+ } else {
|
|
|
+ System.out.println("NET_DVR_StopRemoteConfig接口成功");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //注销用户
|
|
|
+ boolean b=Alarm.logout(lUserID);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 按URL方式下发人脸图片
|
|
|
+ * @param userID 用户注销ID
|
|
|
+ * @param employeeNo 人员工号
|
|
|
+ * @throws
|
|
|
+ */
|
|
|
+ public static void addFaceByUrl(int userID,String employeeNo,String url) throws JSONException {
|
|
|
+ HCNetSDK.BYTE_ARRAY ptrByteArray = new HCNetSDK.BYTE_ARRAY(1024); //数组
|
|
|
+ String strInBuffer = "PUT /ISAPI/Intelligent/FDLib/FDSetUp?format=json";
|
|
|
+ System.arraycopy(strInBuffer.getBytes(), 0, ptrByteArray.byValue, 0, strInBuffer.length());//字符串拷贝到数组中
|
|
|
+ ptrByteArray.write();
|
|
|
+ int lHandler = Alarm.startRemote(userID,HCNetSDK.NET_DVR_FACE_DATA_RECORD, ptrByteArray.getPointer(), strInBuffer.length());
|
|
|
+ if (lHandler < 0)
|
|
|
+ {
|
|
|
+ System.out.println("Addface NET_DVR_StartRemoteConfig 失败,错误码为"+Alarm.controlsDzError());
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ System.out.println("Addface NET_DVR_StartRemoteConfig 成功!");
|
|
|
+
|
|
|
+ HCNetSDK.NET_DVR_JSON_DATA_CFG struAddFaceDataCfg = new HCNetSDK.NET_DVR_JSON_DATA_CFG();
|
|
|
+ struAddFaceDataCfg.read();
|
|
|
+
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
+ //jsonObject.put("faceURL","http://10.17.34.106:6011/pic?7DD9D70207A9D7F576F99AC197B2D6CAface.jpg"); //人脸图片URL,平台自己实现,需要保证设备可以正常访问
|
|
|
+ jsonObject.put("faceURL",url); //人脸图片URL,平台自己实现,需要保证设备可以正常访问
|
|
|
+ jsonObject.put("faceLibType", "blackFD");
|
|
|
+ jsonObject.put("FDID", "fce"+employeeNo);
|
|
|
+ jsonObject.put("FPID", employeeNo);//人脸下发关联的工号
|
|
|
+
|
|
|
+ String strJsonData = jsonObject.toString();
|
|
|
+ System.arraycopy(strJsonData.getBytes(), 0, ptrByteArray.byValue, 0, strJsonData.length());//字符串拷贝到数组中
|
|
|
+ ptrByteArray.write();
|
|
|
+ struAddFaceDataCfg.dwSize = struAddFaceDataCfg.size();
|
|
|
+ struAddFaceDataCfg.lpJsonData = ptrByteArray.getPointer();
|
|
|
+ struAddFaceDataCfg.dwJsonDataSize = strJsonData.length();
|
|
|
+ struAddFaceDataCfg.lpPicData = null;
|
|
|
+ struAddFaceDataCfg.dwPicDataSize=0;
|
|
|
+ struAddFaceDataCfg.write();
|
|
|
+ HCNetSDK.BYTE_ARRAY ptrOutuff = new HCNetSDK.BYTE_ARRAY(1024);
|
|
|
+
|
|
|
+ IntByReference pInt = new IntByReference(0);
|
|
|
+
|
|
|
+ while(true){
|
|
|
+ int dwState = Alarm.sendWith(lHandler, struAddFaceDataCfg.getPointer(), struAddFaceDataCfg.dwSize ,ptrOutuff.getPointer(), 1024, pInt);
|
|
|
+
|
|
|
+ if(dwState == -1){
|
|
|
+ System.out.println("NET_DVR_SendWithRecvRemoteConfig接口调用失败,错误码:" + Alarm.controlsDzError());
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ //读取返回的json并解析
|
|
|
+ ptrOutuff.read();
|
|
|
+ String strResult = new String(ptrOutuff.byValue).trim();
|
|
|
+ System.out.println("dwState:" + dwState + ",strResult:" + strResult);
|
|
|
+
|
|
|
+ JSONObject jsonResult = JSON.parseObject(strResult);
|
|
|
+ int statusCode = (int) jsonResult.get("statusCode");
|
|
|
+ String statusString = jsonResult.getString("statusString");
|
|
|
+ if(dwState == HCNetSDK.NET_SDK_CONFIG_STATUS_NEED_WAIT)
|
|
|
+ {
|
|
|
+ System.out.println("配置等待");
|
|
|
+ try {
|
|
|
+ Thread.sleep(10);
|
|
|
+ } catch (InterruptedException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ else if(dwState == HCNetSDK.NET_SDK_CONFIG_STATUS_FAILED)
|
|
|
+ {
|
|
|
+ System.out.println("下发人脸失败, json retun:" + jsonResult.toString());
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ else if(dwState == HCNetSDK.NET_SDK_CONFIG_STATUS_EXCEPTION)
|
|
|
+ {
|
|
|
+ System.out.println("下发人脸异常, json retun:" + jsonResult.toString());
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ else if(dwState == HCNetSDK.NET_SDK_CONFIG_STATUS_SUCCESS)
|
|
|
+ {//返回NET_SDK_CONFIG_STATUS_SUCCESS代表流程走通了,但并不代表下发成功,比如人脸图片不符合设备规范等原因,所以需要解析Json报文
|
|
|
+ if (statusCode != 1){
|
|
|
+ System.out.println("下发人脸成功,但是有异常情况:" + jsonResult.toString());
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ System.out.println("下发人脸成功, json retun:" + jsonResult.toString());
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ else if(dwState == HCNetSDK.NET_SDK_CONFIG_STATUS_FINISH) {
|
|
|
+ //下发人脸时:dwState其实不会走到这里,因为设备不知道我们会下发多少个人,所以长连接需要我们主动关闭
|
|
|
+ System.out.println("下发人脸完成");
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(!Alarm.stopRemote(lHandler)){
|
|
|
+ System.out.println("NET_DVR_StopRemoteConfig接口调用失败,错误码:" + Alarm.controlsDzError());
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ System.out.println("NET_DVR_StopRemoteConfig接口成功");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 门禁事件查询,基于起止时间,事件类型进行查询
|
|
|
+ * @param
|
|
|
+ * @throws UnsupportedEncodingException
|
|
|
+ * @throws InterruptedException
|
|
|
+ */
|
|
|
+ @GetMapping("/yzm/cs")
|
|
|
+ public void searchAllEvent() throws UnsupportedEncodingException, InterruptedException {
|
|
|
+
|
|
|
+
|
|
|
+ int lUserID = Alarm.login_V40( "60.171.161.56", (short) 18107, "admin", "zxy@7000"); //登录设备
|
|
|
+
|
|
|
+ int i = 0; //事件条数
|
|
|
+ HCNetSDK.NET_DVR_ACS_EVENT_COND struAcsEventCond = new HCNetSDK.NET_DVR_ACS_EVENT_COND();
|
|
|
+ struAcsEventCond.read();
|
|
|
+ struAcsEventCond.dwSize = struAcsEventCond.size();
|
|
|
+ //查询全部主次类型的报警
|
|
|
+ struAcsEventCond.dwMajor = 5; // 主次事件类型设为0,代表查询所有事件
|
|
|
+ struAcsEventCond.dwMinor = 15; //
|
|
|
+ //开始时间
|
|
|
+ struAcsEventCond.struStartTime.dwYear = 2025;
|
|
|
+ struAcsEventCond.struStartTime.dwMonth = 3;
|
|
|
+ struAcsEventCond.struStartTime.dwDay = 01;
|
|
|
+ struAcsEventCond.struStartTime.dwHour = 0;
|
|
|
+ struAcsEventCond.struStartTime.dwMinute = 0;
|
|
|
+ struAcsEventCond.struStartTime.dwSecond = 0;
|
|
|
+ //结束时间
|
|
|
+ struAcsEventCond.struEndTime.dwYear = 2025;
|
|
|
+ struAcsEventCond.struEndTime.dwMonth = 4;
|
|
|
+ struAcsEventCond.struEndTime.dwDay = 9;
|
|
|
+ struAcsEventCond.struEndTime.dwHour = 23;
|
|
|
+ struAcsEventCond.struEndTime.dwMinute = 59;
|
|
|
+ struAcsEventCond.struEndTime.dwSecond = 59;
|
|
|
+ struAcsEventCond.wInductiveEventType = 1;
|
|
|
+ struAcsEventCond.byPicEnable = 0; //是否带图片,0-不带图片,1-带图片
|
|
|
+ struAcsEventCond.write();
|
|
|
+ Pointer ptrStruEventCond = struAcsEventCond.getPointer();
|
|
|
+ int m_lSearchEventHandle = Alarm.startRemote(lUserID,HCNetSDK.NET_DVR_GET_ACS_EVENT, ptrStruEventCond, struAcsEventCond.size());
|
|
|
+ //int m_lSearchEventHandle = AcsMain.hCNetSDK.NET_DVR_StartRemoteConfig(lUserID, HCNetSDK.NET_DVR_GET_ACS_EVENT, ptrStruEventCond, struAcsEventCond.size(), null, null);
|
|
|
+ if (m_lSearchEventHandle<=-1)
|
|
|
+ {
|
|
|
+ System.out.println("NET_DVR_StartRemoteConfig调用失败,错误码:" + Alarm.controlsDzError());
|
|
|
+ }
|
|
|
+ HCNetSDK.NET_DVR_ACS_EVENT_CFG struAcsEventCfg = new HCNetSDK.NET_DVR_ACS_EVENT_CFG();
|
|
|
+ struAcsEventCfg.read();
|
|
|
+ struAcsEventCfg.dwSize = struAcsEventCfg.size();
|
|
|
+ struAcsEventCfg.write();
|
|
|
+ Pointer ptrStruEventCfg = struAcsEventCfg.getPointer();
|
|
|
+ while (true) {
|
|
|
+ System.out.println("i=" + i);
|
|
|
+ int dwEventSearch = Alarm.nextRemote(m_lSearchEventHandle, ptrStruEventCfg, struAcsEventCfg.size());
|
|
|
+ if (dwEventSearch <= -1) {
|
|
|
+ System.out.println("NET_DVR_GetNextRemoteConfig接口调用失败,错误码:" + Alarm.controlsDzError());
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (dwEventSearch == HCNetSDK.NET_SDK_GET_NEXT_STATUS_NEED_WAIT) {
|
|
|
+ System.out.println("配置等待....");
|
|
|
+ Thread.sleep(10);
|
|
|
+ continue;
|
|
|
+ } else if (dwEventSearch == HCNetSDK.NET_SDK_NEXT_STATUS__FINISH) {
|
|
|
+ System.out.println("获取事件完成");
|
|
|
+ break;
|
|
|
+ } else if (dwEventSearch == HCNetSDK.NET_SDK_GET_NEXT_STATUS_FAILED) {
|
|
|
+ System.out.println("获取事件出现异常");
|
|
|
+ break;
|
|
|
+ } else if (dwEventSearch == HCNetSDK.NET_SDK_GET_NEXT_STATUS_SUCCESS) {
|
|
|
+ struAcsEventCfg.read();
|
|
|
+ //获取的事件信息通过struAcsEventCfg结构体进行解析,
|
|
|
+ System.out.println(i + "获取事件成功, 报警主类型:" + Integer.toHexString(struAcsEventCfg.dwMajor) + "报警次类型:" + Integer.toHexString(struAcsEventCfg.dwMinor) + "卡号:" + new String(struAcsEventCfg.struAcsEventInfo.byCardNo).trim());
|
|
|
+ /**
|
|
|
+ * 工号有两个字段,dwEmployeeNo表示工号,当值为0时,表示无效,解析byEmployeeNo参数
|
|
|
+ */
|
|
|
+/* System.out.println("工号1:"+struAcsEventCfg.struAcsEventInfo.dwEmployeeNo);
|
|
|
+ System.out.println("工号2:"+new String(struAcsEventCfg.struAcsEventInfo.byEmployeeNo));
|
|
|
+ //人脸温度数据,需要设备和支持测温功能
|
|
|
+ System.out.println("人脸温度:" + struAcsEventCfg.struAcsEventInfo.fCurrTemperature + "是否异常:" + struAcsEventCfg.struAcsEventInfo.byIsAbnomalTemperature);
|
|
|
+ //口罩功能,需要设备支持此功能 0-保留,1-未知,2-不戴口罩,3-戴口罩
|
|
|
+ System.out.println("是否带口罩:"+struAcsEventCfg.struAcsEventInfo.byMask);*/
|
|
|
+ System.out.println("刷卡时间:年:"+struAcsEventCfg.struTime.dwYear+" 月:"+struAcsEventCfg.struTime.dwMonth+" 日:"+struAcsEventCfg.struTime.dwDay+
|
|
|
+ " 时:"+struAcsEventCfg.struTime.dwHour+" 分:"+struAcsEventCfg.struTime.dwMinute+" 秒:"+struAcsEventCfg.struTime.dwSecond);
|
|
|
+ System.out.println("刷卡信息:"+new String(struAcsEventCfg.struAcsEventInfo.byCardNo));
|
|
|
+
|
|
|
+ //todo 人脸图片保存
|
|
|
+
|
|
|
+ i++;
|
|
|
+ continue;
|
|
|
+ }else{
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ i = 0;
|
|
|
+ if (!Alarm.stopRemote(m_lSearchEventHandle)) {
|
|
|
+ System.out.println("NET_DVR_StopRemoteConfig接口调用失败,错误码:" + Alarm.controlsDzError());
|
|
|
+ } else {
|
|
|
+ System.out.println("NET_DVR_StopRemoteConfig接口成功");
|
|
|
+ }
|
|
|
+ //注销用户
|
|
|
+ boolean b=Alarm.logout(lUserID);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
}
|