Browse Source

dcs完善

hfxc226 2 years ago
parent
commit
5287c957ae

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

@@ -54,7 +54,7 @@ public class InitAddGroupAndItem implements CommandLineRunner {
         weekendCriteria.andEqualTo(RemoteOpc::getCreatedFlag, YesNoEnum.YES.getValue()).andEqualTo(RemoteOpc::getPositionFlag, YesNoEnum.YES.getValue());
         List<RemoteOpc> list = remoteOpcMapper.selectByExample(weekend);
         List<RemoteOpc> remoteOpcList = OpcDAClient.addGroupAndItems(list);
-        if(CollectionUtils.isEmpty(remoteOpcList)){
+        if(!CollectionUtils.isEmpty(remoteOpcList)){
             remoteOpcMapper.updateBatch(remoteOpcList);
         }
         RedisUtils.del(RedisKeyConstants.redis_ok);

+ 1 - 1
platform-opc/src/main/java/com/platform/opc/servie/OpcTask.java

@@ -46,7 +46,7 @@ public class OpcTask {
             List<String> uniqueStr = list.stream().distinct().collect(Collectors.toList());
             if (!CollectionUtils.isEmpty(uniqueStr)) {
                 List<RemoteOpc> remoteOpcList = OpcDAClient.addGroupAndItems(findAllItems(uniqueStr));
-                if(CollectionUtils.isEmpty(remoteOpcList)){
+                if(!CollectionUtils.isEmpty(remoteOpcList)){
                     remoteOpcMapper.updateBatch(remoteOpcList);
                     // log.info("添加新点位:" + uniqueStr);
                 }