| | |
| | | package com.iailab.module.data.point.collection.handler; |
| | | |
| | | import com.iailab.framework.common.util.string.StrUtils; |
| | | import com.iailab.module.data.channel.http.collector.SourceApiEnum; |
| | | import com.iailab.module.data.channel.http.collector.ihdb.HttpCollectorForIhd; |
| | | import com.iailab.module.data.channel.opcda.collector.OpcDACollector; |
| | |
| | | pointMeasureList.forEach( |
| | | item -> { |
| | | try { |
| | | boolean hasKey = redisTemplate.hasKey(PointCollector.PV + item.getPointNo()); |
| | | Object value = CommonConstant.BAD_VALUE; |
| | | boolean hasKey = redisTemplate.hasKey(PointCollector.PV + item.getPointNo()); |
| | | if (hasKey) { |
| | | value = redisTemplate.opsForValue().get(PointCollector.PV + item.getPointNo()); |
| | | } |
| | | if(hasKey && StrUtils.isNumeric(value.toString()) && |
| | | new BigDecimal(value.toString()).compareTo(CommonConstant.BAD_VALUE) != 0 ) { |
| | | value = redisTemplate.opsForValue().get(PointCollector.PV + item.getPointNo()); |
| | | } else if (DataSourceType.OPCUA.getCode().equals(item.getSourceType())) { |
| | | value = opcUaCollector.getTagValue(item.getSourceId(), item.getTagNo()); |
| | | } else if (DataSourceType.ModBus.getCode().equals(item.getSourceType())) { |