| | |
| | | TypeReference typeReference = |
| | | new TypeReference< BaseResponse<BaseListPageResponse<PageCameraInfoResponse>> >(){}; |
| | | BaseResponse<BaseListPageResponse<PageCameraInfoResponse>> result = JSONObject.parseObject(res, typeReference.getType()); |
| | | logResult(result,"海康分页获取监控点资源"); |
| | | // logResult(result,"海康分页获取监控点资源"); |
| | | return result; |
| | | }catch (Exception e){ |
| | | log.error("【海康分页获取监控点资源】================失败====:\n"+ e.getMessage()); |
| | |
| | | *安防看板-今日告警事件-根据eventType字段3 |
| | | * @return |
| | | */ |
| | | public static BaseResponse< RuleEventSearchResponse> ruleEventSearch(RuleEventSearchRequest param){ |
| | | public static BaseResponse<BaseListPageResponse<RuleEventSearchDataResponse>> ruleEventSearch(RuleEventSearchRequest param){ |
| | | log.info("【海康安防看板-今日告警事件-根据eventType字段3】================开始===="+JSONObject.toJSONString(param)); |
| | | try { |
| | | String res = HKTools.ruleEventSearch(JSONObject.toJSONString(param)); |
| | | TypeReference typeReference = |
| | | new TypeReference< BaseResponse<RuleEventSearchResponse> >(){}; |
| | | BaseResponse<RuleEventSearchResponse> result = JSONObject.parseObject(res, typeReference.getType()); |
| | | new TypeReference< BaseResponse<BaseListPageResponse<RuleEventSearchDataResponse>> >(){}; |
| | | BaseResponse<BaseListPageResponse<RuleEventSearchDataResponse>> result = JSONObject.parseObject(res, typeReference.getType()); |
| | | logResult(result,"海康安防看板-今日告警事件-根据eventType字段3"); |
| | | return result; |
| | | }catch (Exception e){ |
| | | log.error("【海康安防看板-今日告警事件-根据eventType字段3】================失败====:\n"+ e.getMessage()); |
| | | } |
| | | return null; |
| | | } |
| | | /** |
| | | *统计统安防看板--园区实时车数量4 |
| | | * @return |
| | | */ |
| | | public static BaseResponse<ParkingStatisticResponse> getParkingStatistics(){ |
| | | log.info("【海康安防看板--园区实时车数量4】================开始===="); |
| | | try { |
| | | String res = HKTools.getParkingStatistics(); |
| | | TypeReference typeReference = |
| | | new TypeReference< BaseResponse<ParkingStatisticResponse>>(){}; |
| | | BaseResponse<ParkingStatisticResponse> result = JSONObject.parseObject(res, typeReference.getType()); |
| | | logResult(result,"海康安防看板--园区实时车数量4"); |
| | | return result; |
| | | }catch (Exception e){ |
| | | log.error("【海康安防看板--园区实时车数量4】================失败====:\n"+ e.getMessage()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 能耗看板-3.获取各区域用能及总能耗 |
| | | * @param powerType 能源类型 电-1 水-2 气-3 热-4 |
| | | * @return |
| | | */ |
| | | public static BaseResponse<RegionEnergyListResponse> regionEnergyList(String powerType){ |
| | | log.info("【海康能耗看板-3.获取各区域用能及总能耗】================开始===="); |
| | | try { |
| | | Map<String,String> map = new HashMap<>(); |
| | | map.put("powerType",powerType); |
| | | String res = HKTools.regionEnergyList(map); |
| | | TypeReference typeReference = |
| | | new TypeReference< BaseResponse<RegionEnergyListResponse>>(){}; |
| | | BaseResponse<RegionEnergyListResponse> result = JSONObject.parseObject(res, typeReference.getType()); |
| | | logResult(result,"【海康能耗看板-3.获取各区域用能及总能耗】"); |
| | | return result; |
| | | }catch (Exception e){ |
| | | log.error("【海康能耗看板-3.获取各区域用能及总能耗】================失败====:\n"+ e.getMessage()); |
| | | } |
| | | return null; |
| | | } |
| | | /** |
| | | * 能耗看板-4.获取上月用能费用,一天刷新,凌晨某个点刷 |
| | | * @param powerType 能源类型 电-1 水-2 气-3 热-4 |
| | | * @return |
| | | */ |
| | | public static BaseResponse<LastMonthFeeByMeterTypeResponse> lastMonthFeeByMeterType(String powerType){ |
| | | log.info("【海康能耗看板-4.获取上月用能费用,一天刷新,凌晨某个点刷】================开始===="); |
| | | try { |
| | | Map<String,String> map = new HashMap<>(); |
| | | map.put("powerType",powerType); |
| | | String res = HKTools.lastMonthFeeByMeterType(map); |
| | | TypeReference typeReference = new TypeReference< BaseResponse<LastMonthFeeByMeterTypeResponse>>(){}; |
| | | BaseResponse<LastMonthFeeByMeterTypeResponse> result = JSONObject.parseObject(res, typeReference.getType()); |
| | | logResult(result,"【海康能耗看板-4.获取上月用能费用,一天刷新,凌晨某个点刷】"); |
| | | return result; |
| | | }catch (Exception e){ |
| | | log.error("【海康能耗看板-4.获取上月用能费用,一天刷新,凌晨某个点刷】================失败====:\n"+ e.getMessage()); |
| | | } |
| | | return null; |
| | | } |
| | | /** |
| | | * 海康能耗看板-5.园区实时负荷曲线 |
| | | * @return |
| | | */ |
| | | public static BaseResponse<List<EnergyTodayLoadDataResponse>> energyTodayLoadData(){ |
| | | log.info("【海康能耗看板-5.园区实时负荷曲线】================开始===="); |
| | | try { |
| | | String res = HKTools.energyTodayLoadData(); |
| | | TypeReference typeReference = new TypeReference< BaseResponse<List<EnergyTodayLoadDataResponse>>>(){}; |
| | | BaseResponse<List<EnergyTodayLoadDataResponse>> result = JSONObject.parseObject(res, typeReference.getType()); |
| | | logResult(result,"【海康能耗看板-5.园区实时负荷曲线】"); |
| | | return result; |
| | | }catch (Exception e){ |
| | | log.error("【海康能耗看板-5.园区实时负荷曲线】================失败====:\n"+ e.getMessage()); |
| | | } |
| | | return null; |
| | | } |
| | | /** |
| | | * 能耗看板-2.获取区域用能前N位 |
| | | * @param param |
| | | * @return |
| | | */ |
| | | public static BaseResponse<List<RegionTopPowerResponse>> regionTopPower(RegionTopPowerRequest param){ |
| | | log.info("【海康能耗看板-2.获取区域用能前N位】================开始===="); |
| | | try { |
| | | String res = HKTools.regionTopPower(toMap(param)); |
| | | TypeReference typeReference = |
| | | new TypeReference< BaseResponse<List<RegionTopPowerResponse>>>(){}; |
| | | BaseResponse<List<RegionTopPowerResponse>> result = JSONObject.parseObject(res, typeReference.getType()); |
| | | logResult(result,"海康能耗看板-2.获取区域用能前N位"); |
| | | return result; |
| | | }catch (Exception e){ |
| | | log.error("【海康能耗看板-2.获取区域用能前N位】================失败====:\n"+ e.getMessage()); |
| | | } |
| | | return null; |
| | | } |
| | | /** |
| | | * 能耗看板-1.获取本月用能总量-自然月 |
| | | * @param powerType 能源类型 电-1 水-2 气-3 热-4 |
| | | * @return |
| | | */ |
| | | public static BaseResponse<MonthDataByMeterTypeResponse> getCurrentMonthDataByMeterType(String powerType){ |
| | | log.info("【能耗看板-1.获取本月用能总量-自然月】================开始===="); |
| | | try { |
| | | Map<String,String> map = new HashMap<>(); |
| | | map.put("powerType",powerType); |
| | | String res = HKTools.getCurrentMonthDataByMeterType(map); |
| | | TypeReference typeReference = |
| | | new TypeReference< BaseResponse<MonthDataByMeterTypeResponse>>(){}; |
| | | BaseResponse<MonthDataByMeterTypeResponse> result = JSONObject.parseObject(res, typeReference.getType()); |
| | | logResult(result,"能耗看板-1.获取本月用能总量-自然月"); |
| | | return result; |
| | | }catch (Exception e){ |
| | | log.error("【能耗看板-1.获取本月用能总量-自然月】================失败====:\n"+ e.getMessage()); |
| | | } |
| | | return null; |
| | | } |
| | |
| | | return null; |
| | | } |
| | | /** |
| | | *能耗看板-6按月查询近12个月的用电总量数据 |
| | | * @return |
| | | */ |
| | | public static BaseResponse<EnergyTrendResponse> energyTrend(EnergyTrendRequest param){ |
| | | log.info("【海康能耗看板-6按月查询近12个月的用电总量数据】================开始===="+JSONObject.toJSONString(param)); |
| | | try { |
| | | String res = HKTools.energyTrend(JSONObject.toJSONString(param)); |
| | | TypeReference typeReference = |
| | | new TypeReference< BaseResponse<EnergyTrendResponse>>(){}; |
| | | BaseResponse<EnergyTrendResponse> result = JSONObject.parseObject(res, typeReference.getType()); |
| | | logResult(result,"海康能耗看板-6按月查询近12个月的用电总量数据"); |
| | | return result; |
| | | }catch (Exception e){ |
| | | log.error("【海康能耗看板-6按月查询近12个月的用电总量数据】================失败====:\n"+ e.getMessage()); |
| | | } |
| | | return null; |
| | | } |
| | | /** |
| | | *根据用户标识获取客户端TGC接口 |
| | | * @return |
| | | */ |