jiangping
2024-12-11 eb49564ab17c6695d8928d5a63a57c58b3cfd79c
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());
@@ -1086,6 +1089,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 +1099,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 +1411,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;
    }
@@ -1560,6 +1569,24 @@
        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
     */