提交 e3cc2dfc authored 作者: zhoushaopan's avatar zhoushaopan

fix(3D模块): 修改3D对象为null的情况

修改3D对象为null的情况
上级 b9db508d
...@@ -1325,17 +1325,17 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService { ...@@ -1325,17 +1325,17 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
Map<Integer, DeviceLibraryPosition> positionMap = Map<Integer, DeviceLibraryPosition> positionMap =
deviceLibraryPositionService.findByDeviceIds(deviceIds).stream().collect(toMap(DeviceLibraryPosition::getDeviceId, Function.identity())); deviceLibraryPositionService.findByDeviceIds(deviceIds).stream().collect(toMap(DeviceLibraryPosition::getDeviceId, Function.identity()));
//取出key 在3d的装备id //取出key 在3d的装备id
Set<Integer> integers = positionMap.keySet(); // Set<Integer> integers = positionMap.keySet();
//然后就行过滤 //然后就行过滤
deviceLibraries = deviceLibraries.stream().filter(deviceLibrary -> integers.contains(deviceLibrary.getId())) // deviceLibraries = deviceLibraries.stream().filter(deviceLibrary -> integers.contains(deviceLibrary.getId()))
.collect(Collectors.toList()); // .collect(Collectors.toList());
List<AllVO> allVOS = new ArrayList<>(); List<AllVO> allVOS = new ArrayList<>();
//开始遍历装备 //开始遍历装备
deviceLibraries.forEach(deviceLibrary -> { deviceLibraries.forEach(deviceLibrary -> {
AllVO allVO = new AllVO(); AllVO allVO = new AllVO();
//开始赋值 //开始赋值
allVO.setDeviceLibrary(deviceLibrary); allVO.setDeviceLibrary(deviceLibrary);
DeviceLibraryPosition deviceLibraryPosition = positionMap.getOrDefault(deviceLibrary.getId(),null); DeviceLibraryPosition deviceLibraryPosition = positionMap.getOrDefault(deviceLibrary.getId(),new DeviceLibraryPosition());
if (deviceLibraryPosition != null){ if (deviceLibraryPosition != null){
toJson(deviceLibraryPosition); toJson(deviceLibraryPosition);
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论