| | |
| | | |
| | | 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.ihdb.HttpCollectorForIhd; |
| | | import com.iailab.module.data.channel.opcda.collector.OpcDACollector; |
| | | import com.iailab.module.data.common.enums.CommonConstant; |
| | |
| | | @Autowired |
| | | private HttpCollectorForIhd httpCollectorForIhd; |
| | | |
| | | @Autowired |
| | | private HttpCollectorForAsdb httpCollectorForAsdb; |
| | | |
| | | @Resource |
| | | private DaPointService daPointService; |
| | | |
| | |
| | | List<String[]> modbusTagIds = new ArrayList<>(); |
| | | List<String[]> kioTagIds = new ArrayList<>(); |
| | | List<Object[]> httpTagIhd = new ArrayList<>(); |
| | | |
| | | List<Object[]> httpTagAsdb = new ArrayList<>(); |
| | | |
| | | dtos.stream().forEach(item -> { |
| | | if (DataSourceType.OPCUA.getCode().equals(item.getSourceType())) { |
| | |
| | | if (SourceApiEnum.iHyperDB.getCode().equals(item.getSourceName())) { |
| | | if (item.getTagNo() != null && item.getDimension() != null && item.getValueType() != null) { |
| | | httpTagIhd.add(new Object[]{item.getSourceId(), item.getTagNo(), item.getDimension(), item.getValueType()}); |
| | | } |
| | | } else if (SourceApiEnum.ASDB.getCode().equals(item.getSourceName())) { |
| | | if (item.getTagNo() != null && item.getDimension() != null && item.getValueType() != null) { |
| | | httpTagAsdb.add(new Object[]{item.getSourceId(), item.getTagNo(), item.getDimension(), item.getValueType()}); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | if (!CollectionUtils.isEmpty(httpTagIhd)) { |
| | | tagValues.putAll(httpCollectorForIhd.getTagValues(httpTagIhd, collectTime)); |
| | | } |
| | | if (!CollectionUtils.isEmpty(httpTagAsdb)) { |
| | | tagValues.putAll(httpCollectorForAsdb.getTagValues(httpTagAsdb, collectTime)); |
| | | } |
| | | this.toCommonResult(collectTime, dtos, tagValues, dataMap, result,listGood,listBad); |
| | | 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 = httpCollectorForIhd.getTagValue(item.getSourceId(), item.getTagNo(), item.getDimension(), item.getValueType()); |
| | | if (SourceApiEnum.iHyperDB.getCode().equals(item.getSourceName())) { |
| | | 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 { |
| | | log.info("没有匹配的TagNo=" + item.getTagNo()); |
| | | } |