From 7cbee82d2572041332eb69bc2d0d9c6a93492efe Mon Sep 17 00:00:00 2001 From: 潘志宝 <979469083@qq.com> Date: 星期二, 15 十月 2024 11:52:48 +0800 Subject: [PATCH] HttpCollectorIhDB --- iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/kio/collector/KingIOCollector.java | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/kio/collector/KingIOCollector.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/kio/collector/KingIOCollector.java index 3dd07c6..77339a2 100644 --- a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/kio/collector/KingIOCollector.java +++ b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/kio/collector/KingIOCollector.java @@ -1,14 +1,14 @@ package com.iailab.module.data.channel.kio.collector; +import com.iailab.module.data.channel.kio.entity.ChannelKioDeviceEntity; +import com.iailab.module.data.channel.kio.service.ChannelKioDeviceService; import com.iailab.module.data.common.enums.DataSourceType; import com.iailab.module.data.common.utils.TagUtils; -import com.iailab.module.data.channel.kio.dto.ChannelKioDeviceDTO; -import com.iailab.module.data.channel.kio.service.ChannelKioDeviceService; import lombok.extern.slf4j.Slf4j; -import javax.annotation.Resource; import org.springframework.stereotype.Component; import org.springframework.util.CollectionUtils; +import javax.annotation.Resource; import java.math.BigDecimal; import java.util.ArrayList; import java.util.HashMap; @@ -31,15 +31,15 @@ private Map<String, KingIOClient> clientMap = new ConcurrentHashMap<>(); - private Map<String, ChannelKioDeviceDTO> deviceMap = new HashMap<>(); + private Map<String, ChannelKioDeviceEntity> deviceMap = new HashMap<>(); public synchronized KingIOClient getClient(String sourceId) throws Exception { if (!clientMap.containsKey(sourceId)) { - ChannelKioDeviceDTO deviceDto = channelKioDeviceService.get(sourceId); - deviceMap.put(sourceId, deviceDto); - KingIOClient kingIOClient = new KingIOClient(deviceDto.getInstanceName()); + ChannelKioDeviceEntity deviceEntity = channelKioDeviceService.info(sourceId); + deviceMap.put(sourceId, deviceEntity); + KingIOClient kingIOClient = new KingIOClient(deviceEntity.getInstanceName()); clientMap.put(sourceId, kingIOClient); - if (!kingIOClient.login(deviceDto.getAddress(), deviceDto.getPort(), deviceDto.getUsername(), deviceDto.getPassword())) { + if (!kingIOClient.login(deviceEntity.getAddress(), deviceEntity.getPort(), deviceEntity.getUsername(), deviceEntity.getPassword())) { throw new Exception("登录异常"); } } -- Gitblit v1.9.3