a7e38004 张雷

奥体项目数据接口修改

1 个父辈 78eebf40
......@@ -1367,8 +1367,8 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
public Map<String, Object> getPumpOrFlowChart(InputQueryParams inputQueryParams) {
Map<String, Object> map = new HashMap<>();
Map<String, Object> monitorMap = new HashMap<>();
List<Map<String, Object>> pumpList = new ArrayList<>();
List<Map<String, Object>> flowList = new ArrayList<>();
List<EchartResult> pumpList = new ArrayList<>();
List<EchartResult> flowList = new ArrayList<>();
map.put("pump", new ArrayList<>());
map.put("flow", new ArrayList<>());
String timeStep = "hour";
......@@ -1422,27 +1422,39 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
}
List<Map<String, Object>> pDataList = factoryInfoService.queryReportData(AT_ID, pPgField, start, end, timeStep);
for (Map<String, Object> bmap : pDataList) {
Map<String, Object> newMap = new HashMap<>();
String time = "";
for (Map.Entry<String, Object> entry : bmap.entrySet()) {
if("time".equals(entry.getKey())){
newMap.put(entry.getKey(),entry.getValue());
}else {
newMap.put(monitorMap.get(entry.getKey()).toString(),entry.getValue());
time = entry.getValue().toString();
}
}
for (Map.Entry<String, Object> entry : bmap.entrySet()) {
if(!"time".equals(entry.getKey())){
EchartResult echartResult = new EchartResult();
echartResult.setName(time);
echartResult.setValue(entry.getValue().toString());
echartResult.setSeries(monitorMap.get(entry.getKey()).toString());
pumpList.add(echartResult);
}
}
pumpList.add(newMap);
}
List<Map<String, Object>> fDataList = factoryInfoService.queryReportData(AT_ID, fPgField, start, end, timeStep);
for (Map<String, Object> bmap : fDataList) {
Map<String, Object> newMap = new HashMap<>();
String time = "";
for (Map.Entry<String, Object> entry : bmap.entrySet()) {
if("time".equals(entry.getKey())){
newMap.put(entry.getKey(),entry.getValue());
}else {
newMap.put(monitorMap.get(entry.getKey()).toString(),entry.getValue());
time = entry.getValue().toString();
}
}
for (Map.Entry<String, Object> entry : bmap.entrySet()) {
if(!"time".equals(entry.getKey())){
EchartResult echartResult = new EchartResult();
echartResult.setName(time);
echartResult.setValue(entry.getValue().toString());
echartResult.setSeries(monitorMap.get(entry.getKey()).toString());
flowList.add(echartResult);
}
}
flowList.add(newMap);
}
map.put("pump", pumpList);
map.put("flow", flowList);
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!