| | |
| | | String res = HKTools.delOrg(JSONObject.toJSONString(param)); |
| | | TypeReference typeReference = |
| | | new TypeReference< BaseResponse >(){}; |
| | | BaseResponse result = JSONObject.parseObject(res, typeReference.getType()); |
| | | BaseResponse<List<OrgUpdateFailureResponse>> result = JSONObject.parseObject(res, typeReference.getType()); |
| | | logResult(result,"海康删除组织"); |
| | | return result; |
| | | }catch (Exception e){ |
| | |
| | | try { |
| | | String res = HKTools.delBatchUser(JSONObject.toJSONString(param)); |
| | | TypeReference typeReference = |
| | | new TypeReference< BaseResponse<OrgOrUserAddFailureResponse>>(){}; |
| | | new TypeReference< BaseResponse<List<UserDelResponse>>>(){}; |
| | | BaseResponse<List<UserDelResponse >> result = JSONObject.parseObject(res, typeReference.getType()); |
| | | logResult(result,"海康批量新增人员"); |
| | | return result; |
| | |
| | | *添加人脸信息 |
| | | * @return |
| | | */ |
| | | public static BaseResponse<FaceAddOrEditesponse> addFace(List<FaceAddRequest> param){ |
| | | public static BaseResponse<FaceAddOrEditesponse> addFace( FaceAddRequest param){ |
| | | log.info("【海康添加人脸信息】================开始===="+JSONObject.toJSONString(param)); |
| | | try { |
| | | String res = HKTools.addFace(JSONObject.toJSONString(param)); |
| | |
| | | *编辑人脸信息 |
| | | * @return |
| | | */ |
| | | public static BaseResponse<FaceAddOrEditesponse> editFace(List<FaceEditRequest> param){ |
| | | public static BaseResponse<FaceAddOrEditesponse> editFace( FaceEditRequest param){ |
| | | log.info("【海康编辑人脸信息】================开始===="+JSONObject.toJSONString(param)); |
| | | try { |
| | | String res = HKTools.editFace(JSONObject.toJSONString(param)); |
| | |
| | | *海康一卡通任务进度查询 |
| | | * @return |
| | | */ |
| | | public static BaseResponse<TaskProgressResponse> taskDataAddition(TaskProgressRequest param){ |
| | | public static BaseResponse<TaskProgressNumResponse> taskProgressNum(TaskProgressRequest param){ |
| | | log.info("【海康一卡通任务进度查询】================开始===="+JSONObject.toJSONString(param)); |
| | | String res = null; |
| | | try { |
| | | res = HKTools.taskProgressNum(JSONObject.toJSONString(param)); |
| | | TypeReference typeReference = |
| | | new TypeReference< BaseResponse<TaskProgressNumResponse> >(){}; |
| | | BaseResponse<TaskProgressNumResponse> result = JSONObject.parseObject(res, typeReference.getType()); |
| | | logResult(result,"海康一卡通任务进度查询"); |
| | | return result; |
| | | }catch (Exception e){ |
| | | log.error("【海康一卡通任务进度查询】================失败====:\n"+ e.getMessage()); |
| | | }finally { |
| | | // saveInterfaceLog(param,res); |
| | | } |
| | | return null; |
| | | } |
| | | /** |
| | | *海康一卡通设备通道的人员权限下载详情总数v2 |
| | | * @return |
| | | */ |
| | | public static BaseResponse<TaskProgressResponse> taskProgress(TaskProgressRequest param){ |
| | | log.info("【海康一卡通设备通道的人员权限下载详情总数】================开始===="+JSONObject.toJSONString(param)); |
| | | String res = null; |
| | | try { |
| | | res = HKTools.taskProgress(JSONObject.toJSONString(param)); |
| | | TypeReference typeReference = |
| | | new TypeReference< BaseResponse<TaskProgressResponse> >(){}; |
| | | BaseResponse<TaskProgressResponse> result = JSONObject.parseObject(res, typeReference.getType()); |
| | | logResult(result,"海康一卡通任务进度查询"); |
| | | logResult(result,"海康一卡通设备通道的人员权限下载详情总数"); |
| | | return result; |
| | | }catch (Exception e){ |
| | | log.error("【海康一卡通任务进度查询】================失败====:\n"+ e.getMessage()); |
| | | log.error("【海康一卡通设备通道的人员权限下载详情总数】================失败====:\n"+ e.getMessage()); |
| | | }finally { |
| | | // saveInterfaceLog(param,res); |
| | | } |
| | | return null; |
| | | } |
| | | /** |
| | | *海康查询权限条目列表 |
| | | * @return |
| | | */ |
| | | public static BaseResponse<AuthItemListResponse> authItemList(AuthItemListRequest param){ |
| | | log.info("【海康查询权限条目列表】================开始===="+JSONObject.toJSONString(param)); |
| | | String res = null; |
| | | try { |
| | | res = HKTools.authItemList(JSONObject.toJSONString(param)); |
| | | TypeReference typeReference = |
| | | new TypeReference< BaseResponse<AuthItemListResponse> >(){}; |
| | | BaseResponse<AuthItemListResponse> result = JSONObject.parseObject(res, typeReference.getType()); |
| | | logResult(result,"海康查询权限条目列表"); |
| | | return result; |
| | | }catch (Exception e){ |
| | | log.error("【海康查询权限条目列表】================失败====:\n"+ e.getMessage()); |
| | | }finally { |
| | | // saveInterfaceLog(param,res); |
| | | } |
| | |
| | | } |
| | | return null; |
| | | } |
| | | /** |
| | | *海康批量开卡 |
| | | * @return |
| | | */ |
| | | public static BaseResponse<List<CardInfoResponse>> cardBingding(CardBingdingRequest param){ |
| | | log.info("【海康批量开卡】================开始===="+JSONObject.toJSONString(param)); |
| | | String res = null; |
| | | try { |
| | | res = HKTools.cardBingding(JSONObject.toJSONString(param)); |
| | | TypeReference typeReference = |
| | | new TypeReference< BaseResponse <List<CardInfoResponse>> >(){}; |
| | | BaseResponse<List<CardInfoResponse>> result = JSONObject.parseObject(res, typeReference.getType()); |
| | | logResult(result,"海康批量开卡"); |
| | | return result; |
| | | }catch (Exception e){ |
| | | log.error("【海康批量开卡】================失败====:\n"+ e.getMessage()); |
| | | }finally { |
| | | } |
| | | return null; |
| | | } |
| | | /** |
| | | *海康退卡 |
| | | * @return |
| | | */ |
| | | public static BaseResponse cardDeletion(CardDeletionRequest param){ |
| | | log.info("【海康退卡】================开始===="+JSONObject.toJSONString(param)); |
| | | String res = null; |
| | | try { |
| | | res = HKTools.cardDeletion(JSONObject.toJSONString(param)); |
| | | TypeReference typeReference = |
| | | new TypeReference< BaseResponse >(){}; |
| | | BaseResponse result = JSONObject.parseObject(res, typeReference.getType()); |
| | | logResult(result,"海康退卡"); |
| | | return result; |
| | | }catch (Exception e){ |
| | | log.error("【海康退卡】================失败====:\n"+ e.getMessage()); |
| | | }finally { |
| | | } |
| | | return null; |
| | | } |
| | | /** |
| | | *海康批量挂失 |
| | | * @return |
| | | */ |
| | | public static BaseResponse cardLoss(CardLossRequest param){ |
| | | log.info("【海康批量挂失】================开始===="+JSONObject.toJSONString(param)); |
| | | String res = null; |
| | | try { |
| | | res = HKTools.cardLoss(JSONObject.toJSONString(param)); |
| | | TypeReference typeReference = |
| | | new TypeReference< BaseResponse >(){}; |
| | | BaseResponse result = JSONObject.parseObject(res, typeReference.getType()); |
| | | logResult(result,"海康批量挂失"); |
| | | return result; |
| | | }catch (Exception e){ |
| | | log.error("【海康批量挂失】================失败====:\n"+ e.getMessage()); |
| | | }finally { |
| | | } |
| | | return null; |
| | | } |
| | | /** |
| | | *海康批量解挂 |
| | | * @return |
| | | */ |
| | | public static BaseResponse cardUnLoss(CardLossRequest param){ |
| | | log.info("【海康批量解挂】================开始===="+JSONObject.toJSONString(param)); |
| | | String res = null; |
| | | try { |
| | | res = HKTools.cardUnloss(JSONObject.toJSONString(param)); |
| | | TypeReference typeReference = |
| | | new TypeReference< BaseResponse >(){}; |
| | | BaseResponse result = JSONObject.parseObject(res, typeReference.getType()); |
| | | logResult(result,"海康批量解挂"); |
| | | return result; |
| | | }catch (Exception e){ |
| | | log.error("【海康批量解挂】================失败====:\n"+ e.getMessage()); |
| | | }finally { |
| | | } |
| | | return null; |
| | | } |
| | | /** |
| | | *海康查询设备通道的人员权限下载详情 |
| | | * @return |
| | | */ |
| | | public static BaseResponse<TaskPersonDetailListResponse> taskPersoDetail(TaskPersonDetailRequest param){ |
| | | log.info("【海康查询设备通道的人员权限下载详情】================开始===="+JSONObject.toJSONString(param)); |
| | | String res = null; |
| | | try { |
| | | res = HKTools.taskPersoDetail(JSONObject.toJSONString(param)); |
| | | TypeReference typeReference = |
| | | new TypeReference< BaseResponse <TaskPersonDetailListResponse>>(){}; |
| | | BaseResponse<TaskPersonDetailListResponse> result = JSONObject.parseObject(res, typeReference.getType()); |
| | | logResult(result,"海康查询设备通道的人员权限下载详情"); |
| | | return result; |
| | | }catch (Exception e){ |
| | | log.error("【海康查询设备通道的人员权限下载详情】================失败====:\n"+ e.getMessage()); |
| | | }finally { |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | private static void logResult(BaseResponse res,String name) { |
| | | if(StringUtils.equals(res.getCode(),HKConstants.RESPONSE_SUCCEE)){ |