Commit 832d88f3 authored by kiritoausna's avatar kiritoausna

拼装完毕

parent 1d2be9a9
...@@ -195,6 +195,7 @@ public class WebMonitorChartServiceImpl extends ServiceImpl<WebMonitorChartMappe ...@@ -195,6 +195,7 @@ public class WebMonitorChartServiceImpl extends ServiceImpl<WebMonitorChartMappe
for (WebMonitorPointsVo point : points) { for (WebMonitorPointsVo point : points) {
List<HashMap<String, Object>> items = point.getItems(); List<HashMap<String, Object>> items = point.getItems();
for (HashMap<String, Object> item : items) { for (HashMap<String, Object> item : items) {
String string = item.get("name").toString();
StringBuffer stringBuffer1 = new StringBuffer(); StringBuffer stringBuffer1 = new StringBuffer();
stringBuffer1.append("( "); stringBuffer1.append("( ");
String id1 = (String) item.get("id"); String id1 = (String) item.get("id");
...@@ -227,17 +228,27 @@ public class WebMonitorChartServiceImpl extends ServiceImpl<WebMonitorChartMappe ...@@ -227,17 +228,27 @@ public class WebMonitorChartServiceImpl extends ServiceImpl<WebMonitorChartMappe
// //
HashMap<String, Object> map = new HashMap<>(); HashMap<String, Object> map = new HashMap<>();
//遍历键值 //遍历键值
for (Map keyMap : keys) { for (int i = 0; i < keys.size(); i++) {
Map keyMap = keys.get(i);
String name = keyMap.get("name").toString(); String name = keyMap.get("name").toString();
String key = keyMap.get("key").toString(); String key = keyMap.get("key").toString();
System.out.println("key = " + key);
String value = data.get(key).toString(); String value = data.get(key).toString();
System.out.println("value = " + value);
StringBuffer stringBuffer = new StringBuffer(); StringBuffer stringBuffer = new StringBuffer();
stringBuffer.append(name).append(": ").append(value).append(" ").append(item.get("unit")); stringBuffer.append(name).append(": ").append(value).append(" ").append(item.get("unit"));
String string = stringBuffer.toString(); String string1 = stringBuffer.toString();
data.put(key, string); System.out.println("string1 = " + string1);
stringBuffer.append(string).append(","); if (i < keys.size()-1) {
stringBuffer1.append(string1).append(",");
} else {
stringBuffer1.append(string1);
}
} }
stringBuffer1.append(" )"); stringBuffer1.append(" )");
item.put("name", string + stringBuffer1.toString());
item.put("realdata", data); item.put("realdata", data);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment