k94314517
2024-12-18 36e1ec74d47e84cd1b31d7d4bc2319fd14ab1ea8
server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/HKTools.java
@@ -312,6 +312,34 @@
   public static String getTodoListPage(Map<String, String> body)  throws  Exception{
      return startDoGetStringArtemis(HKConstants.InterfacePath.getTodoListPage,body);
   }
   /**
    *消防看板-4温湿度数据
    * @param body
    * @return
    */
   public static String temperatureHumidityDataStatistic(String body) {
      return startDoPostStringArtemisAdmin(HKConstants.InterfacePath.temperatureHumidityDataStatistic,body);
   }
   /**
    *消防看板-4获取区域用量排名-能耗看板
    * @param body
    * @return
    */
   public static String regionDataRanking(String body) {
      return startDoPostStringArtemis(HKConstants.InterfacePath.regionDataRanking,body);
   }
   /**
    *消防看板-4根据时间和时间维度获取园区能耗数据
    * @param body
    * @return
    */
   public static String energyTotal(String body) {
      return startDoPostStringArtemis(HKConstants.InterfacePath.energyTotal,body);
   }
   /**
    *   获取门禁点列表
    * @param body
@@ -387,11 +415,29 @@
      saveInterfaceLog(body,result,path,pathStr[1]);
      return result;
   }
   public static String startDoPostStringArtemisAdmin(String[] pathStr,String body){
      Map<String, String> path = getPath(pathStr[0]);
      Map<String, String> header = new HashMap<>();
      header.put("userId", "admin");
      String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, "application/json", header);// post请求application/json类型参数
      saveInterfaceLog(body,result,path,pathStr[1]);
      return result;
   }
   public static String startDoGetStringArtemis(String[] pathStr,Map<String,String> body ){
      Map<String, String> path = getPath(pathStr[0]);
      Map<String, String> header = new HashMap<>();
      header.put("tagId", UUID.randomUUID().toString().replace("-", ""));
      String result = ArtemisHttpUtil.doGetArtemis(path, body, null, null,  header);
      saveInterfaceLog(JSONObject.toJSONString(body),result,path,pathStr[1]);
      return result;
   }
   public static String startDoGetStringArtemisJson(String[] pathStr,Map<String,String> body ){
      Map<String, String> path = getPath(pathStr[0]);
      Map<String, String> header = new HashMap<>();
      String result = ArtemisHttpUtil.doGetArtemis(path, body, null, "application/json",  header);
      saveInterfaceLog(JSONObject.toJSONString(body),result,path,pathStr[1]);
      return result;
   }
@@ -402,15 +448,15 @@
      String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, "application/json", header);// post请求application/json类型参数
      saveInterfaceLog(body,result,path,pathStr[1]);
      return result;
   }
   public static String startDoPostStringArtemis(String[] pathStr,Map<String, String> querys,Map<String, String> header,String body){
      Map<String, String> path = getPath(pathStr[0]);
      header.put("tagId", UUID.randomUUID().toString().replace("-", ""));
      String result = ArtemisHttpUtil.doPostStringArtemis(path, body, querys, null, "application/json", header);// post请求application/json类型参数
      saveInterfaceLog(body,result,path,pathStr[1]);
      return result;
   }
   /**
    *   签离访客预约
@@ -574,10 +620,13 @@
    *   根据微信公众号信息获取AccessToken
    * @return
    */
   public static String wxAccessToken(String configId,String tagId) {
      String[] wxAccessToken= HKConstants.InterfacePath.wxAccessToken;
      wxAccessToken[0] = HKConstants.InterfacePath.wxAccessToken+"?tagId="+tagId+"&configId"+configId;
      return startDoPostStringArtemis(wxAccessToken,"");
   public static String wxAccessToken(HashMap<String,String> params ) {
//      String[] wxAccessToken= new String[2];
//      String url = HKConstants.InterfacePath.wxAccessToken[0]+"?tagId="+tagId+"&configId="+configId;
//      String t = HKConstants.InterfacePath.wxAccessToken[1];
//      wxAccessToken[0] = url;
//      wxAccessToken[1] = t;
      return startDoGetStringArtemisJson(HKConstants.InterfacePath.wxAccessToken,params);
   }
   /**
    *   根据配置微信公众号编号查询微信公众号信息
@@ -783,6 +832,73 @@
      return startDoPostStringArtemis(HKConstants.InterfacePath.energyTrend,body);
   }
   /**
    * 消防维保统计
    * @param body
    * @return
    */
   public static String fireStatistic(String body) {
      return startDoPostStringArtemis(HKConstants.InterfacePath.fireStatistic,body);
   }
   /**
    * 消防维保每月新增统计
    * @param body
    * @return
    */
   public static String fireStatisticMonth(String body) {
      return startDoPostStringArtemis(HKConstants.InterfacePath.fireStatisticMonth,body);
   }
   /**
    * 消防看板-消防设备在离线1
    * @param body
    * @return
    */
   public static String getFireDevStatusTotal(String body) {
      return startDoPostStringArtemis(HKConstants.InterfacePath.getFireDevStatusTotal,body);
   }
   /**
    * 消防看板-各类型设备在线率2
    * @param body
    * @return
    */
   public static String getFireDevStatusList(String body) {
      return startDoPostStringArtemis(HKConstants.InterfacePath.getFireDevStatusList,body);
   }
   /**
    *消防看板-4报警信息统计
    * @param body
    * @return
    */
   public static String findAlarmBaseDataStatistic(String body) {
      return startDoPostStringArtemis(HKConstants.InterfacePath.findAlarmBaseDataStatistic,body);
   }
   /**
    *安防看板-- b
    * @param body
    * @return
    */
   public static String findHomeAlarmInfoPage(String body) {
      return startDoPostStringArtemis(HKConstants.InterfacePath.findHomeAlarmInfoPage,body);
   }
   /**
    *保存用户及openId绑定信息微信公众号
    * @param body
    * @return
    */
   public static String userOpenidSave(String body) {
      Map<String,String> header = new HashMap<>();
      header.put("userId","admin");
      return startDoPostStringArtemis(HKConstants.InterfacePath.userOpenidSave,null,header,body);
   }
   /**
    *分页查询设备监测历史数据
    * @param body
    * @return
    */
   public static String minitorDataSearch(String body) {
      return startDoPostStringArtemis(HKConstants.InterfacePath.minitorDataSearch,body);
   }
   /**
    * 统计园区总体的安防设备数量,在线数、在线率、离线数、离线率
    * @param body
    * @return
@@ -938,9 +1054,9 @@
      return startDoPostStringArtemis(HKConstants.InterfacePath.applyST,body);
   }
   public static String getMenuUrl(String menuId, String token) {
   public static String getMenuUrl(String componentId,String menuId, String token) {
      String url = HKConstants.InterfacePath.goMenuUrl[0];
      url = url.replace("${menuId}", menuId).replace("${token}",token);
      url = url.replace("${componentId}",componentId).replace("${menuId}", menuId).replace("${token}",token);
      return  url;
   }
}