潘志宝
7 天以前 f7819b4bc08d3ee2fc391b79da8480e7c85d64fd
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/collection/handler/MeasureHandle.java
@@ -3,6 +3,7 @@
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.asdb.HttpCollectorForAsdb;
import com.iailab.module.data.channel.http.collector.asdb.HttpCollectorForAsdc;
import com.iailab.module.data.channel.http.collector.asdb.HttpCollectorForAsde;
import com.iailab.module.data.channel.http.collector.ihdb.HttpCollectorForIhd;
import com.iailab.module.data.channel.opcda.collector.OpcDACollector;
@@ -63,6 +64,9 @@
    @Autowired
    private HttpCollectorForAsde httpCollectorForAsde;
    @Autowired
    private HttpCollectorForAsdc httpCollectorForAsdc;
    @Resource
    private DaPointService daPointService;
@@ -83,6 +87,7 @@
        List<Object[]> httpTagIhd = new ArrayList<>();
        List<Object[]> httpTagAsdb = new ArrayList<>();
        List<Object[]> httpTagAsde = new ArrayList<>();
        List<Object[]> httpTagAsdc = new ArrayList<>();
        dtos.stream().forEach(item -> {
            if (DataSourceType.OPCUA.getCode().equals(item.getSourceType())) {
@@ -105,6 +110,10 @@
                } else if (SourceApiEnum.ASDE.getCode().equals(item.getSourceName())) {
                    if (item.getTagNo() != null && item.getDimension() != null && item.getValueType() != null) {
                        httpTagAsde.add(new Object[]{item.getSourceId(), item.getTagNo(), item.getDimension(), item.getValueType()});
                    }
                } else if (SourceApiEnum.ASDC.getCode().equals(item.getSourceName())) {
                    if (item.getTagNo() != null && item.getDimension() != null && item.getValueType() != null) {
                        httpTagAsdc.add(new Object[]{item.getSourceId(), item.getTagNo(), item.getDimension(), item.getValueType()});
                    }
                }
            }
@@ -132,6 +141,9 @@
        if (!CollectionUtils.isEmpty(httpTagAsde)) {
            tagValues.putAll(httpCollectorForAsde.getTagValues(httpTagAsde, collectTime));
        }
        if (!CollectionUtils.isEmpty(httpTagAsdc)) {
            tagValues.putAll(httpCollectorForAsdc.getTagValues(httpTagAsdc, collectTime));
        }
        this.toCommonResult(collectTime, dtos, tagValues, dataMap, result,listGood,listBad);
        log.info("测量点处理结束");
        return result;
@@ -155,7 +167,7 @@
                    pojo.setTimestamp(collectTime.toInstant());
                    result.add(pojo);
                    listBad.add(dto.getPointNo());
                    System.out.println("值异常!TagId=" + tagId);
                    log.info("值异常!TagId=" + tagId);
                }
            });
        }
@@ -221,6 +233,10 @@
                                value = httpCollectorForIhd.getTagValue(item.getSourceId(), item.getTagNo(), item.getDimension(), item.getValueType());
                            } else if (SourceApiEnum.ASDB.getCode().equals(item.getSourceName())) {
                                value = httpCollectorForAsdb.getTagValue(item.getSourceId(), item.getTagNo());
                            } else if (SourceApiEnum.ASDE.getCode().equals(item.getSourceName())) {
                                value = httpCollectorForAsde.getTagValue(item.getSourceId(), item.getTagNo());
                            } else if (SourceApiEnum.ASDC.getCode().equals(item.getSourceName())) {
                                value = httpCollectorForAsdc.getTagValue(item.getSourceId(), item.getTagNo());
                            }
                        } else {
                            log.info("没有匹配的TagNo=" + item.getTagNo());