| | |
| | | package com.doumee.core.haikang.service; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson.TypeReference; |
| | | import com.doumee.core.haikang.model.HKConstants; |
| | |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.BeanUtils; |
| | | import oshi.hardware.Sensors; |
| | | import sun.management.Sensor; |
| | | |
| | | import java.io.InputStream; |
| | | import java.lang.reflect.Field; |
| | |
| | | return null; |
| | | } |
| | | /** |
| | | *根据配置微信公众号编号查询微信公众号信息 |
| | | * @return |
| | | */ |
| | | public static BaseResponse<BaseListPageResponse<WxConfigInfoResponse>> getWxConfig(WxConfigInfoRequest param){ |
| | | log.info("【海康根据配置微信公众号编号查询微信公众号信息】================开始===="+JSONObject.toJSONString(param)); |
| | | try { |
| | | String res = HKTools.getWxConfig(toMap(param)); |
| | | TypeReference typeReference = |
| | | new TypeReference<BaseResponse<BaseListPageResponse<WxConfigInfoResponse>>>(){}; |
| | | BaseResponse<BaseListPageResponse<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<FireDeviceStatusListResponse>> fireDeviceStatusSearch(FireDeviceStatuslListRequest param){ |
| | | log.info("【海康查询消防设备部件状态】================开始===="+JSONObject.toJSONString(param)); |
| | | try { |
| | | String res = HKTools.fireDeviceStatusSearch(toMap(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(toMap(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(toMap(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<FireDeviceListResponse>> fireDeviceSearch(FireDeviceListRequest param){ |
| | | log.info("【海康询消防设备列表】================开始===="+JSONObject.toJSONString(param)); |
| | | try { |
| | | String res = HKTools.fireDeviceSearch(toMap(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 |
| | | */ |