Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
27f3163b92
@ -72,7 +72,6 @@ public class DataServiceImpl implements DataService {
|
|||||||
public Map<String, Map<String, Object>> querySnapshotValues(List<SnapshotValueQueryParam> paramList) {
|
public Map<String, Map<String, Object>> querySnapshotValues(List<SnapshotValueQueryParam> paramList) {
|
||||||
long start = System.currentTimeMillis();
|
long start = System.currentTimeMillis();
|
||||||
Map<String, Map<String, Object>> result = new HashMap<>(paramList.size());
|
Map<String, Map<String, Object>> result = new HashMap<>(paramList.size());
|
||||||
Map<String, Map<String, Object>> finalResult = result;
|
|
||||||
ListUtil.page(paramList, COMMIT_COUNT, list -> {
|
ListUtil.page(paramList, COMMIT_COUNT, list -> {
|
||||||
List<String> keyList = new ArrayList<>();
|
List<String> keyList = new ArrayList<>();
|
||||||
for (int i = 0; i < list.size(); i++) {
|
for (int i = 0; i < list.size(); i++) {
|
||||||
@ -99,18 +98,18 @@ public class DataServiceImpl implements DataService {
|
|||||||
int secondColonIndex = key.indexOf(':', firstColonIndex + 1);
|
int secondColonIndex = key.indexOf(':', firstColonIndex + 1);
|
||||||
String deviceId = key.substring(firstColonIndex + 1, secondColonIndex);
|
String deviceId = key.substring(firstColonIndex + 1, secondColonIndex);
|
||||||
String fieldName = key.substring(secondColonIndex + 1);
|
String fieldName = key.substring(secondColonIndex + 1);
|
||||||
if (finalResult.get(deviceId) == null) {
|
if (result.get(deviceId) == null) {
|
||||||
Map<String, Object> valueMap = new HashMap<>();
|
Map<String, Object> valueMap = new HashMap<>();
|
||||||
valueMap.put(fieldName, dataList.get(i));
|
valueMap.put(fieldName, dataList.get(i));
|
||||||
finalResult.put(deviceId, valueMap);
|
result.put(deviceId, valueMap);
|
||||||
} else {
|
} else {
|
||||||
finalResult.get(deviceId).put(fieldName, dataList.get(i));
|
result.get(deviceId).put(fieldName, dataList.get(i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
long end = System.currentTimeMillis();
|
long end = System.currentTimeMillis();
|
||||||
log.debug("读取快照{}个,耗时: {}秒", paramList.size(), (end - start) / 1000.0);
|
log.debug("读取快照{}个,耗时: {}秒", paramList.size(), (end - start) / 1000.0);
|
||||||
return finalResult;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user