Commit 0b0d798c authored by caotao's avatar caotao

运行监盘返回数据为空问题处理。

parent fea573c4
......@@ -21,7 +21,7 @@ public class StationCacheInfoDto implements Serializable {
//所属片区
private String belongArea;
//装机容量
private String installedCapacity="0.0";
private String installedCapacity;
//设备数量
private String equipmentNumbers;
//风机网关
......
......@@ -14,7 +14,7 @@ import java.util.stream.Collectors;
public interface CoreCommonService {
/**
* @deprecated 远程调用core服务根据厂长名称
* @deprecated 远程调用core服务根据场站名称
* @param stationNames 要查的场站名称需要使用逗号分隔 eg:夏造风机,石灰山风机
* @param pointsNames 要查的测点名称需要使用逗号分隔开 eg:日发电量,月发电量,年发电
* @return CoreValuesDto
......
......@@ -28,14 +28,20 @@ public class CoreCommonServiceImpl implements CoreCommonService {
@Override
public List<CoreValuesDto> getValuesByStationNamesAndPointsNames(String stationNames, String pointsNames) {
List<CoreValuesDto> result = new ArrayList<>();
try {
FeignClientResult<List<Object>> feignClientResult = coreFeignClient.getValues(stationNames, pointsNames);
List<Object> list = feignClientResult.getResult();
List<CoreValuesDto> result = new ArrayList<>();
list.forEach(o -> {
CoreValuesDto coreValuesDto = JSONObject.parseObject(JSONObject.toJSONString(o), CoreValuesDto.class);
coreValuesDto.setDataMap(coreValuesDto.getData().stream().flatMap(m -> m.entrySet().stream()).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (a, b) -> b)));
result.add(coreValuesDto);
});
}catch (Exception e){
e.printStackTrace();
return result;
}
return result;
}
......
......@@ -254,7 +254,6 @@ public class MonitorServiceImpl implements MonitorService {
List<StationCoordinate> stationCoordinateList = stationCoordinateMapper.selectList(new QueryWrapper<StationCoordinate>().isNotNull("station_id").eq("is_main_coordinate", 0));
for (int i = 0; i < list.size(); i++) {
HashMap<String, Double> hashMap = new HashMap<>();
StationCacheInfoDto stationCacheInfoDto = list.get(i);
RegionNationWideDto regionNationWideDto = new RegionNationWideDto();
regionNationWideDto.setStaitionId(String.valueOf(stationCacheInfoDto.getStationId()));
......@@ -279,7 +278,13 @@ public class MonitorServiceImpl implements MonitorService {
speendOrirradiate =String.format(CommonConstans.Twodecimalplaces,buDunStationDetailInfo.getWind_as_irradiance());
}
}
BuDunStationDetailInfo buDunStationDetailInfo = buDunStationDetailInfos.stream().filter(buDunStationDetailInfo1 -> buDunStationDetailInfo1.getStation_name().contains(stationCacheInfoDto.getStationName().replace("风电站","").replace("风电场","").replace("光伏电站",""))).findFirst().orElse(null);
if(!ObjectUtils.isEmpty(buDunStationDetailInfo)&&!ObjectUtils.isEmpty(buDunStationDetailInfo.getWind_as_irradiance())){
speendOrirradiate = buDunStationDetailInfo.getWind_as_irradiance().toString();
if(ObjectUtils.isEmpty(regionNationWideDto.getStationCapacity())&&!ObjectUtils.isEmpty(buDunStationDetailInfo.getActual_installed_capacity())){
regionNationWideDto.setStationCapacity(buDunStationDetailInfo.getActual_installed_capacity().toString());
}
}
regionNationWideDto.setSpeendOrirradiate(speendOrirradiate);
StationCoordinate stationCoordinate = stationCoordinateList.stream().filter(stationCoordinate1 -> String.valueOf(stationCoordinate1.getStationId()).equals(stationCacheInfoDto.getStationId())).collect(Collectors.toList()).get(0);
hashMap.put("lng", Double.valueOf(stationCoordinate.getLongitude()));
......
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