|
|
@ -178,7 +178,7 @@ public class TRecordServiceImpl implements ITRecordService
|
|
|
|
return jsonObject;
|
|
|
|
return jsonObject;
|
|
|
|
}).filter(Objects::nonNull).collect(Collectors.toList());
|
|
|
|
}).filter(Objects::nonNull).collect(Collectors.toList());
|
|
|
|
if (!CollectionUtils.isEmpty(result)){
|
|
|
|
if (!CollectionUtils.isEmpty(result)){
|
|
|
|
HashMap<String, ArrayList<String>> map = new HashMap<>();
|
|
|
|
HashMap<String, ArrayList<Object>> map = new HashMap<>();
|
|
|
|
result.forEach(jsonObject -> {
|
|
|
|
result.forEach(jsonObject -> {
|
|
|
|
getJsonData(jsonObject.getJSONObject("data"), "data", map, jsonKeyList);
|
|
|
|
getJsonData(jsonObject.getJSONObject("data"), "data", map, jsonKeyList);
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -195,24 +195,29 @@ public class TRecordServiceImpl implements ITRecordService
|
|
|
|
* @param historyDataMap 历史数据
|
|
|
|
* @param historyDataMap 历史数据
|
|
|
|
* @param removeKeyList 删除键列表
|
|
|
|
* @param removeKeyList 删除键列表
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private static void getJsonData(Object obj, String listName, HashMap<String, ArrayList<String>> historyDataMap, List<String> removeKeyList) {
|
|
|
|
private static void getJsonData(Object obj, String listName, HashMap<String, ArrayList<Object>> historyDataMap, List<String> removeKeyList) {
|
|
|
|
// aiResult结果集中只包括JSONObject,不包括JSONArray
|
|
|
|
// aiResult结果集中只包括JSONObject,不包括JSONArray
|
|
|
|
if (obj instanceof JSONObject) {
|
|
|
|
if (obj instanceof JSONObject) {
|
|
|
|
for (Map.Entry<String, Object> entry : ((JSONObject) obj).entrySet()) {
|
|
|
|
for (Map.Entry<String, Object> entry : ((JSONObject) obj).entrySet()) {
|
|
|
|
if (!(entry.getValue() instanceof String)) {
|
|
|
|
if ((entry.getValue() instanceof JSONObject)) {
|
|
|
|
getJsonData(entry.getValue(), entry.getKey(), historyDataMap, removeKeyList);
|
|
|
|
getJsonData(entry.getValue(), entry.getKey(), historyDataMap, removeKeyList);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
// 去除
|
|
|
|
// 去除带图片字段
|
|
|
|
if (removeKeyList.contains(listName)) {
|
|
|
|
if (removeKeyList.contains(listName)) {
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ArrayList<String> list;
|
|
|
|
//sz_avg_purple: { "anomaly": 0, "v": "正常" }
|
|
|
|
|
|
|
|
// anomaly属于预留字段,暂时无用; 各个任务中的字段v是任务实际值
|
|
|
|
|
|
|
|
if (!"v".equals(entry.getKey())) {
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
ArrayList<Object> list;
|
|
|
|
if (null == historyDataMap.get(listName)) {
|
|
|
|
if (null == historyDataMap.get(listName)) {
|
|
|
|
list = new ArrayList<>();
|
|
|
|
list = new ArrayList<>();
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
list = historyDataMap.get(listName);
|
|
|
|
list = historyDataMap.get(listName);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
list.add((String) entry.getValue());
|
|
|
|
list.add(entry.getValue());
|
|
|
|
historyDataMap.put(listName, list);
|
|
|
|
historyDataMap.put(listName, list);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|