| | |
| | | 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){ |
| | |
| | | *批量删除人员信息 |
| | | * @return |
| | | */ |
| | | public static BaseResponse<OrgOrUserAddFailureResponse> delBatchUser(List<UserAddRequest> param){ |
| | | public static BaseResponse<List<UserDelResponse>> delBatchUser(UserDelRequest param){ |
| | | log.info("【海康批量新增人员】================开始===="+JSONObject.toJSONString(param)); |
| | | try { |
| | | String res = HKTools.delBatchUser(JSONObject.toJSONString(param)); |
| | | TypeReference typeReference = |
| | | new TypeReference< BaseResponse<OrgOrUserAddFailureResponse>>(){}; |
| | | BaseResponse<OrgOrUserAddFailureResponse> result = JSONObject.parseObject(res, typeReference.getType()); |
| | | BaseResponse<List<UserDelResponse >> result = JSONObject.parseObject(res, typeReference.getType()); |
| | | logResult(result,"海康批量新增人员"); |
| | | return result; |
| | | }catch (Exception e){ |
| | |
| | | *添加人脸信息 |
| | | * @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<VisitAppointmentVistorResponse> visitAppiontmentMDJ(VisitAppointmentMDJRequest param){ |
| | | public static BaseResponse<VisitAppointmentMDJResponse> visitAppiontmentMDJ(VisitAppointmentMDJRequest param){ |
| | | log.info("【海康访客免登记预约】================开始===="+JSONObject.toJSONString(param)); |
| | | try { |
| | | String res = HKTools.visitAppiontmentMDJ(JSONObject.toJSONString(param)); |
| | | TypeReference typeReference = |
| | | new TypeReference< BaseResponse<VisitAppointmentVistorResponse> >(){}; |
| | | BaseResponse<VisitAppointmentVistorResponse> result = JSONObject.parseObject(res, typeReference.getType()); |
| | | new TypeReference< BaseResponse<VisitAppointmentMDJResponse> >(){}; |
| | | BaseResponse<VisitAppointmentMDJResponse> result = JSONObject.parseObject(res, typeReference.getType()); |
| | | logResult(result,"海康访客免登记预约"); |
| | | return result; |
| | | }catch (Exception e){ |
| | |
| | | } |
| | | return null; |
| | | } |
| | | /** |
| | | *海康创建一卡通下载任务 |
| | | * @return |
| | | */ |
| | | public static BaseResponse<TaskAdditionResponse> taskAddition(TaskAdditionRequest param){ |
| | | log.info("【海康创建一卡通下载任务】================开始===="+JSONObject.toJSONString(param)); |
| | | String res = null; |
| | | try { |
| | | res = HKTools.taskAddition(JSONObject.toJSONString(param)); |
| | | TypeReference typeReference = |
| | | new TypeReference< BaseResponse<TaskAdditionResponse>>(){}; |
| | | BaseResponse<TaskAdditionResponse> 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 taskDataAddition(TaskDataAdditionRequest param){ |
| | | log.info("【海康一卡通任务添加数据】================开始===="+JSONObject.toJSONString(param)); |
| | | String res = null; |
| | | try { |
| | | res = HKTools.taskDataAddition(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 { |
| | | // saveInterfaceLog(param,res); |
| | | } |
| | | return null; |
| | | } |
| | | /** |
| | | *海康一卡通任务进度查询 |
| | | * @return |
| | | */ |
| | | 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,"海康一卡通设备通道的人员权限下载详情总数"); |
| | | return result; |
| | | }catch (Exception e){ |
| | | 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 taskStart(TaskProgressRequest param){ |
| | | log.info("【海康一卡通任务开始执行】================开始===="+JSONObject.toJSONString(param)); |
| | | String res = null; |
| | | try { |
| | | res = HKTools.taskStart(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 { |
| | | // saveInterfaceLog(param,res); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | private static void logResult(BaseResponse res,String name) { |
| | | if(StringUtils.equals(res.getCode(),HKConstants.RESPONSE_SUCCEE)){ |