|  |  |  | 
|---|
|  |  |  | import com.doumee.core.haikang.model.param.BaseResponse; | 
|---|
|  |  |  | import com.doumee.core.haikang.model.param.request.*; | 
|---|
|  |  |  | import com.doumee.core.haikang.model.param.respose.*; | 
|---|
|  |  |  | import com.doumee.core.utils.Constants; | 
|---|
|  |  |  | import com.hikvision.artemis.sdk.config.ArtemisConfig; | 
|---|
|  |  |  | import lombok.extern.slf4j.Slf4j; | 
|---|
|  |  |  | import org.apache.commons.lang3.ObjectUtils; | 
|---|
|  |  |  | import org.apache.commons.lang3.StringUtils; | 
|---|
|  |  |  | import org.slf4j.Logger; | 
|---|
|  |  |  | import org.slf4j.LoggerFactory; | 
|---|
|  |  |  | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public static InputStream getFaceInputStream(FacePictureRequest param) { | 
|---|
|  |  |  | log.info("【海康人脸访问图片流】================开始===="+JSONObject.toJSONString(param)); | 
|---|
|  |  |  | log.error("********************ArtemisConfig.host***********************************"+ ArtemisConfig.host); | 
|---|
|  |  |  | log.error("********************ArtemisConfig.key********************************"+ArtemisConfig.appKey); | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | InputStream res = HKTools.getFaceInputStream(JSONObject.toJSONString(param)); | 
|---|
|  |  |  | log.error("【海康人脸访问图片流】================成功====\n"); | 
|---|
|  |  |  | 
|---|
|  |  |  | public  static  BaseResponse   parkReservationDeletion(ParkReservationDelRequest param){ | 
|---|
|  |  |  | log.info("【海康车位取消预约】================开始===="+JSONObject.toJSONString(param)); | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | String res = HKTools.carChargeDeletion(JSONObject.toJSONString(param)); | 
|---|
|  |  |  | String res = HKTools.parkDeletion(JSONObject.toJSONString(param)); | 
|---|
|  |  |  | TypeReference typeReference = | 
|---|
|  |  |  | new TypeReference< BaseResponse>(){}; | 
|---|
|  |  |  | BaseResponse  result = JSONObject.parseObject(res, typeReference.getType()); | 
|---|
|  |  |  | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public  static  BaseResponse<IccmAppointmentMDJResponse>   iccmAppiontmentMDJ(IccmAppointmentMDJRequest param){ | 
|---|
|  |  |  | log.info("【海康访客免登记预约】================开始===="+JSONObject.toJSONString(param)); | 
|---|
|  |  |  | log.info("【海康访客免登记预约】================iccm开始===="+JSONObject.toJSONString(param)); | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | String res = HKTools.visitAppiontmentMDJ(JSONObject.toJSONString(param)); | 
|---|
|  |  |  | String res = HKTools.iccmAppointmentMDJ(JSONObject.toJSONString(param)); | 
|---|
|  |  |  | TypeReference typeReference = | 
|---|
|  |  |  | new TypeReference< BaseResponse<IccmAppointmentMDJResponse> >(){}; | 
|---|
|  |  |  | BaseResponse<IccmAppointmentMDJResponse>   result = JSONObject.parseObject(res, typeReference.getType()); | 
|---|
|  |  |  | logResult(result,"海康访客免登记预约"); | 
|---|
|  |  |  | return  result; | 
|---|
|  |  |  | }catch (Exception e){ | 
|---|
|  |  |  | log.error("【海康访客免登记预约】================失败====:\n"+ e.getMessage()); | 
|---|
|  |  |  | log.error("【海康访客免登记预约】================iccm失败====:\n"+ e.getMessage()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return  null; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | return  null; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | *查询访客预约记录(分页) | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public  static  BaseResponse<BaseListPageResponse<IccmAppointmentListResponse>>   iccmAppointmentRecords(IccmAppointmentListRequest param){ | 
|---|
|  |  |  | log.info("【海康访客预约记录查询】================开始===="+JSONObject.toJSONString(param)); | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | String res = HKTools.iccmAppointmentRecords(JSONObject.toJSONString(param)); | 
|---|
|  |  |  | TypeReference typeReference = | 
|---|
|  |  |  | new TypeReference<BaseResponse<BaseListPageResponse<IccmAppointmentListResponse>>>(){}; | 
|---|
|  |  |  | BaseResponse<BaseListPageResponse<IccmAppointmentListResponse>>   result = JSONObject.parseObject(res, typeReference.getType()); | 
|---|
|  |  |  | logResult(result,"海康访客预约记录查询"); | 
|---|
|  |  |  | return  result; | 
|---|
|  |  |  | }catch (Exception e){ | 
|---|
|  |  |  | log.error("【海康访客预约记录查询】================失败====:\n"+ e.getMessage()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return  null; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | *1.9.1根据微信公众号信息获取AccessToken(分页) | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public  static  BaseResponse<String>   wxAccessToken(String configId,String tagId){ | 
|---|
|  |  |  | log.info("【海康根据微信公众号信息获取AccessToken】================开始====configId:"+configId+" && tagId:"+tagId); | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | String res = HKTools.wxAccessToken(configId,tagId); | 
|---|
|  |  |  | TypeReference typeReference = | 
|---|
|  |  |  | new TypeReference<BaseResponse<String>>(){}; | 
|---|
|  |  |  | BaseResponse<String>   result = JSONObject.parseObject(res, typeReference.getType()); | 
|---|
|  |  |  | logResult(result,"海康根据微信公众号信息获取AccessToken"); | 
|---|
|  |  |  | return  result; | 
|---|
|  |  |  | }catch (Exception e){ | 
|---|
|  |  |  | log.error("【海康根据微信公众号信息获取AccessToken】================失败====:\n"+ e.getMessage()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return  null; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | *根据配置微信公众号编号查询微信公众号信息 | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public  static  BaseResponse< WxConfigInfoResponse>  getWxConfig(WxConfigInfoRequest param){ | 
|---|
|  |  |  | log.info("【海康根据配置微信公众号编号查询微信公众号信息】================开始===="+JSONObject.toJSONString(param)); | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | String res = HKTools.getWxConfig(toMap(param)); | 
|---|
|  |  |  | TypeReference typeReference = | 
|---|
|  |  |  | new TypeReference<BaseResponse<WxConfigInfoResponse>>(){}; | 
|---|
|  |  |  | BaseResponse<WxConfigInfoResponse>   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<GetTodoListResponse>>   getTodoListPage(GetTodoListRequest param){ | 
|---|
|  |  |  | log.info("【海康分页获取待办列表】================开始===="+JSONObject.toJSONString(param)); | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | String res = HKTools.getTodoListPage(toMap(param)); | 
|---|
|  |  |  | TypeReference typeReference = | 
|---|
|  |  |  | new TypeReference<BaseResponse<BaseListPageResponse<GetTodoListResponse>>>(){}; | 
|---|
|  |  |  | BaseResponse<BaseListPageResponse<GetTodoListResponse>>   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<FireDeviceStatusListResponse>>   fireDeviceStatusSearch(FireDeviceStatuslListRequest param){ | 
|---|
|  |  |  | log.info("【海康查询消防设备部件状态】================开始===="+JSONObject.toJSONString(param)); | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | String res = HKTools.fireDeviceStatusSearch(JSONObject.toJSONString(param)); | 
|---|
|  |  |  | TypeReference typeReference = | 
|---|
|  |  |  | new TypeReference<BaseResponse<BaseListPageResponse<FireDeviceStatusListResponse>>>(){}; | 
|---|
|  |  |  | BaseResponse<BaseListPageResponse<FireDeviceStatusListResponse>>   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<SensorStatusListResponse>>   sensorStatusSearch(SensorStatusListRequest param){ | 
|---|
|  |  |  | log.info("【海康分页查询消防传感器部件状态】================开始===="+JSONObject.toJSONString(param)); | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | String res = HKTools.sensorStatusSearch(JSONObject.toJSONString(param)); | 
|---|
|  |  |  | TypeReference typeReference = | 
|---|
|  |  |  | new TypeReference<BaseResponse<BaseListPageResponse<SensorStatusListResponse>>>(){}; | 
|---|
|  |  |  | BaseResponse<BaseListPageResponse<SensorStatusListResponse>>   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<FireChannelListResponse>>   fireChannelSearch(FireChannelListRequest param){ | 
|---|
|  |  |  | log.info("【海康查询消防传感器列表】================开始===="+JSONObject.toJSONString(param)); | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | String res = HKTools.fireChannelSearch(JSONObject.toJSONString(param)); | 
|---|
|  |  |  | TypeReference typeReference = | 
|---|
|  |  |  | new TypeReference<BaseResponse<BaseListPageResponse<FireChannelListResponse>>>(){}; | 
|---|
|  |  |  | BaseResponse<BaseListPageResponse<FireChannelListResponse>>   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<FindDeviceAlarmListResponse>>   findDeviceAlarmPage(FindDeviceAlarmListRequest param){ | 
|---|
|  |  |  | log.info("【海康分页查询设备下的所有报警记录】================开始===="+JSONObject.toJSONString(param)); | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | String res = HKTools.findDeviceAlarmPage(JSONObject.toJSONString(param)); | 
|---|
|  |  |  | TypeReference typeReference = | 
|---|
|  |  |  | new TypeReference<BaseResponse<BaseListPageResponse<FindDeviceAlarmListResponse>>>(){}; | 
|---|
|  |  |  | BaseResponse<BaseListPageResponse<FindDeviceAlarmListResponse>>   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<FireDeviceListResponse>>   fireDeviceSearch(FireDeviceListRequest param){ | 
|---|
|  |  |  | log.info("【海康询消防设备列表】================开始===="+JSONObject.toJSONString(param)); | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | String res = HKTools.fireDeviceSearch(JSONObject.toJSONString(param)); | 
|---|
|  |  |  | TypeReference typeReference = | 
|---|
|  |  |  | new TypeReference<BaseResponse<BaseListPageResponse<FireDeviceListResponse>>>(){}; | 
|---|
|  |  |  | BaseResponse<BaseListPageResponse<FireDeviceListResponse>>   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<NhEventPageListResponse>>   nhEventPageList(NhEventPageListRequest param){ | 
|---|
|  |  |  | log.info("【海康分页获取告警事件】================开始===="+JSONObject.toJSONString(param)); | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | String res = HKTools.nhEventPageList(toMap(param)); | 
|---|
|  |  |  | TypeReference typeReference = | 
|---|
|  |  |  | new TypeReference<BaseResponse<BaseListPageResponse<NhEventPageListResponse>>>(){}; | 
|---|
|  |  |  | BaseResponse<BaseListPageResponse<NhEventPageListResponse>>   result = JSONObject.parseObject(res, typeReference.getType()); | 
|---|
|  |  |  | logResult(result,"海康分页获取告警事件"); | 
|---|
|  |  |  | return  result; | 
|---|
|  |  |  | }catch (Exception e){ | 
|---|
|  |  |  | log.error("【海康分页获取告警事件】================失败====:\n"+ e.getMessage()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return  null; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | *查询访客来访记录(已登记)(分页) | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | 
|---|
|  |  |  | return  result; | 
|---|
|  |  |  | }catch (Exception e){ | 
|---|
|  |  |  | log.error("【海康全量组织查询】================失败====:\n"+ e.getMessage()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return  null; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | *获取工作台菜单免密登陆调整地址 | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public  static  String   getMenuUrl(Integer type,String token){ | 
|---|
|  |  |  | String menuId = HKConstants.MenuPageId.afzx; | 
|---|
|  |  |  | if(Constants.equalsInteger(type,Constants.ONE)){ | 
|---|
|  |  |  | menuId = HKConstants.MenuPageId.xkzx; | 
|---|
|  |  |  | }else  if(Constants.equalsInteger(type,Constants.TWO)){ | 
|---|
|  |  |  | menuId = HKConstants.MenuPageId.ngzx; | 
|---|
|  |  |  | }else  if(Constants.equalsInteger(type,Constants.THREE)){ | 
|---|
|  |  |  | menuId = HKConstants.MenuPageId.jsc; | 
|---|
|  |  |  | }else  if(Constants.equalsInteger(type,Constants.FOUR)){ | 
|---|
|  |  |  | menuId = HKConstants.MenuPageId.kqgzt; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | log.info("【海康获取工作台菜单免密登陆调整地址】================开始====menuId:"+menuId+"==token:"+token); | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | String res = HKTools.getMenuUrl(menuId,token); | 
|---|
|  |  |  | return  res; | 
|---|
|  |  |  | }catch (Exception e){ | 
|---|
|  |  |  | log.error("【海康获取工作台菜单免密登陆调整地址】================失败====:\n"+ e.getMessage()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return  null; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | return  null; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | *增量车辆查询(分页) | 
|---|
|  |  |  | *人脸评分 | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public  static  BaseResponse<BaseListPageResponse<VehicleTimeRangeInfoResponse>>   facePictureCheck(TimeRangeListRequest param){ | 
|---|
|  |  |  | log.info("【海康增量人员查询】================开始===="+JSONObject.toJSONString(param)); | 
|---|
|  |  |  | public  static  BaseResponse<FacePictureCheckResponse>   facePictureCheck(FacePictureCheckRequest 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,"海康增量人员查询"); | 
|---|
|  |  |  | new TypeReference<BaseResponse<FacePictureCheckResponse>>(){}; | 
|---|
|  |  |  | BaseResponse<FacePictureCheckResponse>   result = JSONObject.parseObject(res, typeReference.getType()); | 
|---|
|  |  |  | logResult(result,"人脸评分"); | 
|---|
|  |  |  | return  result; | 
|---|
|  |  |  | }catch (Exception e){ | 
|---|
|  |  |  | log.error("【海康增量人员查询】================失败====:\n"+ e.getMessage()); | 
|---|
|  |  |  | log.error("【人脸评分】================失败====:\n"+ e.getMessage()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return  null; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | log.error("【海康获取全部月台信息】================失败====:\n" + e.getMessage()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return null; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | *发送消息给LED | 
|---|