Selaa lähdekoodia

1.优化数据分类接口

邱宇 4 vuotta sitten
vanhempi
sitoutus
90ef57e50e

+ 8 - 12
dcuc-app-service/src/main/java/com/dragoninfo/dcuc/app/facade/DataResourceFacade.java

@@ -45,13 +45,13 @@ public class DataResourceFacade implements IDataResourceFacade {
     public List<DataClassifyVo> getDataClassifyList() {
         return getFirstChildResourceClassifies(dataResourceService.getDataClassifyList())
                 .stream()
-                .map(
+                .flatMap(
                         firstClassify -> getFirstChildResourceClassifies(firstClassify.getChildrenType()).stream()
-                                .map(
+                                .flatMap(
                                         secondClassify -> getChildrenTypeList(secondClassify.getChildrenType()).stream()
-                                                .map(
+                                                .flatMap(
                                                         thirdClassify -> getChildrenTypeList(secondClassify.getChildrenType()).stream()
-                                                                .map(
+                                                                .flatMap(
                                                                         fourClassify -> getFirstChildResourceClassifies(secondClassify.getChildrenType()).stream()
                                                                                 .map(childResourceClassify ->
                                                                                         new DataClassifyVo(firstClassify.getCodeValue(),
@@ -62,15 +62,11 @@ public class DataResourceFacade implements IDataResourceFacade {
                                                                                                 thirdClassify.getTypeName(),
                                                                                                 childResourceClassify.getCodeValue(),
                                                                                                 childResourceClassify.getCodeName())
-                                                                                ).collect(Collectors.toList())
-                                                                ).collect(Collectors.toList())
-                                                ).collect(Collectors.toList())
-                                ).collect(Collectors.toList())
+                                                                                ).collect(Collectors.toList()).stream()
+                                                                )
+                                                )
+                                )
                 )
-                .flatMap(firstClassifyList -> firstClassifyList.stream())
-                .flatMap(secondClassifyList -> secondClassifyList.stream())
-                .flatMap(thirdClassifyList -> thirdClassifyList.stream())
-                .flatMap(fourClassifyList -> fourClassifyList.stream())
                 .collect(Collectors.toList());
     }