|
|
@@ -189,62 +189,65 @@ public class LabBuildFloorServiceImpl implements ILabBuildFloorService {
|
|
|
.stream()
|
|
|
.map(a->a.getId())
|
|
|
.collect(Collectors.toList());
|
|
|
- List<LabExitLineVertex> exitLineVertexList = labExitLineVertexMapper.selectExitLineVertexByIds(floorIds);
|
|
|
+
|
|
|
+ if(floorIds != null && floorIds.size()>0){
|
|
|
+ List<LabExitLineVertex> exitLineVertexList = labExitLineVertexMapper.selectExitLineVertexByIds(floorIds);
|
|
|
|
|
|
- Optional.ofNullable(buildFloorVoList).orElseGet(Collections::emptyList)
|
|
|
- .stream()
|
|
|
- .forEach(a->Optional.ofNullable(exitLineVertexList).orElseGet(Collections::emptyList)
|
|
|
- .stream()
|
|
|
- .filter(b->b.getFloorId().longValue()==a.getId().longValue())
|
|
|
- .forEach(b->{
|
|
|
- a.getExitLineVertexList().add(b);
|
|
|
-
|
|
|
- //获取布局图实验室信息信息
|
|
|
- LabBuildFloorLayout labBuildFloorLayout = new LabBuildFloorLayout();
|
|
|
- labBuildFloorLayout.setFloorId(b.getFloorId().longValue());
|
|
|
- List <LabBuildFloorLayoutVo> buildFloorLayoutVoList = labBuildFloorLayoutMapper.selectLabBuildFloorLayoutList(labBuildFloorLayout);
|
|
|
- a.getBuildFloorLayoutVoList().addAll(buildFloorLayoutVoList);
|
|
|
- //处理布局图实验室id
|
|
|
- List<Long> subIds = Optional.of(buildFloorLayoutVoList).orElseGet(Collections::emptyList)
|
|
|
- .parallelStream()
|
|
|
- .map(x->x.getSubId()).collect(Collectors.toList());
|
|
|
- List<LabSubject> subjectList = labSubjectMapper.getByIds(subIds);
|
|
|
-
|
|
|
- Optional.ofNullable(buildFloorLayoutVoList)
|
|
|
- .orElseGet(Collections::emptyList)
|
|
|
+ Optional.ofNullable(buildFloorVoList).orElseGet(Collections::emptyList)
|
|
|
+ .stream()
|
|
|
+ .forEach(a->Optional.ofNullable(exitLineVertexList).orElseGet(Collections::emptyList)
|
|
|
.stream()
|
|
|
- .forEach(x->Optional.ofNullable(subjectList)
|
|
|
- .orElseGet(Collections::emptyList)
|
|
|
- .stream()
|
|
|
- .filter(y->x.getSubId().longValue()==y.getId())
|
|
|
- .forEach(y->{
|
|
|
- if(y.getAdminId().longValue()==SecurityUtils.getUserId().longValue()){
|
|
|
- x.setLoginAdmin(true);
|
|
|
- }else{
|
|
|
- String[] safeUsers = y.getSafeUserId().split(",");
|
|
|
- for(int s=0;s<safeUsers.length;s++){
|
|
|
- if((SecurityUtils.getUserId()+"").equals(safeUsers[s])){
|
|
|
- x.setLoginAdmin(true);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- x.setSubName(y.getName());
|
|
|
- }));
|
|
|
- }));
|
|
|
-
|
|
|
- LabSparseHardware labSparseHardware = new LabSparseHardware();
|
|
|
- labSparseHardware.setType(1);
|
|
|
- labSparseHardware.setBuildId(labBuildFloorVo.getParentId());
|
|
|
- List<LabSparseHardware> sparseHardwareList = labSparseHardwareMapper.selectLabSparseHardwareList(labSparseHardware);
|
|
|
-
|
|
|
- Optional.ofNullable(buildFloorVoList).orElseGet(Collections::emptyList)
|
|
|
- .stream()
|
|
|
- .forEach(a->Optional.ofNullable(sparseHardwareList).orElseGet(Collections::emptyList)
|
|
|
- .stream()
|
|
|
- .filter(b->b.getFloorId().longValue()==a.getId().longValue())
|
|
|
- .forEach(b->{
|
|
|
- a.getSparseHardwareList().add(b);
|
|
|
- }));
|
|
|
+ .filter(b->b.getFloorId().longValue()==a.getId().longValue())
|
|
|
+ .forEach(b->{
|
|
|
+ a.getExitLineVertexList().add(b);
|
|
|
+
|
|
|
+ //获取布局图实验室信息信息
|
|
|
+ LabBuildFloorLayout labBuildFloorLayout = new LabBuildFloorLayout();
|
|
|
+ labBuildFloorLayout.setFloorId(b.getFloorId().longValue());
|
|
|
+ List <LabBuildFloorLayoutVo> buildFloorLayoutVoList = labBuildFloorLayoutMapper.selectLabBuildFloorLayoutList(labBuildFloorLayout);
|
|
|
+ a.getBuildFloorLayoutVoList().addAll(buildFloorLayoutVoList);
|
|
|
+ //处理布局图实验室id
|
|
|
+ List<Long> subIds = Optional.of(buildFloorLayoutVoList).orElseGet(Collections::emptyList)
|
|
|
+ .parallelStream()
|
|
|
+ .map(x->x.getSubId()).collect(Collectors.toList());
|
|
|
+ List<LabSubject> subjectList = labSubjectMapper.getByIds(subIds);
|
|
|
+
|
|
|
+ Optional.ofNullable(buildFloorLayoutVoList)
|
|
|
+ .orElseGet(Collections::emptyList)
|
|
|
+ .stream()
|
|
|
+ .forEach(x->Optional.ofNullable(subjectList)
|
|
|
+ .orElseGet(Collections::emptyList)
|
|
|
+ .stream()
|
|
|
+ .filter(y->x.getSubId().longValue()==y.getId())
|
|
|
+ .forEach(y->{
|
|
|
+ if(y.getAdminId().longValue()==SecurityUtils.getUserId().longValue()){
|
|
|
+ x.setLoginAdmin(true);
|
|
|
+ }else{
|
|
|
+ String[] safeUsers = y.getSafeUserId().split(",");
|
|
|
+ for(int s=0;s<safeUsers.length;s++){
|
|
|
+ if((SecurityUtils.getUserId()+"").equals(safeUsers[s])){
|
|
|
+ x.setLoginAdmin(true);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ x.setSubName(y.getName());
|
|
|
+ }));
|
|
|
+ }));
|
|
|
+
|
|
|
+ LabSparseHardware labSparseHardware = new LabSparseHardware();
|
|
|
+ labSparseHardware.setType(1);
|
|
|
+ labSparseHardware.setBuildId(labBuildFloorVo.getParentId());
|
|
|
+ List<LabSparseHardware> sparseHardwareList = labSparseHardwareMapper.selectLabSparseHardwareList(labSparseHardware);
|
|
|
+
|
|
|
+ Optional.ofNullable(buildFloorVoList).orElseGet(Collections::emptyList)
|
|
|
+ .stream()
|
|
|
+ .forEach(a->Optional.ofNullable(sparseHardwareList).orElseGet(Collections::emptyList)
|
|
|
+ .stream()
|
|
|
+ .filter(b->b.getFloorId().longValue()==a.getId().longValue())
|
|
|
+ .forEach(b->{
|
|
|
+ a.getSparseHardwareList().add(b);
|
|
|
+ }));
|
|
|
+ }
|
|
|
return buildFloorVoList;
|
|
|
}
|
|
|
}
|