Parcourir la source

区域信息修改为数据库

hexiao il y a 1 an
Parent
commit
78d8ac5239

+ 7 - 3
application-webadmin/src/main/java/com/ankaibei/workFlow/webadmin/api/AreaApiService.java

@@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -35,9 +36,12 @@ public class AreaApiService implements AreaApi {
                 BeanUtils.copyProperties(o, areaInfo);
                 return areaInfo;
             }).collect(Collectors.toList());
-            List<AreaInfo> areaInfos = buildData(collect, list);
-            // 构建树
-            return buildTree(areaInfos, list);
+            for (AreaInfo areaInfo : collect) {
+                List<AreaInfo> areaInfos = buildData(Arrays.asList(areaInfo), list);
+                // 构建树
+                areaInfo.setDistricts(buildTree(areaInfos, list));
+            }
+            return collect;
         }
         return new ArrayList<>();
 //        return GaoDeWebUtil.getInfoLikeKeywordsAndSubdistrict(keywords, subdistrict);