| | |
| | | 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; |
| | |
| | | private void toCommonResult(Date collectTime, List<DaPointDTO> dtos, Map<String, Object> tagValues, |
| | | Map<String, Object> dataMap, List<InfluxPointValuePOJO> result,List<String> listGood,List<String> listBad) { |
| | | if (!CollectionUtils.isEmpty(tagValues)) { |
| | | tagValues.forEach((k, v) -> { |
| | | dataMap.put(k, v); |
| | | }); |
| | | // dataMap.putAll(tagValues); |
| | | dtos.forEach(dto -> { |
| | | String tagId = TagUtils.genTagId(dto.getSourceType(), dto.getSourceName(), dto.getTagNo()); |
| | | if (tagValues.containsKey(tagId)) { |
| | |
| | | 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())) { |