rk
3 天以前 4f6565cb9cca05981abdeb85dfc023a28c892e42
server/visits/dmvisit_admin/src/main/java/com/doumee/service/impl/HkSyncEventServiceImpl.java
@@ -1,5 +1,6 @@
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;
@@ -8,9 +9,12 @@
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;
@@ -18,6 +22,8 @@
import javax.annotation.PostConstruct;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
/**
 * 海康事件订阅表Service实现
@@ -31,6 +37,8 @@
    private SystemDictDataBiz systemDictDataBiz;
    @Autowired
    private InterfaceLogService interfaceLogService;
    @Autowired
    private WarningMapper warningMapper;
    @PostConstruct
    public  int  initHkConfig(){
@@ -111,11 +119,28 @@
        HKService.cancelEventSub(param);//先取消
//        HKService.eventSub(param);//月台工作状态事件
        param.setEventDest(path+"/platform/carstatus");
        param.setEventTypes(new Integer[]{HKConstants.EventTypes.PLATFORM_CAR_STATUS.getKey()});
        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);//月台车辆状态事件
                    HKService.eventSub(param);//安防事件
                }
            }
        }catch (Exception e){
        }
    }
    /**