| | |
| | | * @return |
| | | */ |
| | | public static BaseResponse<List<UserDelResponse>> delBatchUser(UserDelRequest param){ |
| | | log.info("【海康批量新增人员】================开始===="+JSONObject.toJSONString(param)); |
| | | log.info("【海康批量删除人员】================开始===="+JSONObject.toJSONString(param)); |
| | | try { |
| | | String res = HKTools.delBatchUser(JSONObject.toJSONString(param)); |
| | | TypeReference typeReference = |
| | | new TypeReference< BaseResponse<List<UserDelResponse>>>(){}; |
| | | BaseResponse<List<UserDelResponse >> 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()); |
| | | } |
| | | return null; |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | public static BaseResponse<FaceAddOrEditesponse> addFace( FaceAddRequest param){ |
| | | log.info("【海康添加人脸信息】================开始===="+JSONObject.toJSONString(param)); |
| | | log.info("【海康添加人脸信息】================开始====" ); |
| | | try { |
| | | String res = HKTools.addFace(JSONObject.toJSONString(param)); |
| | | TypeReference typeReference = |
| | | new TypeReference< BaseResponse<FaceAddOrEditesponse>>(){}; |
| | | TypeReference typeReference = new TypeReference< BaseResponse<FaceAddOrEditesponse>>(){}; |
| | | BaseResponse<FaceAddOrEditesponse> result = JSONObject.parseObject(res, typeReference.getType()); |
| | | logResult(result,"海康添加人脸信息"); |
| | | logResult(res,"海康添加人脸信息"); |
| | | return result; |
| | | }catch (Exception e){ |
| | | log.error("【海康添加人脸信息】================失败====:\n"+ e.getMessage()); |
| | |
| | | * @return |
| | | */ |
| | | public static BaseResponse<FaceAddOrEditesponse> editFace( FaceEditRequest param){ |
| | | log.info("【海康编辑人脸信息】================开始===="+JSONObject.toJSONString(param)); |
| | | log.info("【海康编辑人脸信息】================开始====" ); |
| | | String res =null; |
| | | try { |
| | | String res = HKTools.editFace(JSONObject.toJSONString(param)); |
| | | res = HKTools.editFace(JSONObject.toJSONString(param)); |
| | | TypeReference typeReference = |
| | | new TypeReference< BaseResponse<FaceAddOrEditesponse>>(){}; |
| | | BaseResponse<FaceAddOrEditesponse> result = JSONObject.parseObject(res, typeReference.getType()); |
| | | logResult(result,"海康编辑人脸信息"); |
| | | logResult(res,"海康编辑人脸信息"); |
| | | return result; |
| | | }catch (Exception e){ |
| | | log.error("【海康编辑人脸信息】================失败====:\n"+ e.getMessage()); |
| | |
| | | public static BaseResponse delFace(List<FaceEditRequest> param){ |
| | | log.info("【海康删除人脸信息】================开始===="+JSONObject.toJSONString(param)); |
| | | try { |
| | | String res = HKTools.editFace(JSONObject.toJSONString(param)); |
| | | String res = HKTools.delFace(JSONObject.toJSONString(param)); |
| | | TypeReference typeReference = |
| | | new TypeReference< BaseResponse>(){}; |
| | | BaseResponse result = JSONObject.parseObject(res, typeReference.getType()); |
| | |
| | | return null; |
| | | } |
| | | /** |
| | | *全量人员查询2(根据条件查询分页) |
| | | * @return |
| | | */ |
| | | public static BaseResponse<BaseListPageResponse<UserInfoResponse>> personList(UserByParamListRequest param){ |
| | | log.info("【海康根据条件查询人员列表】================开始===="+JSONObject.toJSONString(param)); |
| | | try { |
| | | String res = HKTools.personList(JSONObject.toJSONString(param)); |
| | | TypeReference typeReference = |
| | | new TypeReference< BaseResponse<BaseListPageResponse<UserInfoResponse>> >(){}; |
| | | BaseResponse<BaseListPageResponse<UserInfoResponse>> result = JSONObject.parseObject(res, typeReference.getType()); |
| | | logResult(result,"海康根据条件查询人员列表"); |
| | | return result; |
| | | }catch (Exception e){ |
| | | log.error("【海康根据条件查询人员列表】================失败====:\n"+ e.getMessage()); |
| | | } |
| | | return null; |
| | | } |
| | | /** |
| | | *增量人员查询(分页) |
| | | * @return |
| | | */ |
| | |
| | | return null; |
| | | } |
| | | /** |
| | | *过车记录查询(分页) |
| | | * @return |
| | | */ |
| | | public static BaseResponse<BaseListPageResponse<ParkCrossRecordInfoResponse>> parkCrossRecords(ParkCrossRecordListRequest param){ |
| | | log.info("【海康过车记录查询查询】================开始===="+JSONObject.toJSONString(param)); |
| | | try { |
| | | String res = HKTools.parkCrossRecords(JSONObject.toJSONString(param)); |
| | | TypeReference typeReference = |
| | | new TypeReference< BaseResponse<BaseListPageResponse<ParkCrossRecordInfoResponse>> >(){}; |
| | | BaseResponse<BaseListPageResponse<ParkCrossRecordInfoResponse>> result = JSONObject.parseObject(res, typeReference.getType()); |
| | | logResult(result,"海康过车记录查询查询"); |
| | | return result; |
| | | }catch (Exception e){ |
| | | log.error("【海康过车记录查询查询】================失败====:\n"+ e.getMessage()); |
| | | } |
| | | return null; |
| | | } |
| | | /** |
| | | *增量车辆查询(分页) |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | return null; |
| | | } |
| | | /** |
| | | *增量车辆查询(分页) |
| | | * @return |
| | | */ |
| | | public static BaseResponse<BaseListPageResponse<VehicleTimeRangeInfoResponse>> facePictureCheck(TimeRangeListRequest param){ |
| | | log.info("【海康增量人员查询】================开始===="+JSONObject.toJSONString(param)); |
| | | try { |
| | | String res = HKTools.facePictureCheck(JSONObject.toJSONString(param)); |
| | | TypeReference typeReference = |
| | | new TypeReference< BaseResponse<BaseListPageResponse<VehicleTimeRangeInfoResponse>> >(){}; |
| | | BaseResponse<BaseListPageResponse<VehicleTimeRangeInfoResponse>> result = JSONObject.parseObject(res, typeReference.getType()); |
| | | logResult(result,"海康增量人员查询"); |
| | | return result; |
| | | }catch (Exception e){ |
| | | log.error("【海康增量人员查询】================失败====:\n"+ e.getMessage()); |
| | | } |
| | | return null; |
| | | } |
| | | /** |
| | | *获取门禁设备在线状态(分页) |
| | | * @return |
| | | */ |
| | | public static BaseResponse<BaseListPageResponse<AscDeviceStatusInfoResponse>> acsDeviceStatus(AcsDeviceStatusListRequest param){ |
| | | log.info("【海康获取门禁设备在线状态】================开始===="+JSONObject.toJSONString(param)); |
| | | try { |
| | | String res = HKTools.acsDeviceStatus(JSONObject.toJSONString(param)); |
| | | TypeReference typeReference = |
| | | new TypeReference< BaseResponse<BaseListPageResponse<AscDeviceStatusInfoResponse>> >(){}; |
| | | BaseResponse<BaseListPageResponse<AscDeviceStatusInfoResponse>> result = JSONObject.parseObject(res, typeReference.getType()); |
| | | logResult(result,"海康获取门禁设备在线状态"); |
| | | return result; |
| | | }catch (Exception e){ |
| | | log.error("【海康获取门禁设备在线状态】================失败====:\n"+ e.getMessage()); |
| | | } |
| | | return null; |
| | | } |
| | | /** |
| | | *查询场内车停车信息(分页) |
| | | * @return |
| | | */ |
| | | public static BaseResponse<BaseListPageResponse<TempCarInRecordInfoResponse>> tempCarInRecords(TempCarInRecordListRequest param){ |
| | | log.info("【海康查询场内车停车信息】================开始===="+JSONObject.toJSONString(param)); |
| | | try { |
| | | String res = HKTools.tempCarInRecords(JSONObject.toJSONString(param)); |
| | | TypeReference typeReference = |
| | | new TypeReference< BaseResponse<BaseListPageResponse<TempCarInRecordInfoResponse>> >(){}; |
| | | BaseResponse<BaseListPageResponse<TempCarInRecordInfoResponse>> result = JSONObject.parseObject(res, typeReference.getType()); |
| | | logResult(result,"海康查询场内车停车信息"); |
| | | return result; |
| | | }catch (Exception e){ |
| | | log.error("【海康查询场内车停车信息】================失败====:\n"+ e.getMessage()); |
| | | } |
| | | return null; |
| | | } |
| | | private static void logResult(BaseResponse res,String name) { |
| | | if(StringUtils.equals(res.getCode(),HKConstants.RESPONSE_SUCCEE)){ |
| | | log.info("【"+name+"】================成功====\n"+res); |
| | |
| | | log.error("【"+name+"】================失败====:\n"+ res); |
| | | } |
| | | } |
| | | private static void logResult(String res,String name) { |
| | | log.info("【"+name+"】================结果====\n"+res); |
| | | } |
| | | |
| | | } |
| | | |