当前位置: 首页 > news >正文

河南it渠道网应用商店关键词优化

河南it渠道网,应用商店关键词优化,宝鸡网站建设宝鸡,软件开发难度大吗对接海康明眸门禁设备-删除人员信息 文中登录 退出登录 长连接和海康hCNetSDK等接口 见文章 初始SDK和登录 /*** 删除人脸 IotCommDataResult 自定义类 收集结果*/Overridepublic List<IotCommDataResult> deleteFace(IotCameraParam camera, Collection<Long> us…

对接海康明眸门禁设备-删除人员信息

文中登录 退出登录 长连接和海康hCNetSDK等接口 见文章 初始SDK和登录

 /*** 删除人脸
IotCommDataResult 自定义类 收集结果*/@Overridepublic List<IotCommDataResult> deleteFace(IotCameraParam camera, Collection<Long> userIds) {//登录设备int lUserID = login_V40(camera.getIp(), new Short(String.valueOf(camera.getPort())), camera.getUsername(), camera.getPassword());if (lUserID == -1) {log.warn("登录失败,错误码为 :{}", hCNetSDK.NET_DVR_GetLastError());return userIds.stream().map(id -> IotCommDataResult.FAIL_RESULT(id)).collect(Collectors.toList());}if (CollUtil.isEmpty(userIds)) {return Collections.emptyList();}List<Long> userIdList = new ArrayList<>(userIds);List<IotCommDataResult> commDataResults = new ArrayList<>();String deleteUserUrl = "PUT /ISAPI/AccessControl/UserInfoDetail/Delete?format=json";String getDeleteProcessUrl = "GET /ISAPI/AccessControl/UserInfoDetail/DeleteProcess?format=json";// 删除可以通过组装数据 进行批量删除。我这边采用的是循环删除for (int i = 0; i < userIdList.size(); i++) {//删除用户信息Boolean aBoolean = this.delUserFace(userIdList.get(i), deleteUserUrl, lUserID);if (!aBoolean) {commDataResults.add(IotCommDataResult.FAIL_RESULT(userIdList.get(i)));continue;}try {Thread.sleep(100);} catch (InterruptedException e) {log.warn("配置等待异常 userid: {}", userIdList.get(i));}String deleteResult = this.delUserFaceRespon(getDeleteProcessUrl, lUserID);if (StrUtil.isEmpty(deleteResult)) {commDataResults.add(IotCommDataResult.FAIL_RESULT(userIdList.get(i)));continue;}JSONObject jsonObjectRespon = JSONUtil.parseObj(deleteResult);JSONObject jsonObjectData = jsonObjectRespon.getJSONObject("UserInfoDetailDeleteProcess");String process = jsonObjectData.getStr("status");log.info("process :{}", process);if ("processing".equals(process)) {log.info("正在删除");int frequency = 0;process = this.analysisDelData(getDeleteProcessUrl, deleteResult, frequency, lUserID);}if ("success".equals(process)) {log.info("删除成功");commDataResults.add(IotCommDataResult.COMMON_SUCCESS_RESULT(userIdList.get(i), "删除成功"));} else if ("failed".equals(process)) {log.info("删除失败");commDataResults.add(IotCommDataResult.COMMON_FAIL_RESULT(userIdList.get(i), "删除失败"));}}//退出登录logout(lUserID);return commDataResults;}

解析删除数据

/*** 解析删除数据*/private String analysisDelData(String getDeleteProcessUrl, String deleteResult, int frequency, int lUserID) {JSONObject jsonObjectRespon = JSONUtil.parseObj(deleteResult);JSONObject jsonObjectData = jsonObjectRespon.getJSONObject("UserInfoDetailDeleteProcess");String process = jsonObjectData.getStr("status");log.info("process :{}", process);if ("processing".equals(process)) {log.info("正在删除");if (frequency >= 3) {return "failed";}frequency = frequency + 1;try {Thread.sleep(200);String result = delUserFaceRespon(getDeleteProcessUrl, lUserID);this.analysisDelData(getDeleteProcessUrl, result, frequency, lUserID);} catch (InterruptedException e) {log.warn("休眠异常 ", e);}}if ("success".equals(process)) {log.info("删除成功");return process;} else if ("failed".equals(process)) {log.info("删除失败");return process;}return null;}

执行删除操作

 /*** 执行删除操作* userId */private Boolean delUserFace(Long userId, String deleteUserUrl, int lUserID) {JSONObject jsonData = new JSONObject();JSONObject userInfoDetail = new JSONObject();JSONArray employeeNoList = new JSONArray();userInfoDetail.set("mode", "byEmployeeNo"); //通过用户编号删除JSONObject jsonObject = new JSONObject();jsonObject.set("employeeNo", String.valueOf(userId));employeeNoList.put(jsonObject);userInfoDetail.set("EmployeeNoList", employeeNoList);// 组装成集合 多个employeeNojsonData.set("UserInfoDetail", userInfoDetail);String toJsonData = JSONUtil.toJsonStr(jsonData);NET_DVR_XML_CONFIG_INPUT struXMLInput = new NET_DVR_XML_CONFIG_INPUT();struXMLInput.read();BYTE_ARRAY stringRequest = new BYTE_ARRAY(1024);stringRequest.read();//输入ISAPI协议命令System.arraycopy(deleteUserUrl.getBytes(), 0, stringRequest.byValue, 0, deleteUserUrl.length());stringRequest.write();struXMLInput.dwSize = struXMLInput.size();struXMLInput.lpRequestUrl = stringRequest.getPointer();struXMLInput.dwRequestUrlLen = deleteUserUrl.length();BYTE_ARRAY ptrInBuffer = new BYTE_ARRAY(toJsonData.length());ptrInBuffer.read();System.arraycopy(toJsonData.getBytes(), 0, ptrInBuffer.byValue, 0, toJsonData.length());ptrInBuffer.write();struXMLInput.lpInBuffer = ptrInBuffer.getPointer();struXMLInput.dwInBufferSize = toJsonData.length();struXMLInput.write();BYTE_ARRAY stringXMLOut = new BYTE_ARRAY(8 * 1024);stringXMLOut.read();BYTE_ARRAY struXMLStatus = new BYTE_ARRAY(1024);struXMLStatus.read();NET_DVR_XML_CONFIG_OUTPUT struXMLOutput = new NET_DVR_XML_CONFIG_OUTPUT();struXMLOutput.read();struXMLOutput.dwSize = struXMLOutput.size();struXMLOutput.lpOutBuffer = stringXMLOut.getPointer();struXMLOutput.dwOutBufferSize = stringXMLOut.size();struXMLOutput.lpStatusBuffer = struXMLStatus.getPointer();struXMLOutput.dwStatusSize = struXMLStatus.size();struXMLOutput.write();boolean stdxmlConfig = hCNetSDK.NET_DVR_STDXMLConfig(lUserID, struXMLInput, struXMLOutput);if (!stdxmlConfig) {log.warn("NET_DVR_STDXMLConfig失败,错误号:{}", hCNetSDK.NET_DVR_GetLastError());}return stdxmlConfig;}

获取删除结果

 /*** 获取删除结果*/private String delUserFaceRespon(String getDeleteProcessUrl, int lUserID) {NET_DVR_XML_CONFIG_INPUT struXMLInput = new NET_DVR_XML_CONFIG_INPUT();struXMLInput.read();BYTE_ARRAY stringRequest = new BYTE_ARRAY(1024);stringRequest.read();//输入ISAPI协议命令System.arraycopy(getDeleteProcessUrl.getBytes(), 0, stringRequest.byValue, 0, getDeleteProcessUrl.length());stringRequest.write();struXMLInput.dwSize = struXMLInput.size();struXMLInput.lpRequestUrl = stringRequest.getPointer();struXMLInput.dwRequestUrlLen = getDeleteProcessUrl.length();struXMLInput.lpInBuffer = null;struXMLInput.dwInBufferSize = 0;struXMLInput.write();BYTE_ARRAY stringXMLOut = new BYTE_ARRAY(8 * 1024);stringXMLOut.read();BYTE_ARRAY struXMLStatus = new BYTE_ARRAY(1024);struXMLStatus.read();NET_DVR_XML_CONFIG_OUTPUT struXMLOutput = new NET_DVR_XML_CONFIG_OUTPUT();struXMLOutput.read();struXMLOutput.dwSize = struXMLOutput.size();struXMLOutput.lpOutBuffer = stringXMLOut.getPointer();struXMLOutput.dwOutBufferSize = stringXMLOut.size();struXMLOutput.lpStatusBuffer = struXMLStatus.getPointer();struXMLOutput.dwStatusSize = struXMLStatus.size();struXMLOutput.write();if (!hCNetSDK.NET_DVR_STDXMLConfig(lUserID, struXMLInput, struXMLOutput)) {int iErr = hCNetSDK.NET_DVR_GetLastError();log.warn("NET_DVR_STDXMLConfig失败,错误号 :{} ,url:{}", iErr, getDeleteProcessUrl);return null;} else {stringXMLOut.read();log.info("输出文本大小:{}", struXMLOutput.dwReturnedXMLSize);//打印输出XML文本String strOutXML = new String(stringXMLOut.byValue).trim();log.info("delUserFaceRespon strOutXML:{}", strOutXML);struXMLStatus.read();String strStatus = new String(struXMLStatus.byValue).trim();log.info("delUserFaceRespon strStatus:{}", strStatus);return strOutXML;}}
http://www.mmbaike.com/news/47047.html

相关文章:

  • h5都用什么网站seo推广优势
  • 动态网站的优点最近三天的国内新闻
  • 权重查询站长工具昆明自动seo
  • 怎么样做网站 用网站赚钱seo外贸推广
  • 网页升级紧急通知狼急通知登封seo公司
  • 关于做情侣的网站的图片大全如何推广一个品牌
  • 网站被百度降权了怎么办精品成品网站入口
  • 淘宝网首页官网整站seo技术
  • 深圳网站建设工作bing收录提交
  • 微网站 备案网络推广引流最快方法
  • 专做美容师招聘网站电商网站定制开发
  • 做互联网产品和运营必备的网站网络营销活动推广方式
  • 苏州网站建设套餐seo搜索引擎优化技术教程
  • php高性能网站建设网络营销好找工作吗
  • wordpress无广告视频seo网站搭建是什么
  • php响应式网站模板站长工具app官方下载
  • 做番号网站违法么关键词检索怎么弄
  • 企业信用信息公示系统广东seo优化快排
  • 免费做初中试卷的网站seo综合查询是什么
  • wordpress menu image百度seo排名优
  • 网站建设技术网站建设百度人工投诉电话是多少
  • wordpress景点展示插件seo网站优化助理
  • 义乌做网站的公司有哪些长沙做优化的公司
  • 安徽省建设干部学校网站关停推广资源seo
  • 网站开发合肥seo方案怎么做
  • 单位做网站资料需要什么优化推广网站排名
  • 成都摄影网站建设app推广好做吗
  • 软件开发文档资料包括哪些windows系统优化软件排行榜
  • 做框架模板的网站网站是怎么建立起来的
  • 网站建设 页面外贸平台自建站