Commit e42cbae0 authored by zhangsen's avatar zhangsen

紧急bug空指针问题

parent ce829da7
...@@ -29,6 +29,7 @@ import org.apache.logging.log4j.Logger; ...@@ -29,6 +29,7 @@ import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
...@@ -1011,19 +1012,17 @@ public class TopographyController extends AbstractBaseController { ...@@ -1011,19 +1012,17 @@ public class TopographyController extends AbstractBaseController {
Map<String, Map<Date, IotDataVO>> iotDataAndDateMap= new HashMap<>(); Map<String, Map<Date, IotDataVO>> iotDataAndDateMap= new HashMap<>();
finalResContainsWaterLevel.stream().forEach(item -> { finalResContainsWaterLevel.stream().forEach(item -> {
if (!CollectionUtils.isEmpty(item.getTimes())) {
containsWaterDates.addAll(item.getTimes()); containsWaterDates.addAll(item.getTimes());
Map<Date, IotDataVO> dateDataMap = new HashMap<>(); Map<Date, IotDataVO> dateDataMap = new HashMap<>();
for (int i = 0; i < item.getTimes().size(); i++) { for (int i = 0; i < item.getTimes().size(); i++) {
dateDataMap.put(item.getTimes().get(i), item.getIotData().get(i)); dateDataMap.put(item.getTimes().get(i), item.getIotData().get(i));
} }
iotDataAndDateMap.put(item.getId() + item.getEquipId(), dateDataMap); iotDataAndDateMap.put(item.getId() + item.getEquipId(), dateDataMap);
}
}); });
List<Date> collect = containsWaterDates.stream().distinct().sorted(Comparator.comparing(t -> t)).collect(Collectors.toList()); List<Date> collect = containsWaterDates.stream().distinct().sorted(Comparator.comparing(t -> t)).collect(Collectors.toList());
for (IotIndexResVo indexResVo : finalResContainsWaterLevel) { for (IotIndexResVo indexResVo : finalResContainsWaterLevel) {
IotIndexResVo iotIndexRes = new IotIndexResVo(); IotIndexResVo iotIndexRes = new IotIndexResVo();
iotIndexRes.setName(indexResVo.getName()); iotIndexRes.setName(indexResVo.getName());
...@@ -1115,14 +1114,18 @@ public class TopographyController extends AbstractBaseController { ...@@ -1115,14 +1114,18 @@ public class TopographyController extends AbstractBaseController {
} }
}); });
if (!CollectionUtils.isEmpty(equipmentSpecifics.stream().filter(equipmentIndex -> !equipmentIndex.getIsTrend()).map(EquipmentIndex::getTypeCode).distinct().collect(Collectors.toList()))) {
typeCodeList.addAll(equipmentSpecifics.stream().filter(equipmentIndex -> !equipmentIndex.getIsTrend()).map(EquipmentIndex::getTypeCode).distinct().collect(Collectors.toList())); typeCodeList.addAll(equipmentSpecifics.stream().filter(equipmentIndex -> !equipmentIndex.getIsTrend()).map(EquipmentIndex::getTypeCode).distinct().collect(Collectors.toList()));
}
if (!CollectionUtils.isEmpty(equipmentSpecifics.stream().filter(equipmentIndex -> !equipmentIndex.getIsTrend()).map(EquipmentIndex::getTypeName).distinct().collect(Collectors.toList()))) {
typeNameList.addAll(equipmentSpecifics.stream().filter(equipmentIndex -> !equipmentIndex.getIsTrend()).map(EquipmentIndex::getTypeName).distinct().collect(Collectors.toList())); typeNameList.addAll(equipmentSpecifics.stream().filter(equipmentIndex -> !equipmentIndex.getIsTrend()).map(EquipmentIndex::getTypeName).distinct().collect(Collectors.toList()));
}
if (!CollectionUtils.isEmpty(equipmentSpecifics.stream().filter(equipmentIndex -> !equipmentIndex.getIsTrend()).map(t -> {
return t.getPerfQuotaDefinitionId() + iotCode;
}).distinct().collect(Collectors.toList()))) {
indexKeyList.addAll(equipmentSpecifics.stream().filter(equipmentIndex -> !equipmentIndex.getIsTrend()).map(t -> { indexKeyList.addAll(equipmentSpecifics.stream().filter(equipmentIndex -> !equipmentIndex.getIsTrend()).map(t -> {
return t.getPerfQuotaDefinitionId() + iotCode; return t.getPerfQuotaDefinitionId() + iotCode;
}).distinct().collect(Collectors.toList())); }).distinct().collect(Collectors.toList())); }
} }
allKeys = typeCodeList.stream().distinct().collect(Collectors.joining(",")); allKeys = typeCodeList.stream().distinct().collect(Collectors.joining(","));
names = typeNameList.stream().distinct().collect(Collectors.joining(",")); names = typeNameList.stream().distinct().collect(Collectors.joining(","));
......
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