nidapeng
2024-04-10 6c5d0a4a9264b7508c7ffe81b45ba239cabf2244
server/dmvisit_service/src/main/java/com/doumee/core/haikang/service/HKService.java
@@ -1,29 +1,20 @@
package com.doumee.core.haikang.service;
import com.alibaba.fastjson.JSONObject;
import com.doumee.biz.system.SystemDictDataBiz;
import com.doumee.core.haikang.model.param.request.*;
import com.doumee.core.haikang.model.param.respose.*;
import com.doumee.core.utils.Constants;
import com.alibaba.fastjson.TypeReference;
import com.doumee.core.haikang.model.HKConstants;
import com.doumee.core.haikang.model.HKTools;
import com.doumee.core.haikang.model.param.BaseListPageResponse;
import com.doumee.core.haikang.model.param.BaseRequst;
import com.doumee.core.haikang.model.param.BaseResponse;
import com.doumee.dao.business.model.InterfaceLog;
import com.doumee.service.business.InterfaceLogService;
import com.hikvision.artemis.sdk.config.ArtemisConfig;
import com.doumee.core.haikang.model.param.request.*;
import com.doumee.core.haikang.model.param.respose.*;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
import com.alibaba.fastjson.TypeReference;
import java.io.InputStream;
import java.util.Date;
import java.util.List;
@Slf4j
@@ -33,13 +24,13 @@
     * 获取根组织数据
     * @return
     */
    public  static  BaseResponse<OrgListResponse>  getRootOrg(BaseRequst param){
    public  static  BaseResponse<OrgInfoResponse>  getRootOrg(BaseRequst param){
        log.info("【海康获取根组织】================开始====");
        try {
            String res = HKTools.getRootOrg ();
            TypeReference typeReference =
                    new TypeReference< BaseResponse<OrgListResponse>>(){};
            BaseResponse<OrgListResponse> result = JSONObject.parseObject(res, typeReference.getType());
                    new TypeReference< BaseResponse<OrgInfoResponse>>(){};
            BaseResponse<OrgInfoResponse> result = JSONObject.parseObject(res, typeReference.getType());
            logResult(result,"海康获取根组织");
            return  result;
        }catch (Exception e){
@@ -73,7 +64,6 @@
    public  static  BaseResponse<OrgOrUserAddResponse>  addBatchOrg(List<OrgAddRequest> param){
        log.info("【海康新增组织】================开始===="+JSONObject.toJSONString(param));
        try {
            String res = HKTools.addBatchOrg(JSONObject.toJSONString(param));
            TypeReference typeReference =
                    new TypeReference< BaseResponse<OrgOrUserAddResponse>>(){};
@@ -89,14 +79,14 @@
     *批量删除组织数据
     * @return
     */
    public  static  BaseResponse   delBatchOrg(OrgDelRequest param){
    public  static  BaseResponse<List<OrgUpdateFailureResponse>>   delBatchOrg(OrgDelRequest param){
        log.info("【海康删除组织】================开始===="+JSONObject.toJSONString(param));
        try {
            String res = HKTools.delOrg(JSONObject.toJSONString(param));
            TypeReference typeReference =
                    new TypeReference< BaseResponse >(){};
            BaseResponse result = JSONObject.parseObject(res, typeReference.getType());
            BaseResponse<List<OrgUpdateFailureResponse>>   result = JSONObject.parseObject(res, typeReference.getType());
            logResult(result,"海康删除组织");
            return  result;
        }catch (Exception e){
@@ -162,17 +152,17 @@
     *批量删除人员信息
     * @return
     */
    public  static  BaseResponse<OrgOrUserAddFailureResponse>  delBatchUser(List<UserAddRequest> param){
        log.info("【海康批量新增人员】================开始===="+JSONObject.toJSONString(param));
    public  static  BaseResponse<List<UserDelResponse>>  delBatchUser(UserDelRequest param){
        log.info("【海康批量删除人员】================开始===="+JSONObject.toJSONString(param));
        try {
            String res = HKTools.delBatchUser(JSONObject.toJSONString(param));
            TypeReference typeReference =
                    new TypeReference< BaseResponse<OrgOrUserAddFailureResponse>>(){};
            BaseResponse<OrgOrUserAddFailureResponse> result = JSONObject.parseObject(res, typeReference.getType());
            logResult(result,"海康批量新增人员");
                    new TypeReference< BaseResponse<List<UserDelResponse>>>(){};
            BaseResponse<List<UserDelResponse >> result = JSONObject.parseObject(res, typeReference.getType());
            logResult(result,"海康批量删除人员");
            return  result;
        }catch (Exception e){
            log.error("【海康批量新增人员】================失败====:\n"+ e.getMessage());
            log.error("【海康批量删除人员】================失败====:\n"+ e.getMessage());
        }
        return  null;
    }
@@ -180,7 +170,7 @@
     *添加人脸信息
     * @return
     */
    public  static  BaseResponse<FaceAddOrEditesponse>  addFace(List<FaceAddRequest> param){
    public  static  BaseResponse<FaceAddOrEditesponse>  addFace( FaceAddRequest  param){
        log.info("【海康添加人脸信息】================开始===="+JSONObject.toJSONString(param));
        try {
            String res = HKTools.addFace(JSONObject.toJSONString(param));
@@ -198,7 +188,7 @@
     *编辑人脸信息
     * @return
     */
    public  static  BaseResponse<FaceAddOrEditesponse>  editFace(List<FaceEditRequest> param){
    public  static  BaseResponse<FaceAddOrEditesponse>  editFace( FaceEditRequest  param){
        log.info("【海康编辑人脸信息】================开始===="+JSONObject.toJSONString(param));
        try {
            String res = HKTools.editFace(JSONObject.toJSONString(param));
@@ -219,7 +209,7 @@
    public  static  BaseResponse   delFace(List<FaceEditRequest> param){
        log.info("【海康删除人脸信息】================开始===="+JSONObject.toJSONString(param));
        try {
            String res = HKTools.editFace(JSONObject.toJSONString(param));
            String res = HKTools.delFace(JSONObject.toJSONString(param));
            TypeReference typeReference =
                    new TypeReference< BaseResponse>(){};
            BaseResponse  result = JSONObject.parseObject(res, typeReference.getType());
@@ -245,13 +235,58 @@
        }
        return  null;
    }
    /**
     * 获取访客记录中的图片
     * @return
     */
    public static InputStream getVisitPicture(VisitPictureRequest param) {
        log.info("【海康访客图片流】================开始===="+JSONObject.toJSONString(param));
        try {
            InputStream res = HKTools.getVisitPicture(JSONObject.toJSONString(param));
            log.error("【海康访客图片流】================成功====\n");
            return  res;
        }catch (Exception e){
            log.error("【海康访客图片流】================失败====:\n"+ e.getMessage());
        }
        return  null;
    }
    /**
     * 获取门禁事件的图片
     * @return
     */
    public static InputStream getDevicePicture(DevicePictureRequest param) {
        log.info("【海康门禁事件图片流】================开始===="+JSONObject.toJSONString(param));
        try {
            InputStream res = HKTools.getDevicePicture(JSONObject.toJSONString(param));
            log.error("【海康门禁事件图片流】================成功====\n");
            return  res;
        }catch (Exception e){
            log.error("【海康门禁事件图片流】================失败====:\n"+ e.getMessage());
        }
        return  null;
    }
    /**
     * 查询车辆抓拍图片
     * @return
     */
    public static InputStream getCarPicture(CarPictureRequest param) {
        log.info("【海康车辆抓拍图片图片流】================开始===="+JSONObject.toJSONString(param));
        try {
            InputStream res = HKTools.getCarPicture(JSONObject.toJSONString(param));
            log.error("【海康车辆抓拍图片图片流】================成功====\n");
            return  res;
        }catch (Exception e){
            log.error("【海康车辆抓拍图片图片流】================失败====:\n"+ e.getMessage());
        }
        return  null;
    }
    /**
     *获取车库列表数据(全量)
     * @return
     */
    public  static  BaseResponse<List<ParkListResponse>>   parkList(ParkListRequest param){
        log.info("【海获取车库列表数据】================开始===="+JSONObject.toJSONString(param));
        log.info("【海康获取车库列表数据】================开始===="+JSONObject.toJSONString(param));
        try {
            String res = HKTools.parkList(JSONObject.toJSONString(param));
            TypeReference typeReference =
@@ -412,13 +447,13 @@
     *访客免登记预约
     * @return
     */
    public  static  BaseResponse<VisitAppointmentVistorResponse>   visitAppiontmentMDJ(VisitAppointmentMDJRequest param){
    public  static  BaseResponse<VisitAppointmentMDJResponse>   visitAppiontmentMDJ(VisitAppointmentMDJRequest param){
        log.info("【海康访客免登记预约】================开始===="+JSONObject.toJSONString(param));
        try {
            String res = HKTools.visitAppiontmentMDJ(JSONObject.toJSONString(param));
            TypeReference typeReference =
                    new TypeReference< BaseResponse<VisitAppointmentVistorResponse> >(){};
            BaseResponse<VisitAppointmentVistorResponse>   result = JSONObject.parseObject(res, typeReference.getType());
                    new TypeReference< BaseResponse<VisitAppointmentMDJResponse> >(){};
            BaseResponse<VisitAppointmentMDJResponse>   result = JSONObject.parseObject(res, typeReference.getType());
            logResult(result,"海康访客免登记预约");
            return  result;
        }catch (Exception e){
@@ -501,7 +536,469 @@
        }
        return  null;
    }
    /**
     *事件订阅
     * @return
     */
    public  static  BaseResponse   cancelEventSub(EventSubRequest param){
        log.info("【海康取消事件订阅】================开始===="+JSONObject.toJSONString(param));
        String res = null;
        try {
            res = HKTools.cancelEventSub(JSONObject.toJSONString(param));
            TypeReference typeReference =
                    new TypeReference< BaseResponse >(){};
            BaseResponse   result = JSONObject.parseObject(res, typeReference.getType());
            logResult(result,"海康取消事件订阅");
            return  result;
        }catch (Exception e){
            log.error("【海康取消事件订阅】================失败====:\n"+ e.getMessage());
        }finally {
           // saveInterfaceLog(param,res);
        }
        return  null;
    }
    /**
     *海康创建一卡通下载任务
     * @return
     */
    public  static  BaseResponse<TaskAdditionResponse>   taskAddition(TaskAdditionRequest param){
        log.info("【海康创建一卡通下载任务】================开始===="+JSONObject.toJSONString(param));
        String res = null;
        try {
            res = HKTools.taskAddition(JSONObject.toJSONString(param));
            TypeReference typeReference =
                    new TypeReference< BaseResponse<TaskAdditionResponse>>(){};
            BaseResponse<TaskAdditionResponse>      result = JSONObject.parseObject(res, typeReference.getType());
            logResult(result,"海康创建一卡通下载任务");
            return  result;
        }catch (Exception e){
            log.error("【海康创建一卡通下载任务】================失败====:\n"+ e.getMessage());
        }finally {
           // saveInterfaceLog(param,res);
        }
        return  null;
    }
    /**
     *海康一卡通任务添加数据
     * @return
     */
    public  static  BaseResponse    taskDataAddition(TaskDataAdditionRequest param){
        log.info("【海康一卡通任务添加数据】================开始===="+JSONObject.toJSONString(param));
        String res = null;
        try {
            res = HKTools.taskDataAddition(JSONObject.toJSONString(param));
            TypeReference typeReference =
                    new TypeReference< BaseResponse >(){};
            BaseResponse   result = JSONObject.parseObject(res, typeReference.getType());
            logResult(result,"海康一卡通任务添加数据");
            return  result;
        }catch (Exception e){
            log.error("【海康一卡通任务添加数据】================失败====:\n"+ e.getMessage());
        }finally {
           // saveInterfaceLog(param,res);
        }
        return  null;
    }
    /**
     *海康一卡通任务进度查询
     * @return
     */
    public  static  BaseResponse<TaskProgressNumResponse>    taskProgressNum(TaskProgressRequest param){
        log.info("【海康一卡通任务进度查询】================开始===="+JSONObject.toJSONString(param));
        String res = null;
        try {
            res = HKTools.taskProgressNum(JSONObject.toJSONString(param));
            TypeReference typeReference =
                    new TypeReference< BaseResponse<TaskProgressNumResponse> >(){};
            BaseResponse<TaskProgressNumResponse>   result = JSONObject.parseObject(res, typeReference.getType());
            logResult(result,"海康一卡通任务进度查询");
            return  result;
        }catch (Exception e){
            log.error("【海康一卡通任务进度查询】================失败====:\n"+ e.getMessage());
        }finally {
           // saveInterfaceLog(param,res);
        }
        return  null;
    }
    /**
     *海康一卡通设备通道的人员权限下载详情总数v2
     * @return
     */
    public  static  BaseResponse<TaskProgressResponse>    taskProgress(TaskProgressRequest param){
        log.info("【海康一卡通设备通道的人员权限下载详情总数】================开始===="+JSONObject.toJSONString(param));
        String res = null;
        try {
            res = HKTools.taskProgress(JSONObject.toJSONString(param));
            TypeReference typeReference =
                    new TypeReference< BaseResponse<TaskProgressResponse> >(){};
            BaseResponse<TaskProgressResponse>   result = JSONObject.parseObject(res, typeReference.getType());
            logResult(result,"海康一卡通设备通道的人员权限下载详情总数");
            return  result;
        }catch (Exception e){
            log.error("【海康一卡通设备通道的人员权限下载详情总数】================失败====:\n"+ e.getMessage());
        }finally {
           // saveInterfaceLog(param,res);
        }
        return  null;
    }
    /**
     *海康查询权限条目列表
     * @return
     */
    public  static  BaseResponse<AuthItemListResponse>    authItemList(AuthItemListRequest param){
        log.info("【海康查询权限条目列表】================开始===="+JSONObject.toJSONString(param));
        String res = null;
        try {
            res = HKTools.authItemList(JSONObject.toJSONString(param));
            TypeReference typeReference =
                    new TypeReference< BaseResponse<AuthItemListResponse> >(){};
            BaseResponse<AuthItemListResponse>   result = JSONObject.parseObject(res, typeReference.getType());
            logResult(result,"海康查询权限条目列表");
            return  result;
        }catch (Exception e){
            log.error("【海康查询权限条目列表】================失败====:\n"+ e.getMessage());
        }finally {
           // saveInterfaceLog(param,res);
        }
        return  null;
    }
    /**
     *海康一卡通任务开始执行
     * @return
     */
    public  static  BaseResponse     taskStart(TaskProgressRequest param){
        log.info("【海康一卡通任务开始执行】================开始===="+JSONObject.toJSONString(param));
        String res = null;
        try {
            res = HKTools.taskStart(JSONObject.toJSONString(param));
            TypeReference typeReference =
                    new TypeReference< BaseResponse >(){};
            BaseResponse  result = JSONObject.parseObject(res, typeReference.getType());
            logResult(result,"海康一卡通任务开始执行");
            return  result;
        }catch (Exception e){
            log.error("【海康一卡通任务开始执行】================失败====:\n"+ e.getMessage());
        }finally {
           // saveInterfaceLog(param,res);
        }
        return  null;
    }
    /**
     *海康批量开卡
     * @return
     */
    public  static  BaseResponse<List<CardInfoResponse>>     cardBingding(CardBingdingRequest param){
        log.info("【海康批量开卡】================开始===="+JSONObject.toJSONString(param));
        String res = null;
        try {
            res = HKTools.cardBingding(JSONObject.toJSONString(param));
            TypeReference typeReference =
                    new TypeReference< BaseResponse <List<CardInfoResponse>>  >(){};
            BaseResponse<List<CardInfoResponse>>    result = JSONObject.parseObject(res, typeReference.getType());
            logResult(result,"海康批量开卡");
            return  result;
        }catch (Exception e){
            log.error("【海康批量开卡】================失败====:\n"+ e.getMessage());
        }finally {
        }
        return  null;
    }
    /**
     *海康退卡
     * @return
     */
    public  static  BaseResponse    cardDeletion(CardDeletionRequest param){
        log.info("【海康退卡】================开始===="+JSONObject.toJSONString(param));
        String res = null;
        try {
            res = HKTools.cardDeletion(JSONObject.toJSONString(param));
            TypeReference typeReference =
                    new TypeReference< BaseResponse >(){};
            BaseResponse  result = JSONObject.parseObject(res, typeReference.getType());
            logResult(result,"海康退卡");
            return  result;
        }catch (Exception e){
            log.error("【海康退卡】================失败====:\n"+ e.getMessage());
        }finally {
        }
        return  null;
    }
    /**
     *海康批量挂失
     * @return
     */
    public  static  BaseResponse    cardLoss(CardLossRequest param){
        log.info("【海康批量挂失】================开始===="+JSONObject.toJSONString(param));
        String res = null;
        try {
            res = HKTools.cardLoss(JSONObject.toJSONString(param));
            TypeReference typeReference =
                    new TypeReference< BaseResponse >(){};
            BaseResponse     result = JSONObject.parseObject(res, typeReference.getType());
            logResult(result,"海康批量挂失");
            return  result;
        }catch (Exception e){
            log.error("【海康批量挂失】================失败====:\n"+ e.getMessage());
        }finally {
        }
        return  null;
    }
    /**
     *海康批量解挂
     * @return
     */
    public  static  BaseResponse    cardUnLoss(CardLossRequest param){
        log.info("【海康批量解挂】================开始===="+JSONObject.toJSONString(param));
        String res = null;
        try {
            res = HKTools.cardUnloss(JSONObject.toJSONString(param));
            TypeReference typeReference =
                    new TypeReference< BaseResponse >(){};
            BaseResponse     result = JSONObject.parseObject(res, typeReference.getType());
            logResult(result,"海康批量解挂");
            return  result;
        }catch (Exception e){
            log.error("【海康批量解挂】================失败====:\n"+ e.getMessage());
        }finally {
        }
        return  null;
    }
    /**
     *海康查询设备通道的人员权限下载详情
     * @return
     */
    public  static  BaseResponse<TaskPersonDetailListResponse>  taskPersoDetail(TaskPersonDetailRequest param){
        log.info("【海康查询设备通道的人员权限下载详情】================开始===="+JSONObject.toJSONString(param));
        String res = null;
        try {
            res = HKTools.taskPersoDetail(JSONObject.toJSONString(param));
            TypeReference typeReference =
                    new TypeReference< BaseResponse <TaskPersonDetailListResponse>>(){};
            BaseResponse<TaskPersonDetailListResponse>    result = JSONObject.parseObject(res, typeReference.getType());
            logResult(result,"海康查询设备通道的人员权限下载详情");
            return  result;
        }catch (Exception e){
            log.error("【海康查询设备通道的人员权限下载详情】================失败====:\n"+ e.getMessage());
        }finally {
        }
        return  null;
    }
    /**
     *查询访客预约记录(分页)
     * @return
     */
    public  static  BaseResponse<BaseListPageResponse<AppointmentInfoResponse>>   appointmentRecords(AppointmentListRequest param){
        log.info("【海康访客预约记录查询】================开始===="+JSONObject.toJSONString(param));
        try {
            String res = HKTools.appointmentRecords(JSONObject.toJSONString(param));
            TypeReference typeReference =
                    new TypeReference<BaseResponse<BaseListPageResponse<AppointmentInfoResponse>>>(){};
            BaseResponse<BaseListPageResponse<AppointmentInfoResponse>>   result = JSONObject.parseObject(res, typeReference.getType());
            logResult(result,"海康访客预约记录查询");
            return  result;
        }catch (Exception e){
            log.error("【海康访客预约记录查询】================失败====:\n"+ e.getMessage());
        }
        return  null;
    }
    /**
     *查询访客来访记录(已登记)(分页)
     * @return
     */
    public  static  BaseResponse<BaseListPageResponse<VisitingInfoResponse>>   visitingRecords(VisitingInfoRequest param){
        log.info("【海康访客来访记录查询】================开始===="+JSONObject.toJSONString(param));
        try {
            String res = HKTools.visitingRecords(JSONObject.toJSONString(param));
            TypeReference typeReference =
                    new TypeReference<BaseResponse<BaseListPageResponse<VisitingInfoResponse>>>(){};
            BaseResponse<BaseListPageResponse<VisitingInfoResponse>>   result = JSONObject.parseObject(res, typeReference.getType());
            logResult(result,"海康访客来访记录查询");
            return  result;
        }catch (Exception e){
            log.error("【海康访客来访记录查询】================失败====:\n"+ e.getMessage());
        }
        return  null;
    }
    /**
     *全量组织查询(分页)
     * @return
     */
    public  static  BaseResponse<BaseListPageResponse<OrgInfoResponse>>   orgAllList(TimeRangeListRequest param){
        log.info("【海康全量组织查询】================开始===="+JSONObject.toJSONString(param));
        try {
            String res = HKTools.orgAllList(JSONObject.toJSONString(param));
            TypeReference typeReference =
                    new TypeReference< BaseResponse<BaseListPageResponse<OrgInfoResponse>>> (){};
            BaseResponse<BaseListPageResponse<OrgInfoResponse>>   result = JSONObject.parseObject(res, typeReference.getType());
            logResult(result,"海康全量组织查询");
            return  result;
        }catch (Exception e){
            log.error("【海康全量组织查询】================失败====:\n"+ e.getMessage());
        }
        return  null;
    }
    /**
     *增量组织查询(分页)
     * @return
     */
    public  static  BaseResponse<BaseListPageResponse<OrgTimeRangeInfoResponse>>   orgTimeRangeList(TimeRangeListRequest param){
        log.info("【海康增量组织查询】================开始===="+JSONObject.toJSONString(param));
        try {
            String res = HKTools.orgTimeRangeList(JSONObject.toJSONString(param));
            TypeReference typeReference =
                    new TypeReference< BaseResponse<BaseListPageResponse<OrgTimeRangeInfoResponse>> >(){};
            BaseResponse<BaseListPageResponse<OrgTimeRangeInfoResponse>>   result = JSONObject.parseObject(res, typeReference.getType());
            logResult(result,"海康增量组织查询");
            return  result;
        }catch (Exception e){
            log.error("【海康增量组织查询】================失败====:\n"+ e.getMessage());
        }
        return  null;
    }
    /**
     *全量人员查询(分页)
     * @return
     */
    public  static  BaseResponse<BaseListPageResponse<UserInfoResponse>>   userAllList(TimeRangeListRequest param){
        log.info("【海康全量人员查询】================开始===="+JSONObject.toJSONString(param));
        try {
            String res = HKTools.userAllList(JSONObject.toJSONString(param));
            TypeReference typeReference =
                    new TypeReference< BaseResponse<BaseListPageResponse<UserInfoResponse>> >(){};
            BaseResponse<BaseListPageResponse<UserInfoResponse>>   result = JSONObject.parseObject(res, typeReference.getType());
            logResult(result,"海康全量人员查询");
            return  result;
        }catch (Exception e){
            log.error("【海康全量人员查询】================失败====:\n"+ e.getMessage());
        }
        return  null;
    }
    /**
     *增量人员查询(分页)
     * @return
     */
    public  static  BaseResponse<BaseListPageResponse<UserTimeRangeInfoResponse>>   userTimeRangeList(TimeRangeListRequest param){
        log.info("【海康增量人员查询】================开始===="+JSONObject.toJSONString(param));
        try {
            String res = HKTools.userTimeRangeList(JSONObject.toJSONString(param));
            TypeReference typeReference =
                    new TypeReference< BaseResponse<BaseListPageResponse<UserTimeRangeInfoResponse>> >(){};
            BaseResponse<BaseListPageResponse<UserTimeRangeInfoResponse>>   result = JSONObject.parseObject(res, typeReference.getType());
            logResult(result,"海康增量人员查询");
            return  result;
        }catch (Exception e){
            log.error("【海康增量人员查询】================失败====:\n"+ e.getMessage());
        }
        return  null;
    }
    /**
     *全量车辆查询(分页)
     * @return
     */
    public  static  BaseResponse<BaseListPageResponse<VehicleInfoResponse>>   vehicleList(TimeRangeListRequest param){
        log.info("【海康全量人员查询】================开始===="+JSONObject.toJSONString(param));
        try {
            String res = HKTools.vehicleList(JSONObject.toJSONString(param));
            TypeReference typeReference =
                    new TypeReference< BaseResponse<BaseListPageResponse<VehicleInfoResponse>> >(){};
            BaseResponse<BaseListPageResponse<VehicleInfoResponse>>   result = JSONObject.parseObject(res, typeReference.getType());
            logResult(result,"海康全量人员查询");
            return  result;
        }catch (Exception e){
            log.error("【海康全量人员查询】================失败====:\n"+ e.getMessage());
        }
        return  null;
    }
    /**
     *过车记录查询(分页)
     * @return
     */
    public  static  BaseResponse<BaseListPageResponse<ParkCrossRecordInfoResponse>>   parkCrossRecords(ParkCrossRecordListRequest param){
        log.info("【海康过车记录查询查询】================开始===="+JSONObject.toJSONString(param));
        try {
            String res = HKTools.parkCrossRecords(JSONObject.toJSONString(param));
            TypeReference typeReference =
                    new TypeReference< BaseResponse<BaseListPageResponse<ParkCrossRecordInfoResponse>> >(){};
            BaseResponse<BaseListPageResponse<ParkCrossRecordInfoResponse>>   result = JSONObject.parseObject(res, typeReference.getType());
            logResult(result,"海康过车记录查询查询");
            return  result;
        }catch (Exception e){
            log.error("【海康过车记录查询查询】================失败====:\n"+ e.getMessage());
        }
        return  null;
    }
    /**
     *增量车辆查询(分页)
     * @return
     */
    public  static  BaseResponse<BaseListPageResponse<VehicleTimeRangeInfoResponse>>   vehicleTimeRangeList(TimeRangeListRequest param){
        log.info("【海康增量人员查询】================开始===="+JSONObject.toJSONString(param));
        try {
            String res = HKTools.vehicleTimeRangeList(JSONObject.toJSONString(param));
            TypeReference typeReference =
                    new TypeReference< BaseResponse<BaseListPageResponse<VehicleTimeRangeInfoResponse>> >(){};
            BaseResponse<BaseListPageResponse<VehicleTimeRangeInfoResponse>>   result = JSONObject.parseObject(res, typeReference.getType());
            logResult(result,"海康增量人员查询");
            return  result;
        }catch (Exception e){
            log.error("【海康增量人员查询】================失败====:\n"+ e.getMessage());
        }
        return  null;
    }
    /**
     *增量车辆查询(分页)
     * @return
     */
    public  static  BaseResponse<BaseListPageResponse<VehicleTimeRangeInfoResponse>>   facePictureCheck(TimeRangeListRequest param){
        log.info("【海康增量人员查询】================开始===="+JSONObject.toJSONString(param));
        try {
            String res = HKTools.facePictureCheck(JSONObject.toJSONString(param));
            TypeReference typeReference =
                    new TypeReference< BaseResponse<BaseListPageResponse<VehicleTimeRangeInfoResponse>> >(){};
            BaseResponse<BaseListPageResponse<VehicleTimeRangeInfoResponse>>   result = JSONObject.parseObject(res, typeReference.getType());
            logResult(result,"海康增量人员查询");
            return  result;
        }catch (Exception e){
            log.error("【海康增量人员查询】================失败====:\n"+ e.getMessage());
        }
        return  null;
    }
    /**
     *获取门禁设备在线状态(分页)
     * @return
     */
    public  static  BaseResponse<BaseListPageResponse<AscDeviceStatusInfoResponse>>   acsDeviceStatus(AcsDeviceStatusListRequest param){
        log.info("【海康获取门禁设备在线状态】================开始===="+JSONObject.toJSONString(param));
        try {
            String res = HKTools.acsDeviceStatus(JSONObject.toJSONString(param));
            TypeReference typeReference =
                    new TypeReference< BaseResponse<BaseListPageResponse<AscDeviceStatusInfoResponse>> >(){};
            BaseResponse<BaseListPageResponse<AscDeviceStatusInfoResponse>>   result = JSONObject.parseObject(res, typeReference.getType());
            logResult(result,"海康获取门禁设备在线状态");
            return  result;
        }catch (Exception e){
            log.error("【海康获取门禁设备在线状态】================失败====:\n"+ e.getMessage());
        }
        return  null;
    }
    /**
     *查询场内车停车信息(分页)
     * @return
     */
    public  static  BaseResponse<BaseListPageResponse<TempCarInRecordInfoResponse>>   tempCarInRecords(TempCarInRecordListRequest param){
        log.info("【海康查询场内车停车信息】================开始===="+JSONObject.toJSONString(param));
        try {
            String res = HKTools.tempCarInRecords(JSONObject.toJSONString(param));
            TypeReference typeReference =
                    new TypeReference< BaseResponse<BaseListPageResponse<TempCarInRecordInfoResponse>> >(){};
            BaseResponse<BaseListPageResponse<TempCarInRecordInfoResponse>>   result = JSONObject.parseObject(res, typeReference.getType());
            logResult(result,"海康查询场内车停车信息");
            return  result;
        }catch (Exception e){
            log.error("【海康查询场内车停车信息】================失败====:\n"+ e.getMessage());
        }
        return  null;
    }
    private static void logResult(BaseResponse res,String name) {
        if(StringUtils.equals(res.getCode(),HKConstants.RESPONSE_SUCCEE)){
            log.info("【"+name+"】================成功====\n"+res);