潘志宝
2024-10-29 d41f14d2986b46da9dd7742f6df63d9725cd29f3
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/collection/handler/MeasureHandle.java
@@ -1,6 +1,6 @@
package com.iailab.module.data.point.collection.handler;
import com.iailab.module.data.channel.http.collector.ihdb.HttpCollectorForSS;
import com.iailab.module.data.channel.http.collector.ihdb.HttpCollectorForIhd;
import com.iailab.module.data.channel.opcda.collector.OpcDACollector;
import com.iailab.module.data.common.enums.CommonConstant;
import com.iailab.module.data.common.enums.DataSourceType;
@@ -52,7 +52,7 @@
    private OpcDACollector opcDACollector;
    @Autowired
    private HttpCollectorForSS httpCollectorForSS;
    private HttpCollectorForIhd httpCollectorForIhd;
    @Resource
    private DaPointService daPointService;
@@ -68,7 +68,7 @@
        List<String[]> opcDaTagIds = new ArrayList<>();
        List<String[]> modbusTagIds = new ArrayList<>();
        List<String[]> kioTagIds = new ArrayList<>();
        List<Object[]> httpTagSS = new ArrayList<>();
        List<Object[]> httpTagIhd = new ArrayList<>();
        dtos.stream().forEach(item -> {
@@ -81,8 +81,8 @@
            } else if (DataSourceType.KIO.getCode().equals(item.getSourceType())) {
                kioTagIds.add(new String[]{item.getSourceId(), item.getTagNo()});
            } else if (DataSourceType.HTTP.getCode().equals(item.getSourceType())) {
                if (CommonConstant.HTTP_API_SHASTEEL_IH.equals(item.getSourceName())) {
                    httpTagSS.add(new Object[]{item.getSourceId(), item.getTagNo(), item.getDimension(), item.getValueType()});
                if (CommonConstant.iHyperDB.equals(item.getSourceName())) {
                    httpTagIhd.add(new Object[]{item.getSourceId(), item.getTagNo(), item.getDimension(), item.getValueType()});
                }
            }
        });
@@ -100,8 +100,8 @@
        if (!CollectionUtils.isEmpty(kioTagIds)) {
            tagValues.putAll(kingIOCollector.getTagValues(kioTagIds));
        }
        if (!CollectionUtils.isEmpty(httpTagSS)) {
            tagValues.putAll(httpCollectorForSS.getTagValues(httpTagSS));
        if (!CollectionUtils.isEmpty(httpTagIhd)) {
            tagValues.putAll(httpCollectorForIhd.getTagValues(httpTagIhd));
        }
        this.toCommonResult(collectTime, dtos, tagValues, dataMap, result);
        log.info("测量点处理结束");
@@ -178,7 +178,7 @@
                        } else if (DataSourceType.KIO.getCode().equals(item.getSourceType())) {
                            value = kingIOCollector.getTagValue(item.getSourceId(), item.getTagNo());
                        } else if (DataSourceType.HTTP.getCode().equals(item.getSourceType())) {
                            value = httpCollectorForSS.getTagValue(item.getSourceId(), item.getTagNo(), item.getDimension(), item.getValueType());
                            value = httpCollectorForIhd.getTagValue(item.getSourceId(), item.getTagNo(), item.getDimension(), item.getValueType());
                        } else {
                            log.info("没有匹配的TagNo=" + item.getTagNo());
                        }