实时数据查询,历史区间数据查询接口新增

This commit is contained in:
huguanghan 2024-10-21 17:11:57 +08:00
parent e3c6d293b6
commit ca0195cb38

View File

@ -114,10 +114,19 @@ public class DataService {
lowSpeedField.add(field);
}
}
Map<String, Map<String, Map<String, Object>>> lowHistoryCurve = tdEngineService.fetchLowHistoryCurve(irn, startTime, endTime, interval, lowSpeedField);
Map<String, Map<String, Map<String, Object>>> result = new HashMap<>();
if (!CollectionUtils.isEmpty(highSpeedField)) {
Map<String, Map<String, Map<String, Object>>> highHistoryCurve = tdEngineService.fetchHighHistoryCurve(irn, startTime, endTime, interval, highSpeedField);
Map<String, Map<String, Map<String, Object>>> result = new HashMap<>(lowHistoryCurve);
result.get(irn.toString()).putAll(highHistoryCurve.get(irn.toString()));
result.putAll(highHistoryCurve);
}
if (!CollectionUtils.isEmpty(lowSpeedField)) {
Map<String, Map<String, Map<String, Object>>> lowHistoryCurve = tdEngineService.fetchLowHistoryCurve(irn, startTime, endTime, interval, lowSpeedField);
if (result.get(irn.toString()) == null) {
result.putAll(lowHistoryCurve);
} else {
result.get(irn.toString()).putAll(lowHistoryCurve.get(irn.toString()));
}
}
return result;
}