Commit 630cafa4 authored by caotao's avatar caotao

功率曲线-获取下拉框数据接口提交

parent 9efd6b70
...@@ -57,6 +57,14 @@ public class MonitoringMapController extends BaseController { ...@@ -57,6 +57,14 @@ public class MonitoringMapController extends BaseController {
public ResponseModel<List<HashMap<String,Object>>> getNationalPowerGenerationData() { public ResponseModel<List<HashMap<String,Object>>> getNationalPowerGenerationData() {
return ResponseHelper.buildResponse(monitoringServiceImpl.getNationalPowerGenerationData()); return ResponseHelper.buildResponse(monitoringServiceImpl.getNationalPowerGenerationData());
} }
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(value = "获取监盘全国地图-获取功率曲线下拉框数据")
@GetMapping("/getSelectDataForNational")
public ResponseModel<List<HashMap<String,Object>>> getSelectDataForNational() {
return ResponseHelper.buildResponse(monitoringServiceImpl.getSelectDataForNational());
}
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(value = "获取区域电量指标完成情况") @ApiOperation(value = "获取区域电量指标完成情况")
@GetMapping("/getCompletionOfPowerIndicatorsByProvinceName") @GetMapping("/getCompletionOfPowerIndicatorsByProvinceName")
......
...@@ -912,19 +912,20 @@ public class MonitoringServiceImpl { ...@@ -912,19 +912,20 @@ public class MonitoringServiceImpl {
stationBasic.setAddress(String.format("%.2f", commonServiceImpl.getTotalByIndicatior(mapList, "年发电量"))); stationBasic.setAddress(String.format("%.2f", commonServiceImpl.getTotalByIndicatior(mapList, "年发电量")));
} else { } else {
mapList = influxdbUtil.query("SELECT * FROM indicators_" + stationBasic.getFanGatewayId() + " where frontModule=~/逆变器/ and (equipmentIndexName='日发电量' or equipmentIndexName='月发电量' or equipmentIndexName='年发电量' )"); 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, "年发电量") / 10000));
} }
}); });
List<StationBasic> fdzList = stationBasicListAll.stream().filter(stationBasic -> stationBasic.getStationType().equals("FDZ")).collect(Collectors.toList()); 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> 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()); List<StationBasic> fbsgfdzList = stationBasicListAll.stream().filter(stationBasic -> stationBasic.getStationType().equals("FBSGFDZ")).collect(Collectors.toList());
resultHashMap.add(getTableByStationListAndTitle("风电年发电量 (万kWh)",fdzList,"#0060ff")); resultHashMap.add(getTableByStationListAndTitle("风电年发电量 (万kWh)", fdzList, "#0060ff"));
resultHashMap.add(getTableByStationListAndTitle("分布式光伏年发电量 (万kWh)",fbsgfdzList,"#fdaa04")); resultHashMap.add(getTableByStationListAndTitle("分布式光伏年发电量 (万kWh)", fbsgfdzList, "#fdaa04"));
resultHashMap.add(getTableByStationListAndTitle("集中式光伏年发电量 (万kWh)",jzsgfdzList,"#ec18f7")); resultHashMap.add(getTableByStationListAndTitle("集中式光伏年发电量 (万kWh)", jzsgfdzList, "#ec18f7"));
return resultHashMap; return resultHashMap;
} }
public HashMap<String,Object> getTableByStationListAndTitle(String title,List<StationBasic> stationBasicList,String color){
HashMap<String,Object> hashMap =new HashMap<>(); 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> xData = new ArrayList<>();
List<String> yData = new ArrayList<>(); List<String> yData = new ArrayList<>();
stationBasicList.forEach(stationBasic -> { stationBasicList.forEach(stationBasic -> {
...@@ -937,4 +938,24 @@ public class MonitoringServiceImpl { ...@@ -937,4 +938,24 @@ public class MonitoringServiceImpl {
hashMap.put("yData", yData); hashMap.put("yData", yData);
return hashMap; return hashMap;
} }
public List<HashMap<String, Object>> getSelectDataForNational() {
List<HashMap<String, Object>> hashMapList = new ArrayList<>();
List<StationBasic> stationBasicList = stationBasicMapper.selectList(new QueryWrapper<StationBasic>().isNotNull("belong_area").isNotNull("fan_gateway_id"));
List<Region> regionList = this.regionMapper.selectList(new QueryWrapper<Region>().eq("level", 1));
regionList.forEach(region -> {
HashMap<String, Object> hashMap = new HashMap<>();
hashMap.put("label", region.getRegionName());
hashMap.put("value", region.getRegionCode());
List<HashMap<String, Object>> children = stationBasicList.stream().filter(stationBasic -> stationBasic.getBelongArea().contains(String.valueOf(region.getRegionCode()))).map(stationBasic -> {
HashMap<String, Object> hashMap1 = new HashMap<>();
hashMap1.put("label", stationBasic.getStationName());
hashMap1.put("value", stationBasic.getSequenceNbr());
return hashMap1;
}).collect(Collectors.toList());
hashMap.put("children", children);
hashMapList.add(hashMap);
});
return hashMapList;
}
} }
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