潘志宝
2025-01-18 6a8e248a786e4a3f5ec76d46e21057f8fd84300a
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/collection/handler/MeasureHandle.java
@@ -1,5 +1,6 @@
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;
@@ -120,9 +121,7 @@
    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)) {
@@ -184,10 +183,14 @@
        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())) {