jiaosong
2023-12-08 36baabb9fc5f74a22f798651d33fa8c0ff32a1ce
server/dmvisit_service/src/main/java/com/doumee/core/haikang/service/HKService.java
@@ -9,6 +9,8 @@
import com.doumee.core.haikang.model.HKTools;
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 lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
@@ -21,9 +23,9 @@
import com.alibaba.fastjson.TypeReference;
import java.io.InputStream;
import java.util.Date;
import java.util.List;
//@Service
@Slf4j
public class HKService {
    private Logger logger = LoggerFactory.getLogger(HKService.class);
@@ -44,7 +46,6 @@
            log.error("【海康获取根组织】================失败====:\n"+ e.getMessage());
        }
        return  null;
    }
    /**
     * 修改组织数据
@@ -372,6 +373,42 @@
        return  null;
    }
    /**
     *访客预约取消
     * @return
     */
    public  static  BaseResponse   cancelVisitAppiontment(VisitAppointmentCancelRequest param){
        log.error("【海康访客预约取消】================开始===="+JSONObject.toJSONString(param));
        try {
            String res = HKTools.visitCancel(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());
        }
        return  null;
    }
    /**
     *访客预约签离
     * @return
     */
    public  static  BaseResponse  outVisitAppiontment(VisitAppointmentOutRequest param){
        log.error("【海康访客预约签离】================开始===="+JSONObject.toJSONString(param));
        try {
            String res = HKTools.visitOut(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());
        }
        return  null;
    }
    /**
     *访客免登记预约
     * @return
     */
@@ -431,8 +468,9 @@
     */
    public  static  BaseResponse   eventSub(EventSubRequest param){
        log.error("【海康事件订阅】================开始===="+JSONObject.toJSONString(param));
        String res = null;
        try {
            String res = HKTools.eventSub(JSONObject.toJSONString(param));
            res = HKTools.eventSub(JSONObject.toJSONString(param));
            TypeReference typeReference =
                    new TypeReference< BaseResponse >(){};
            BaseResponse   result = JSONObject.parseObject(res, typeReference.getType());
@@ -440,6 +478,8 @@
            return  result;
        }catch (Exception e){
            log.error("【海康事件订阅】================失败====:\n"+ e.getMessage());
        }finally {
           // saveInterfaceLog(param,res);
        }
        return  null;
    }