From 08b6a55a3a111aaee9842999b85afa60b6d61dc3 Mon Sep 17 00:00:00 2001 From: houzhongjian <houzhongyi@126.com> Date: 星期四, 14 十一月 2024 15:29:38 +0800 Subject: [PATCH] 大华及海康摄像头截图功能开发 --- iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/kio/collector/KingIOCollector.java | 15 ++++++++++++--- 1 files changed, 12 insertions(+), 3 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 77339a2..4ee8b2a 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 @@ -2,9 +2,12 @@ import com.iailab.module.data.channel.kio.entity.ChannelKioDeviceEntity; import com.iailab.module.data.channel.kio.service.ChannelKioDeviceService; +import com.iailab.module.data.channel.opcua.collector.OpcUaUtils; +import com.iailab.module.data.common.enums.CommonConstant; import com.iailab.module.data.common.enums.DataSourceType; import com.iailab.module.data.common.utils.TagUtils; import lombok.extern.slf4j.Slf4j; +import org.eclipse.milo.opcua.sdk.client.OpcUaClient; import org.springframework.stereotype.Component; import org.springframework.util.CollectionUtils; @@ -50,9 +53,15 @@ return kingIOClient; } - public String getTagValue(String sourceId, String tagName) throws Exception { - KingIOClient client = this.getClient(sourceId); - String value = client.getTagValue(tagName); + public String getTagValue(String sourceId, String tagName) { + String value = CommonConstant.BAD_VALUE.toString(); + try{ + KingIOClient client = this.getClient(sourceId); + value = client.getTagValue(tagName); + }catch (Exception ex){ + ex.printStackTrace(); + return value; + } return value; } -- Gitblit v1.9.3