|
@@ -15,26 +15,26 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
-@RequestMapping("/site/lz_area")
|
|
|
+@RequestMapping("/site/lz_air_route")
|
|
|
@RestController
|
|
|
public class AirRouteController {
|
|
|
|
|
|
@Autowired
|
|
|
- private LzAreaService lzAreaService;
|
|
|
+ private AirRouteService routeService;
|
|
|
|
|
|
@RequestMapping("/list")
|
|
|
public BaseResult list(){
|
|
|
- List<LzArea> list = lzAreaService.findAll();
|
|
|
- list.forEach(lzArea -> {
|
|
|
- lzArea.setWkt(GeoCastUtil.geomToWkt(lzArea.getGeom()));
|
|
|
- lzArea.setPointWkt(GeoCastUtil.geomToWkt(lzArea.getPoint()));
|
|
|
+ List<AirRoute> list = routeService.findAll();
|
|
|
+ list.forEach(bean -> {
|
|
|
+ bean.setWkt(GeoCastUtil.geomToWkt(bean.getGeom()));
|
|
|
+ bean.setPointWkt(GeoCastUtil.geomToWkt(bean.getPoint()));
|
|
|
});
|
|
|
return R.succ(list);
|
|
|
}
|
|
|
|
|
|
@RequestMapping("/air_route")
|
|
|
public BaseResult airRoute(@RequestBody CommonVo commonVo){
|
|
|
- LzArea area = lzAreaService.findOne(commonVo.getId().intValue());
|
|
|
+ AirRoute area = routeService.findOne(commonVo.getId().intValue());
|
|
|
Coordinate[] coordinates = area.getGeom().getCoordinates();
|
|
|
Double[][] res = new Double[coordinates.length - 1][];
|
|
|
for(int i=0; i < coordinates.length - 1; i++){
|
|
@@ -47,10 +47,10 @@ public class AirRouteController {
|
|
|
}
|
|
|
|
|
|
@RequestMapping("/save")
|
|
|
- public BaseResult save(@RequestBody LzArea bean){
|
|
|
+ public BaseResult save(@RequestBody AirRoute bean){
|
|
|
bean.setGeom((MultiPolygon) GeoCastUtil.wktToGeom(bean.getWkt()));
|
|
|
bean.setPoint(bean.getGeom().getCentroid());
|
|
|
- lzAreaService.save(bean);
|
|
|
+ routeService.save(bean);
|
|
|
return R.succ();
|
|
|
}
|
|
|
|