| | |
| | | @ApiOperation("查询范围内的井") |
| | | @PostMapping("/getWellListByPolygon") |
| | | AjaxResult getWellListByPolygon(@RequestBody List<Point> points) { |
| | | List<List<ArdAlarmpointsWell>> listOfLists = new ArrayList<>(); |
| | | List<SysDept> depts = deptService.selectDeptList(new SysDept()); |
| | | depts.stream().forEach(dept -> { |
| | | ArdAlarmpointsWell ardAlarmpointsWell = new ArdAlarmpointsWell(); |
| | | ardAlarmpointsWell.setDeptId(dept.getDeptId()); |
| | | List<ArdAlarmpointsWell> wellList = ardAlarmpointsWellService.selectArdAlarmpointsWellList(ardAlarmpointsWell); |
| | | List<ArdAlarmpointsWell> wells = wellList.stream() |
| | | .filter(well -> well.getLongitude() != null && well.getLatitude() != null) |
| | | .filter(well -> GisUtil.isInPolygon(new Point(well.getLongitude(), well.getLatitude()), points) |
| | | ).collect(Collectors.toList()); |
| | | listOfLists.add(wells); |
| | | }); |
| | | List<ArdAlarmpointsWell> inPolygonWellList = listOfLists.stream() |
| | | List<ArdAlarmpointsWell> inPolygonWellList = deptService.selectDeptList(new SysDept()).stream() |
| | | .map(dept -> { |
| | | ArdAlarmpointsWell ardAlarmpointsWell = new ArdAlarmpointsWell(); |
| | | ardAlarmpointsWell.setDeptId(dept.getDeptId()); |
| | | return ardAlarmpointsWellService.selectArdAlarmpointsWellList(ardAlarmpointsWell).stream() |
| | | .filter(well -> well.getLongitude() != null && well.getLatitude() != null) |
| | | .filter(well -> GisUtil.isInPolygon(new Point(well.getLongitude(), well.getLatitude()), points)) |
| | | .collect(Collectors.toList()); |
| | | }) |
| | | .flatMap(List::stream) |
| | | .collect(Collectors.toList()); |
| | | |
| | | return AjaxResult.success(inPolygonWellList); |
| | | } |
| | | } |