|
|
@@ -20,7 +20,9 @@ import org.springframework.web.bind.annotation.*;
|
|
|
import reactor.core.publisher.Flux;
|
|
|
import reactor.core.publisher.Mono;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.HashSet;
|
|
|
+import java.util.List;
|
|
|
import java.util.Objects;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@@ -46,15 +48,17 @@ public class GeoController implements ReactiveTreeServiceQueryController<GeoReg
|
|
|
public Mono<?> findAllTreeTp2(@Parameter(hidden = true) QueryParamEntity paramEntity) {
|
|
|
return this.findAllChildren(paramEntity)
|
|
|
.collectSortedList()
|
|
|
- .map(result-> Tuple.of(TreeSupportEntity.list2tree(new HashSet<>(result),GeoRegionEntity::setChildren), GeoJson.of(result.stream().map(GeoRegionEntity::getRegion)
|
|
|
+ .map(result-> Tuple.of(TreeSupportEntity.list2tree(new HashSet<>(result),GeoRegionEntity::setChildren), GeoJson.ofGeoJsons(
|
|
|
+ result.stream().map(GeoRegionEntity::getRegion)
|
|
|
.filter(Objects::nonNull).collect(Collectors.toList()), "FeatureCollection")));
|
|
|
}
|
|
|
|
|
|
@GetMapping("/_query/all")
|
|
|
@QueryAction
|
|
|
@QueryOperation(summary = "使用GET动态查询并返回树形结构以及geo集合信息")
|
|
|
- public Flux<GeoRegionEntity> findAll(QueryParamEntity paramEntity) {
|
|
|
- return getService().query(paramEntity);
|
|
|
+ public Mono<List<GeoRegionEntity>> findAll(QueryParamEntity paramEntity) {
|
|
|
+ Mono<List<GeoRegionEntity>> map = getService().query(paramEntity).collectSortedList().map(result -> TreeSupportEntity.list2tree(result, GeoRegionEntity::setChildren));
|
|
|
+ return map;
|
|
|
}
|
|
|
/**
|
|
|
* 区域管理新增或新增
|