From a9406b6b18ee5a8e29cad3248f46320a36ac9749 Mon Sep 17 00:00:00 2001 From: yyt <306727702@qq.com> Date: 星期三, 21 二月 2024 00:19:44 +0800 Subject: [PATCH] 批量数据采集方法更新 --- jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/init/OpcusConfigInit.java | 10 +++------- 1 files changed, 3 insertions(+), 7 deletions(-) diff --git a/jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/init/OpcusConfigInit.java b/jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/init/OpcusConfigInit.java index 66b271e..c836a15 100644 --- a/jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/init/OpcusConfigInit.java +++ b/jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/init/OpcusConfigInit.java @@ -2,7 +2,6 @@ import com.google.common.collect.Lists; import com.jcdm.main.da.opcuaconfig.client.ClientHandler; -import com.jcdm.main.da.opcuaconfig.controller.DaOpcuaConfigController; import com.jcdm.main.da.opcuaconfig.domain.DaOpcuaConfig; import com.jcdm.main.da.opcuaconfig.domain.NodeEntity; import com.jcdm.main.da.opcuaconfig.service.IDaOpcuaConfigService; @@ -10,10 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.CommandLineRunner; import org.springframework.stereotype.Component; - import java.util.List; -import java.util.stream.Collectors; -import java.util.stream.Stream; @Component @Slf4j @@ -29,7 +25,8 @@ public void run(String... args) throws Exception { try { DaOpcuaConfig daOpcuaConfig=new DaOpcuaConfig(); - daOpcuaConfig.setSubscribe(1L); //璁剧疆鏌ヨ鏉′欢锛屾槸鍚﹁闃呯姸鎬佷负1鐨勬墍鏈夋暟鎹�. + daOpcuaConfig.setSubscribe("Y"); //璁剧疆鏌ヨ鏉′欢锛岃闃呯姸鎬佺殑鎵�鏈夋暟鎹�. + daOpcuaConfig.setState(Long.valueOf("0")); //璁剧疆鏌ヨ鏉′欢锛屾甯哥姸鎬�. List<DaOpcuaConfig> nodeslist=daOpcuaConfigService.selectDaOpcuaConfigList(daOpcuaConfig); clientHandler.connect(); if (nodeslist != null && nodeslist.size() > 0) { @@ -40,9 +37,8 @@ return nodeEntity; }); clientHandler.subscribe(NodeList); - log.info("鍒濆鍖朞PC璁㈤槄" + nodeslist.size() + "鏉★紒"); } - log.info("绯荤粺鎻愮ず锛孫PCUA璁㈤槄鎴愬姛锛�"); + log.info("OPCUA鍒濆鍖栨垚鍔燂紝骞跺畬鎴�"+ nodeslist.size() +"涓妭鐐硅闃�"); } catch (Exception e) { e.printStackTrace(); log.info("绯荤粺鎻愮ず锛孫PCUA璁㈤槄澶辫触锛�"); -- Gitblit v1.9.3