Browse Source

完善opc展示

hfxc226 1 year ago
parent
commit
c97435e48a

+ 5 - 2
platform-opc/src/main/java/com/platform/opc/command/InitAddGroupAndItem.java

@@ -39,6 +39,7 @@ public class InitAddGroupAndItem implements CommandLineRunner {
         RedisUtils.del(RedisKeyConstants.redis_opc_wait_add_list);
         OpcDAClient.connect();
     }
+
     /**
      * 初始化redis和点位分组数据,并启动循环判断
      * 筛选出来:已经在server里面配置好的点位*
@@ -58,10 +59,12 @@ public class InitAddGroupAndItem implements CommandLineRunner {
         // 启动分组,按照车间line分组,选择已经在opc server中配置的, 且点位位置也在页面上配置的
         weekendCriteria.andEqualTo(RemoteOpc::getCreatedFlag, YesNoEnum.YES.getValue()).andEqualTo(RemoteOpc::getPositionFlag, YesNoEnum.YES.getValue());
         List<RemoteOpc> list = remoteOpcMapper.selectByExample(weekend);
+        log.info("共计点位:" + list.size());
         List<RemoteOpc> remoteOpcList = OpcDAClient.addGroupAndItems(list);
-        if(!CollectionUtils.isEmpty(remoteOpcList)){
+        if (!CollectionUtils.isEmpty(remoteOpcList)) {
             //log.info("updateBatch: " + remoteOpcList);
-            //remoteOpcMapper.updateBatch(remoteOpcList);
+            remoteOpcMapper.updateBatch(remoteOpcList);
+            log.info("共计更新数量:" + remoteOpcList.size());
         }
         RedisUtils.del(RedisKeyConstants.redis_ok);
         log.info("结束-初始化分组");