| | |
| | | package com.doumee.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.core.haikang.model.HKConstants; |
| | | import com.doumee.core.haikang.model.HKTools; |
| | |
| | | import com.doumee.core.haikang.model.param.respose.OrgInfoResponse; |
| | | import com.doumee.core.haikang.service.HKService; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.dao.business.WarningMapper; |
| | | import com.doumee.dao.business.model.Warning; |
| | | import com.doumee.dao.system.model.SystemDictData; |
| | | import com.doumee.service.business.InterfaceLogService; |
| | | import com.doumee.service.business.impl.hksync.HkSyncBaseServiceImpl; |
| | | import com.github.xiaoymin.knife4j.core.util.CollectionUtils; |
| | | 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; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 海康事件订阅表Service实现 |
| | |
| | | private SystemDictDataBiz systemDictDataBiz; |
| | | @Autowired |
| | | private InterfaceLogService interfaceLogService; |
| | | @Autowired |
| | | private WarningMapper warningMapper; |
| | | |
| | | @PostConstruct |
| | | public int initHkConfig(){ |
| | |
| | | } |
| | | |
| | | 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(); |
| | | } |
| | | 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; |
| | | } |
| | |
| | | HKService.cancelEventSub(param);//先取消 |
| | | // HKService.eventSub(param);//月台工作状态事件 |
| | | |
| | | try{ |
| | | List<Warning> warningList = warningMapper.selectList(new QueryWrapper<Warning>().lambda() |
| | | .eq(Warning::getIsdeleted,Constants.ZERO) |
| | | .eq(Warning::getStatus,Constants.ONE) |
| | | .in(Warning::getType,Constants.ZERO,Constants.ONE) |
| | | .isNotNull(Warning::getCode) |
| | | ); |
| | | if(CollectionUtils.isNotEmpty(warningList)){ |
| | | List<String> codeList = warningList.stream().map(i->i.getCode()).collect(Collectors.toList()); |
| | | if(CollectionUtils.isNotEmpty(codeList)){ |
| | | param.setEventDest(path+"/notice"); |
| | | param.setEventTypes(codeList.stream().map(i->Integer.valueOf(i)).toArray(Integer[]::new)); |
| | | HKService.cancelEventSub(param);//先取消 |
| | | HKService.eventSub(param);//安防事件 |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | |
| | | param.setEventDest(path+"/platform/carstatus"); |
| | | param.setEventTypes(new Integer[]{HKConstants.EventTypes.PLATFORM_CAR_STATUS.getKey()}); |
| | | HKService.cancelEventSub(param);//先取消 |
| | | HKService.eventSub(param);//月台车辆状态事件 |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | /** |