jiangping
2025-05-07 476cd8d1cb410f90d1a6fcafbf84f1bf7d9da403
server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/service/HKService.java
@@ -11,6 +11,7 @@
import com.doumee.core.haikang.model.param.request.*;
import com.doumee.core.haikang.model.param.respose.*;
import com.doumee.core.utils.Constants;
import com.doumee.core.utils.DateUtil;
import com.hikvision.artemis.sdk.config.ArtemisConfig;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
@@ -19,12 +20,11 @@
import java.io.InputStream;
import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
@Slf4j
public class HKService {
    private static String[] args;
    private Logger logger = LoggerFactory.getLogger(HKService.class);
    /**
     * 获取根组织数据
@@ -361,6 +361,8 @@
        }
        return  null;
    }
    /**
     *车位预约
     * @return
@@ -379,6 +381,7 @@
        }
        return  null;
    }
    /**
     *车位取消预约
     * @return
@@ -466,6 +469,42 @@
            return  result;
        }catch (Exception e){
            log.error("【海康访客预约签离】================失败====:\n"+ e.getMessage());
        }
        return  null;
    }
    /**
     *iccm访客预约签离
     * @return
     */
    public  static  BaseResponse  iccmSignoff(VisitAppointmentOutRequest param){
        log.info("【海康iccm访客预约签离】================开始===="+JSONObject.toJSONString(param));
        try {
            String res = HKTools.iccmSignoff(JSONObject.toJSONString(param));
            TypeReference typeReference =
                    new TypeReference< BaseResponse>(){};
            BaseResponse  result = JSONObject.parseObject(res, typeReference.getType());
           logResult(result,"海康iccm访客预约签离");
            return  result;
        }catch (Exception e){
            log.error("【海康iccm访客预约签离】================失败====:\n"+ e.getMessage());
        }
        return  null;
    }
    /**
     *iccm访客预约取消
     * @return
     */
    public  static  BaseResponse  iccmCancelAppointment(VisitAppointmentCancelRequest param){
        log.info("【海康iccm访客预约取消】================开始===="+JSONObject.toJSONString(param));
        try {
            String res = HKTools.iccmCancelAppointment(JSONObject.toJSONString(param));
            TypeReference typeReference =
                    new TypeReference< BaseResponse>(){};
            BaseResponse  result = JSONObject.parseObject(res, typeReference.getType());
           logResult(result,"海康iccm访客预约取消");
            return  result;
        }catch (Exception e){
            log.error("【海康iccm访客预约取消】================失败====:\n"+ e.getMessage());
        }
        return  null;
    }
@@ -1161,9 +1200,15 @@
        }else  if(Constants.equalsInteger(type,Constants.FIVE)){
            componentId = HKConstants.MenuPageId.componentIds[1];
            menuId = HKConstants.MenuPageId.kqdbcl;
        }else  if(Constants.equalsInteger(type,Constants.SIX)){
            //https://10.50.250.253:443/xauthplus-plugin/thirdLogin?type=third&componentId=cems&componentMenuId=010200
            return "https://10.50.250.253:443/xauthplus-plugin/thirdLogin?type=third&service=https://10.50.250.253:443/cems/config/generalCard&token="+token;
//            componentId = HKConstants.MenuPageId.componentIds[2];
//            menuId = HKConstants.MenuPageId.xfzx;
        }
        log.info("【海康获取工作台菜单免密登陆调整地址】================开始====menuId:"+menuId+"==token:"+token);
        try {
            ///xauthplus-plugin/thirdLogin?type=third&componentId=${componentId}&componentMenuId=${menuId}&token=${token}
            String res = HKTools.getMenuUrl(componentId,menuId,token);
            return  res;
        }catch (Exception e){
@@ -1646,6 +1691,24 @@
        return  null;
    }
    /**
     *通过openId或userName等删除绑定信息
     * @return
     */
    public  static  BaseResponse  userOpenidDel(UserOpenidSaveRequest param){
        log.info("【海康通过openId或userName等删除绑定信息】================开始===="+JSONObject.toJSONString(param));
        try {
            String res = HKTools.userOpenidDel(toMap(param));
            TypeReference typeReference =
                    new TypeReference< BaseResponse >(){};
            BaseResponse<Integer>   result = JSONObject.parseObject(res, typeReference.getType());
            logResult(result,"海康通过openId或userName等删除绑定信息");
            return  result;
        }catch (Exception e){
            log.error("【海康通过openId或userName等删除绑定信息】================失败====:\n"+ e.getMessage());
        }
        return  null;
    }
    /**
     *分页查询设备监测历史数据
     * @return
     */
@@ -1908,6 +1971,24 @@
        return  null;
    }
    /**
     *分页查询设备的以及下属传感器数据的状态统计
     * @return
     */
    public  static  BaseResponse<List<FindDeviceStatisticsResponse> >  findDeviceStatistics(FindDeviceStatisticsRequest param){
        log.info("【分页查询设备的以及下属传感器数据的状态统计】================开始===="+JSONObject.toJSONString(param));
        try {
            String res = HKTools.findDeviceStatistics(JSONObject.toJSONString(param));
            TypeReference typeReference =
                    new TypeReference< BaseResponse<List<FindDeviceStatisticsResponse> >>(){};
            BaseResponse<List<FindDeviceStatisticsResponse> >   result = JSONObject.parseObject(res, typeReference.getType());
            logResult(result,"分页查询设备的以及下属传感器数据的状态统计");
            return  result;
        }catch (Exception e){
            log.error("【分页查询设备的以及下属传感器数据的状态统计】================失败====:\n"+ e.getMessage());
        }
        return  null;
    }
    /**
     *消防看板-4报警信息统计
     * @return
     */