doum
2025-09-11 7298d5354963a88643a543b51b90192dc9fc934c
server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/HKTools.java
@@ -1,9 +1,14 @@
package com.doumee.core.haikang.model;
import com.alibaba.fastjson.JSONObject;
import com.doumee.core.haikang.model.param.BaseResponse;
import com.doumee.core.haikang.model.param.request.CarPictureRequest;
import com.doumee.core.haikang.model.param.request.FacePictureCheckRequest;
import com.doumee.core.haikang.model.param.request.ParkReservationAddRequest;
import com.doumee.core.haikang.model.param.request.VisitAppointmentCancelRequest;
import com.doumee.core.haikang.service.HKService;
import com.doumee.core.utils.Constants;
import com.doumee.core.utils.DateUtil;
import com.doumee.dao.business.model.InterfaceLog;
import com.doumee.service.business.InterfaceLogService;
import com.hikvision.artemis.sdk.ArtemisHttpUtil;
@@ -34,6 +39,12 @@
      ArtemisConfig.appKey = "23154099";
      ArtemisConfig.appSecret = "88wFsg3xfn7o8QMsWEO2";
      HKConstants.https = "https://";
      VisitAppointmentCancelRequest request = new VisitAppointmentCancelRequest();
      request.setAppointRecordIds(new String[]{"皖A90LL0"});
      String response =  iccmCancelAppointment(JSONObject.toJSONString(request));
      System.out.println(response);
   /*   CarPictureRequest param = new CarPictureRequest();
      param.setPicUri( "HKIMG=/pic?0dd400=4c40ip-feo831-933*9o4=3=2109*2l0001893117*0t7=6*2ps==014b*=787d*069d70361-95754d-9*l108od0b192=001");
      param.setAswSyscode("3fa3e5e3-db3e-41ba-97fc-39c948778dfe");
@@ -55,9 +66,9 @@
         throw new RuntimeException(e);
      }*/
      FacePictureCheckRequest param = new FacePictureCheckRequest();
      param.setFacePicUrl("http://10.50.250.253:8088/file/member/20241016/d0cded86-a55d-43be-bc01-4f628a1400cf.jpg");
      System.out.println(facePictureCheck(JSONObject.toJSONString(param)));
//      FacePictureCheckRequest param = new FacePictureCheckRequest();
//      param.setFacePicUrl("http://10.50.250.253:8088/file/member/20241016/d0cded86-a55d-43be-bc01-4f628a1400cf.jpg");
//      System.out.println(facePictureCheck(JSONObject.toJSONString(param)));
   }
   public static InterfaceLogService interfaceLogService = null;
@@ -312,6 +323,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 +426,35 @@
      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 startDoGetStringArtemis(String[] pathStr,Map<String,String> querys ,Map<String, String> header ){
      Map<String, String> path = getPath(pathStr[0]);
      String result = ArtemisHttpUtil.doGetArtemis(path, querys, null, null,  header);
      saveInterfaceLog(JSONObject.toJSONString(querys),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 +465,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;
   }
   /**
    *   签离访客预约
@@ -419,6 +482,22 @@
    */
   public static String visitOut(String body) {
      return startDoPostStringArtemis(HKConstants.InterfacePath.visitOut,body);
   }
   /**
    *   iccm签离访客预约
    * @param body
    * @return
    */
   public static String iccmSignoff(String body) {
      return startDoPostStringArtemis(HKConstants.InterfacePath.iccmSignoff,body);
   }
   /**
    *   iccm取消访客预约
    * @param body
    * @return
    */
   public static String iccmCancelAppointment(String body) {
      return startDoPostStringArtemis(HKConstants.InterfacePath.iccmCancelAppointment,body);
   }
   /**
    *   访客权限组
@@ -574,10 +653,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);
   }
   /**
    *   根据配置微信公众号编号查询微信公众号信息
@@ -764,7 +846,9 @@
    * @return
    */
   public static String ruleEventSearch(String body) {
      return startDoPostStringArtemis(HKConstants.InterfacePath.ruleEventSearch,body);
      Map<String,String> header = new HashMap<>();
      header.put("User-Id","admin");
      return startDoPostStringArtemis(HKConstants.InterfacePath.ruleEventSearch,null,header,body);
   }
   /**
    * 安防看板-园区安防设备-各类型设备状态数据列表
@@ -814,6 +898,23 @@
   public static String getFireDevStatusList(String body) {
      return startDoPostStringArtemis(HKConstants.InterfacePath.getFireDevStatusList,body);
   }
   /**
    * 分页查询设备的以及下属传感器数据的状态统计
    * @param body
    * @return
    */
   public static String findDeviceStatistics(String body) {
      return startDoPostStringArtemis(HKConstants.InterfacePath.findDeviceStatistics,body);
   }
   /**
    * 【海康消防看板】根据条件查询目录下有权限的资源列表
    * @param body
    * @return
    */
   public static String resourcesByParams(String body) {
      return startDoPostStringArtemis(HKConstants.InterfacePath.resourcesByParams,body);
   }
   /**
    *消防看板-4报警信息统计
    * @param body
@@ -822,8 +923,9 @@
   public static String findAlarmBaseDataStatistic(String body) {
      return startDoPostStringArtemis(HKConstants.InterfacePath.findAlarmBaseDataStatistic,body);
   }
   /**
    *安防看板-- 分页查询未处理报警信息6
    *安防看板-- b
    * @param body
    * @return
    */
@@ -831,12 +933,32 @@
      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);
   }
   /**
    *通过openId或userName等删除绑定信息
    * @param param
    * @return
    */
   public static String userOpenidDel(Map<String,String>  param) {
      Map<String,String> header = new HashMap<>();
      header.put("userId","admin");
      return startDoGetStringArtemis(HKConstants.InterfacePath.userOpenidDel,param,header);
   }
   /**
    *分页查询设备监测历史数据
    * @param body
    * @return
    */
   public static String minitorDataSearch(String body) {
      return startDoPostStringArtemis(HKConstants.InterfacePath.minitorDataSearch,body);
      return startDoPostStringArtemis(HKConstants.InterfacePath.minitorDataSearchV1,body);
   }
   /**
    * 统计园区总体的安防设备数量,在线数、在线率、离线数、离线率