|
@@ -56,14 +56,13 @@ public class OpcInit {
|
|
|
*/
|
|
|
@Scheduled(fixedDelay = 10000)
|
|
|
public void addAndDelItems() {
|
|
|
- log.info("开始更新分组和点位数据:");
|
|
|
RedisUtils.setString(OpcDAClient.redis_opc_update_flag, "1");
|
|
|
-
|
|
|
List<String> list = RedisUtils.getList(OpcDAClient.redis_opc_wait_add_list, 0, -1);
|
|
|
if (!CollectionUtils.isEmpty(list)) {
|
|
|
List<String> uniqueStr = list.stream().distinct().collect(Collectors.toList());
|
|
|
if (!CollectionUtils.isEmpty(uniqueStr)) {
|
|
|
addGroupAndItems(findAllItems(false, uniqueStr));
|
|
|
+ log.info("开始添加新点位:");
|
|
|
}
|
|
|
}
|
|
|
RedisUtils.del(OpcDAClient.redis_opc_wait_add_list);
|
|
@@ -75,13 +74,12 @@ public class OpcInit {
|
|
|
List<RemoteOpc> uniqueStr = remoteOpcList.stream().distinct().collect(Collectors.toList());
|
|
|
if (!CollectionUtils.isEmpty(uniqueStr)) {
|
|
|
OpcDAClient.removeItems(remoteOpcList.stream().collect(Collectors.groupingBy(RemoteOpc::getLine)));
|
|
|
+ log.info("开始移除删除点位:");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
RedisUtils.del(OpcDAClient.redis_opc_wait_remove_list);
|
|
|
-
|
|
|
RedisUtils.del(OpcDAClient.redis_opc_update_flag);
|
|
|
- log.info("结束更新分组和点位数据:");
|
|
|
}
|
|
|
|
|
|
/**
|