|  |  |  | 
|---|
|  |  |  | import com.hikvision.artemis.sdk.config.ArtemisConfig; | 
|---|
|  |  |  | import org.apache.commons.lang3.StringUtils; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.context.annotation.DependsOn; | 
|---|
|  |  |  | import org.springframework.core.annotation.Order; | 
|---|
|  |  |  | import org.springframework.stereotype.Service; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import javax.annotation.PostConstruct; | 
|---|
|  |  |  | 
|---|
|  |  |  | @PostConstruct | 
|---|
|  |  |  | public  int  initHkConfig(){ | 
|---|
|  |  |  | //获取根组织编码 | 
|---|
|  |  |  | initHkParamConfig(); | 
|---|
|  |  |  | getRootOrgCode(); | 
|---|
|  |  |  | //开始订阅门禁事件、访客事件、和停车场事件 | 
|---|
|  |  |  | startHkEventSub(); | 
|---|
|  |  |  | return  0; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public  int  initHkParamConfig(){ | 
|---|
|  |  |  | if(StringUtils.isBlank(ArtemisConfig.appKey ) | 
|---|
|  |  |  | ||StringUtils.isBlank(ArtemisConfig.host ) | 
|---|
|  |  |  | ||StringUtils.isBlank(ArtemisConfig.appSecret ) | 
|---|
|  |  |  | ){ | 
|---|
|  |  |  | ArtemisConfig.host = systemDictDataBiz.queryByCode(Constants.HK_PARAM, Constants.HK_HOST).getCode(); | 
|---|
|  |  |  | ArtemisConfig.appKey = systemDictDataBiz.queryByCode(Constants.HK_PARAM, Constants.HK_APPKEY).getCode(); | 
|---|
|  |  |  | ArtemisConfig.appSecret = systemDictDataBiz.queryByCode(Constants.HK_PARAM, Constants.HK_APPSECRET).getCode(); | 
|---|
|  |  |  | HKConstants.https = systemDictDataBiz.queryByCode(Constants.HK_PARAM, Constants.HK_HTTPS).getCode(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | HKTools.interfaceLogService=interfaceLogService; | 
|---|
|  |  |  | return  0; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | *    获取根组织编码 | 
|---|
|  |  |  | */ | 
|---|