From 76925315adbf96fdacf22b1b416776c25cf9d01c Mon Sep 17 00:00:00 2001 From: huguanghan Date: Wed, 6 Nov 2024 17:15:41 +0800 Subject: [PATCH] =?UTF-8?q?history=E6=8E=A5=E5=8F=A3=E5=A2=9E=E5=8A=A0199?= =?UTF-8?q?=E8=AE=A1=E7=AE=97=E9=87=8F=E6=9F=A5=E8=AF=A2=E5=8E=86=E5=8F=B2?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../das/modules/data/service/impl/DataServiceImpl.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/das/src/main/java/com/das/modules/data/service/impl/DataServiceImpl.java b/das/src/main/java/com/das/modules/data/service/impl/DataServiceImpl.java index 853424cf..9c4a109b 100644 --- a/das/src/main/java/com/das/modules/data/service/impl/DataServiceImpl.java +++ b/das/src/main/java/com/das/modules/data/service/impl/DataServiceImpl.java @@ -72,7 +72,6 @@ public class DataServiceImpl implements DataService { public Map> querySnapshotValues(List paramList) { long start = System.currentTimeMillis(); Map> result = new HashMap<>(paramList.size()); - Map> finalResult = result; ListUtil.page(paramList, COMMIT_COUNT, list -> { List keyList = new ArrayList<>(); for (int i = 0; i < list.size(); i++) { @@ -99,18 +98,18 @@ public class DataServiceImpl implements DataService { int secondColonIndex = key.indexOf(':', firstColonIndex + 1); String deviceId = key.substring(firstColonIndex + 1, secondColonIndex); String fieldName = key.substring(secondColonIndex + 1); - if (finalResult.get(deviceId) == null) { + if (result.get(deviceId) == null) { Map valueMap = new HashMap<>(); valueMap.put(fieldName, dataList.get(i)); - finalResult.put(deviceId, valueMap); + result.put(deviceId, valueMap); } else { - finalResult.get(deviceId).put(fieldName, dataList.get(i)); + result.get(deviceId).put(fieldName, dataList.get(i)); } } }); long end = System.currentTimeMillis(); log.debug("读取快照{}个,耗时: {}秒", paramList.size(), (end - start) / 1000.0); - return finalResult; + return result; } /**