Commit dbaa4742 authored by chenzhao's avatar chenzhao

增加光伏 运行列表

parent f0f4c31e
......@@ -729,4 +729,25 @@ public class MonitorFanIdxController extends BaseController {
String gatewayId = stationBasic.getFanGatewayId();
return ResponseHelper.buildResponse(monitorFanIndicatorImpl.collectingBox(gatewayId,current, size ));
}
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "光伏 运行列表")
@GetMapping("/solarPowerOperation")
public ResponseModel<IPage<Map<String, Object>>> solarPowerOperation(@RequestParam(value = "stationId")String stationId,@RequestParam(value = "current") int current, int size) {
StationBasic stationBasic = stationBasicMapper.selectById(stationId);
String gatewayId = stationBasic.getFanGatewayId();
List<Map<String, Object>> statusMonitoring = monitorFanIndicator.solarPowerOperation(gatewayId);
List<Map<String, Object>> collect = statusMonitoring.stream()
.skip((long) (current - 1) * size)
.limit(size)
.collect(Collectors.toList());
IPage<Map<String,Object>> result = new Page<>();
result.setRecords(collect);
result.setCurrent(current);
result.setTotal(statusMonitoring.size());
return ResponseHelper.buildResponse(result);
}
}
......@@ -1571,5 +1571,41 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
}
public List<Map<String, Object>> solarPowerOperation(String gatewayId) {
String sql = "SELECT * FROM indicators_"+gatewayId+" WHERE equipmentIndexName = '有功功率' or equipmentIndexName = '逆变器效率' or equipmentIndexName ='总直流功率' or equipmentIndexName ='日发电量' or equipmentIndexName ='总发电量' ";
List<IndicatorsDto> list = influxDButils.getListData(sql, IndicatorsDto.class);
List<IndicatorsDto> collect = list.stream().filter(e -> StringUtils.isNotEmpty(e.getEquipmentNumber())).collect(Collectors.toList());
Map<String, List<IndicatorsDto>> collects = collect.stream().collect(Collectors.groupingBy(IndicatorsDto::getEquipmentNumber));
List<Map<String, Object>> result = new ArrayList();
for (String s : collects.keySet()){
List<IndicatorsDto> indicatorsDtos = collects.get(s);
Map<String, Object> map = new HashMap<>();
map.put("name",s);
map.put("type","兆能");//此处暂时未提供数据 待定 暂写死值
map.put("status","1");//此处暂时未提供数据 待定 暂写死值
indicatorsDtos.forEach(e->{
switch (e.getEquipmentIndexName()){
case "总直流功率":
map.put("sr",keepTwoDecimalPlaces(e.getValue()));
break;
case "有功功率":
map.put("sc",keepTwoDecimalPlaces(e.getValue()));
break;
case "逆变器效率":
map.put("efficiency",keepTwoDecimalPlaces(e.getValue()));
break;
case "日发电量":
map.put("dayNum",keepTwoDecimalPlaces(e.getValue()));
break;
case "总发电量":
map.put("yearNum",keepTwoDecimalPlaces(e.getValue()));
break;
}
});
result.add(map);
}
return result;
}
}
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