| | |
| | | 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; |
| | |
| | | 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); |
| | |
| | | log.error("【海康获取根组织】================失败====:\n"+ e.getMessage()); |
| | | } |
| | | return null; |
| | | |
| | | } |
| | | /** |
| | | * 修改组织数据 |
| | |
| | | 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 |
| | | */ |
| | |
| | | */ |
| | | 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()); |
| | |
| | | return result; |
| | | }catch (Exception e){ |
| | | log.error("【海康事件订阅】================失败====:\n"+ e.getMessage()); |
| | | }finally { |
| | | // saveInterfaceLog(param,res); |
| | | } |
| | | return null; |
| | | } |