k94314517
2024-12-13 ad86a0aa39f20e1b8bb511acd6961c7ec59f9251
server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/service/HKService.java
@@ -888,7 +888,10 @@
    public  static  BaseResponse<String>   wxAccessToken(String configId,String tagId){
        log.info("【海康根据微信公众号信息获取AccessToken】================开始====configId:"+configId+" && tagId:"+tagId);
        try {
            String res = HKTools.wxAccessToken(configId,tagId);
            HashMap<String,String> params = new HashMap<>();
            params.put("tagId",tagId);
            params.put("configId",configId);
            String res = HKTools.wxAccessToken(params);
            TypeReference typeReference =
                    new TypeReference<BaseResponse<String>>(){};
            BaseResponse<String>   result = JSONObject.parseObject(res, typeReference.getType());
@@ -935,6 +938,26 @@
        }
        return  null;
    }
    /**
     *消防看板-4温湿度统计
     * @return
     */
    public  static  BaseResponse<BaseListPageResponse<TemperatureHumidityDataResponse>>  temperatureHumidityDataStatistic(TemperatureHumidityDataRequest param){
        log.info("【海康消防看板-4温湿度统计】================开始===="+JSONObject.toJSONString(param));
        try {
            String res = HKTools.temperatureHumidityDataStatistic(JSONObject.toJSONString(param));
            TypeReference typeReference =
                    new TypeReference< BaseResponse<BaseListPageResponse<TemperatureHumidityDataResponse> >>(){};
            BaseResponse<BaseListPageResponse<TemperatureHumidityDataResponse>>   result = JSONObject.parseObject(res, typeReference.getType());
            logResult(result,"海康消防看板-4温湿度统计");
            return  result;
        }catch (Exception e){
            log.error("【海康消防看板-4温湿度统计】================失败====:\n"+ e.getMessage());
        }
        return  null;
    }
    /**
     *分页查询消防设备部件状态
@@ -1086,6 +1109,7 @@
     * @return
     */
    public  static  String   getMenuUrl(Integer type,String token){
        String componentId = HKConstants.MenuPageId.componentIds[0];
        String menuId = HKConstants.MenuPageId.afzx;
        if(Constants.equalsInteger(type,Constants.ONE)){
            menuId = HKConstants.MenuPageId.xkzx;
@@ -1095,10 +1119,13 @@
            menuId = HKConstants.MenuPageId.jsc;
        }else  if(Constants.equalsInteger(type,Constants.FOUR)){
            menuId = HKConstants.MenuPageId.kqgzt;
        }else  if(Constants.equalsInteger(type,Constants.FIVE)){
            componentId = HKConstants.MenuPageId.componentIds[1];
            menuId = HKConstants.MenuPageId.kqdbcl;
        }
        log.info("【海康获取工作台菜单免密登陆调整地址】================开始====menuId:"+menuId+"==token:"+token);
        try {
            String res = HKTools.getMenuUrl(menuId,token);
            String res = HKTools.getMenuUrl(componentId,menuId,token);
            return  res;
        }catch (Exception e){
            log.error("【海康获取工作台菜单免密登陆调整地址】================失败====:\n"+ e.getMessage());
@@ -1404,7 +1431,9 @@
        Class<?> clazz = obj.getClass();
        for (Field field : clazz.getDeclaredFields()) {
            field.setAccessible(true); // 使得私有字段也可以访问
            map.put(field.getName(), (String) field.get(obj));
            if(field.get(obj)!=null){
                map.put(field.getName(), String.valueOf( field.get(obj)));
            }
        }
        return map;
    }
@@ -1538,6 +1567,60 @@
            return  result;
        }catch (Exception e){
            log.error("【海康安防看板-今日告警事件-根据eventType字段3】================失败====:\n"+ e.getMessage());
        }
        return  null;
    }
    /**
     *安防看板-- 分页查询未处理报警信息6
     * @return
     */
    public  static  BaseResponse<BaseListPageResponse<FindHomeAlarmInfoPageResponse>>   findHomeAlarmInfoPage(FindHomeAlarmInfoPageRequest param){
        log.info("【海康安防看板-- 分页查询未处理报警信息6】================开始===="+JSONObject.toJSONString(param));
        try {
            String res = HKTools.findHomeAlarmInfoPage(JSONObject.toJSONString(param));
            TypeReference typeReference =
                    new TypeReference< BaseResponse<BaseListPageResponse<FindHomeAlarmInfoPageResponse>> >(){};
            BaseResponse<BaseListPageResponse<FindHomeAlarmInfoPageResponse>>   result = JSONObject.parseObject(res, typeReference.getType());
            logResult(result,"海康安防看板-- 分页查询未处理报警信息6");
            return  result;
        }catch (Exception e){
            log.error("【海康安防看板-- 分页查询未处理报警信息6】================失败====:\n"+ e.getMessage());
        }
        return  null;
    }
    /**
     *保存用户及openId绑定信息微信公众号
     * @return
     */
    public  static  BaseResponse<Integer>   userOpenidSave(UserOpenidSaveRequest param){
        log.info("【海康保存用户及openId绑定信息微信公众号】================开始===="+JSONObject.toJSONString(param));
        try {
            String res = HKTools.userOpenidSave(JSONObject.toJSONString(param));
            TypeReference typeReference =
                    new TypeReference< BaseResponse<Integer>>(){};
            BaseResponse<Integer>   result = JSONObject.parseObject(res, typeReference.getType());
            logResult(result,"海康保存用户及openId绑定信息微信公众号");
            return  result;
        }catch (Exception e){
            log.error("【海康保存用户及openId绑定信息微信公众号】================失败====:\n"+ e.getMessage());
        }
        return  null;
    }
    /**
     *分页查询设备监测历史数据
     * @return
     */
    public  static  BaseResponse<BaseListPageResponse<MonitorDataSearchResponse>>   minitorDataSearch(MinitorDataSearchRequest param){
        log.info("【海康分页查询设备监测历史数据】================开始===="+JSONObject.toJSONString(param));
        try {
            String res = HKTools.minitorDataSearch(JSONObject.toJSONString(param));
            TypeReference typeReference =
                    new TypeReference< BaseResponse<BaseListPageResponse<MonitorDataSearchResponse>> >(){};
            BaseResponse<BaseListPageResponse<MonitorDataSearchResponse>>   result = JSONObject.parseObject(res, typeReference.getType());
            logResult(result,"海康分页查询设备监测历史数据");
            return  result;
        }catch (Exception e){
            log.error("【海康分页查询设备监测历史数据】================失败====:\n"+ e.getMessage());
        }
        return  null;
    }
@@ -1713,6 +1796,98 @@
        return  null;
    }
    /**
     *消防维保统计
     * @return
     */
    public  static  BaseResponse<FireStatisticResponse>   fireStatistic(FireStatisticRequest param){
        log.info("【海康消防维保统计】================开始===="+JSONObject.toJSONString(param));
        try {
            String res = HKTools.fireStatistic(JSONObject.toJSONString(param));
            TypeReference typeReference =
                    new TypeReference< BaseResponse<FireStatisticResponse>>(){};
            BaseResponse<FireStatisticResponse>   result = JSONObject.parseObject(res, typeReference.getType());
            logResult(result,"海康消防维保统计");
            return  result;
        }catch (Exception e){
            log.error("【海康消防维保统计】================失败====:\n"+ e.getMessage());
        }
        return  null;
    }
    /**
     *本月新增维保设备数
     * api_fire_statistic_month
     * @return
     */
    public  static  BaseResponse<FireStatisticResponse>   fireStatisticMonth(FireStatisticRequest param){
        log.info("【海康消防维保统计每月新增】================开始===="+JSONObject.toJSONString(param));
        try {
            String res = HKTools.fireStatisticMonth(JSONObject.toJSONString(param));
            TypeReference typeReference =
                    new TypeReference< BaseResponse<FireStatisticResponse>>(){};
            BaseResponse<FireStatisticResponse>   result = JSONObject.parseObject(res, typeReference.getType());
            logResult(result,"海康消防维保统计每月新增");
            return  result;
        }catch (Exception e){
            log.error("【海康消防维保统计每月新增】================失败====:\n"+ e.getMessage());
        }
        return  null;
    }
    /**
     *消防看板-消防设备在离线1
     * @return
     */
    public  static  BaseResponse<List<SecureDevStatusTotalResponse> >  getFireDevStatusTotal(FireDevStatusTotalRequest param){
        log.info("【海康消防看板-消防设备在离线1】================开始===="+JSONObject.toJSONString(param));
        try {
            String res = HKTools.getFireDevStatusTotal(JSONObject.toJSONString(param));
            TypeReference typeReference =
                    new TypeReference< BaseResponse<List<SecureDevStatusTotalResponse> >>(){};
            BaseResponse<List<SecureDevStatusTotalResponse> >   result = JSONObject.parseObject(res, typeReference.getType());
            logResult(result,"海康消防看板-消防设备在离线1");
            return  result;
        }catch (Exception e){
            log.error("【海康消防看板-消防设备在离线1】================失败====:\n"+ e.getMessage());
        }
        return  null;
    }
    /**
     *消防看板-各类型设备在线率2
     * @return
     */
    public  static  BaseResponse<List<FireDevStatusListResponse> >  getFireDevStatusList(FireDevStatusTotalRequest param){
        log.info("【海康消防看板-各类型设备在线率2】================开始===="+JSONObject.toJSONString(param));
        try {
            String res = HKTools.getFireDevStatusList(JSONObject.toJSONString(param));
            TypeReference typeReference =
                    new TypeReference< BaseResponse<List<FireDevStatusListResponse> >>(){};
            BaseResponse<List<FireDevStatusListResponse> >   result = JSONObject.parseObject(res, typeReference.getType());
            logResult(result,"海康消防看板-各类型设备在线率2");
            return  result;
        }catch (Exception e){
            log.error("【海康消防看板-各类型设备在线率2】================失败====:\n"+ e.getMessage());
        }
        return  null;
    }
    /**
     *消防看板-4报警信息统计
     * @return
     */
    public  static  BaseResponse<FindAlarmBaseDataStatisticResponse>  findAlarmBaseDataStatistic(FindAlarmBaseDataStatisticRequest param){
        log.info("【海康消防看板-4报警信息统计】================开始===="+JSONObject.toJSONString(param));
        try {
            String res = HKTools.findAlarmBaseDataStatistic(JSONObject.toJSONString(param));
            TypeReference typeReference =
                    new TypeReference< BaseResponse<FindAlarmBaseDataStatisticResponse >>(){};
            BaseResponse<FindAlarmBaseDataStatisticResponse >   result = JSONObject.parseObject(res, typeReference.getType());
            logResult(result,"海康消防看板-4报警信息统计");
            return  result;
        }catch (Exception e){
            log.error("【海康消防看板-4报警信息统计】================失败====:\n"+ e.getMessage());
        }
        return  null;
    }
    /**
     *根据用户标识获取客户端TGC接口
     * @return
     */