| | |
| | | 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; |
| | |
| | | private OpcDACollector opcDACollector; |
| | | |
| | | @Autowired |
| | | private HttpCollectorForSS httpCollectorForSS; |
| | | private HttpCollectorForIhd httpCollectorForIhd; |
| | | |
| | | @Resource |
| | | private DaPointService daPointService; |
| | |
| | | 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 -> { |
| | |
| | | } 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()}); |
| | | } |
| | | } |
| | | }); |
| | |
| | | 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("测量点处理结束"); |
| | |
| | | } 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()); |
| | | } |