Commit 9efd6b70 authored by caotao's avatar caotao

监盘全国发电量接口新增颜色返回

parent 37eb7d0a
......@@ -909,21 +909,21 @@ public class MonitoringServiceImpl {
List<Map<String, Object>> mapList;
if (stationBasic.getStationType().equals("FDZ")) {
mapList = influxdbUtil.query("SELECT * FROM indicators_" + stationBasic.getFanGatewayId() + " where (equipmentIndexName='日发电量' or equipmentIndexName='月发电量' or equipmentIndexName='年发电量' )");
stationBasic.setAddress(String.format("%.2f", commonServiceImpl.getTotalByIndicatior(mapList, "年发电量")));
} else {
mapList = influxdbUtil.query("SELECT * FROM indicators_" + stationBasic.getFanGatewayId() + " where frontModule=~/逆变器/ and (equipmentIndexName='日发电量' or equipmentIndexName='月发电量' or equipmentIndexName='年发电量' )");
stationBasic.setAddress(String.format("%.2f", commonServiceImpl.getTotalByIndicatior(mapList, "年发电量")/10000));
}
stationBasic.setAddress(String.format("%.2f", commonServiceImpl.getTotalByIndicatior(mapList, "年发电量")));
});
List<StationBasic> fdzList = stationBasicListAll.stream().filter(stationBasic -> stationBasic.getStationType().equals("FDZ")).collect(Collectors.toList());
List<StationBasic> jzsgfdzList = stationBasicListAll.stream().filter(stationBasic -> stationBasic.getStationType().equals("JZSGFDZ")).collect(Collectors.toList());
List<StationBasic> fbsgfdzList = stationBasicListAll.stream().filter(stationBasic -> stationBasic.getStationType().equals("FBSGFDZ")).collect(Collectors.toList());
resultHashMap.add(getTableByStationListAndTitle("风电年发电量 (万kWh)",fdzList));
resultHashMap.add(getTableByStationListAndTitle("分布式光伏年发电量 (万kWh)",fbsgfdzList));
resultHashMap.add(getTableByStationListAndTitle("集中式光伏年发电量 (万kWh)",jzsgfdzList));
resultHashMap.add(getTableByStationListAndTitle("风电年发电量 (万kWh)",fdzList,"#0060ff"));
resultHashMap.add(getTableByStationListAndTitle("分布式光伏年发电量 (万kWh)",fbsgfdzList,"#fdaa04"));
resultHashMap.add(getTableByStationListAndTitle("集中式光伏年发电量 (万kWh)",jzsgfdzList,"#ec18f7"));
return resultHashMap;
}
public HashMap<String,Object> getTableByStationListAndTitle(String title,List<StationBasic> stationBasicList){
public HashMap<String,Object> getTableByStationListAndTitle(String title,List<StationBasic> stationBasicList,String color){
HashMap<String,Object> hashMap =new HashMap<>();
List<String> xData = new ArrayList<>();
List<String> yData = new ArrayList<>();
......@@ -932,6 +932,7 @@ public class MonitoringServiceImpl {
yData.add(stationBasic.getAddress());
});
hashMap.put("title", title);
hashMap.put("color", color);
hashMap.put("xData", xData);
hashMap.put("yData", yData);
return hashMap;
......
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