a7e38004 张雷

奥体项目数据接口修改

1 个父辈 78eebf40
...@@ -1367,8 +1367,8 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService { ...@@ -1367,8 +1367,8 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
1367 public Map<String, Object> getPumpOrFlowChart(InputQueryParams inputQueryParams) { 1367 public Map<String, Object> getPumpOrFlowChart(InputQueryParams inputQueryParams) {
1368 Map<String, Object> map = new HashMap<>(); 1368 Map<String, Object> map = new HashMap<>();
1369 Map<String, Object> monitorMap = new HashMap<>(); 1369 Map<String, Object> monitorMap = new HashMap<>();
1370 List<Map<String, Object>> pumpList = new ArrayList<>(); 1370 List<EchartResult> pumpList = new ArrayList<>();
1371 List<Map<String, Object>> flowList = new ArrayList<>(); 1371 List<EchartResult> flowList = new ArrayList<>();
1372 map.put("pump", new ArrayList<>()); 1372 map.put("pump", new ArrayList<>());
1373 map.put("flow", new ArrayList<>()); 1373 map.put("flow", new ArrayList<>());
1374 String timeStep = "hour"; 1374 String timeStep = "hour";
...@@ -1422,27 +1422,39 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService { ...@@ -1422,27 +1422,39 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
1422 } 1422 }
1423 List<Map<String, Object>> pDataList = factoryInfoService.queryReportData(AT_ID, pPgField, start, end, timeStep); 1423 List<Map<String, Object>> pDataList = factoryInfoService.queryReportData(AT_ID, pPgField, start, end, timeStep);
1424 for (Map<String, Object> bmap : pDataList) { 1424 for (Map<String, Object> bmap : pDataList) {
1425 Map<String, Object> newMap = new HashMap<>(); 1425 String time = "";
1426 for (Map.Entry<String, Object> entry : bmap.entrySet()) { 1426 for (Map.Entry<String, Object> entry : bmap.entrySet()) {
1427 if("time".equals(entry.getKey())){ 1427 if("time".equals(entry.getKey())){
1428 newMap.put(entry.getKey(),entry.getValue()); 1428 time = entry.getValue().toString();
1429 }else { 1429 }
1430 newMap.put(monitorMap.get(entry.getKey()).toString(),entry.getValue()); 1430 }
1431 for (Map.Entry<String, Object> entry : bmap.entrySet()) {
1432 if(!"time".equals(entry.getKey())){
1433 EchartResult echartResult = new EchartResult();
1434 echartResult.setName(time);
1435 echartResult.setValue(entry.getValue().toString());
1436 echartResult.setSeries(monitorMap.get(entry.getKey()).toString());
1437 pumpList.add(echartResult);
1431 } 1438 }
1432 } 1439 }
1433 pumpList.add(newMap);
1434 } 1440 }
1435 List<Map<String, Object>> fDataList = factoryInfoService.queryReportData(AT_ID, fPgField, start, end, timeStep); 1441 List<Map<String, Object>> fDataList = factoryInfoService.queryReportData(AT_ID, fPgField, start, end, timeStep);
1436 for (Map<String, Object> bmap : fDataList) { 1442 for (Map<String, Object> bmap : fDataList) {
1437 Map<String, Object> newMap = new HashMap<>(); 1443 String time = "";
1438 for (Map.Entry<String, Object> entry : bmap.entrySet()) { 1444 for (Map.Entry<String, Object> entry : bmap.entrySet()) {
1439 if("time".equals(entry.getKey())){ 1445 if("time".equals(entry.getKey())){
1440 newMap.put(entry.getKey(),entry.getValue()); 1446 time = entry.getValue().toString();
1441 }else { 1447 }
1442 newMap.put(monitorMap.get(entry.getKey()).toString(),entry.getValue()); 1448 }
1449 for (Map.Entry<String, Object> entry : bmap.entrySet()) {
1450 if(!"time".equals(entry.getKey())){
1451 EchartResult echartResult = new EchartResult();
1452 echartResult.setName(time);
1453 echartResult.setValue(entry.getValue().toString());
1454 echartResult.setSeries(monitorMap.get(entry.getKey()).toString());
1455 flowList.add(echartResult);
1443 } 1456 }
1444 } 1457 }
1445 flowList.add(newMap);
1446 } 1458 }
1447 map.put("pump", pumpList); 1459 map.put("pump", pumpList);
1448 map.put("flow", flowList); 1460 map.put("flow", flowList);
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!