| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.data.mongodb.core.geo.GeoJsonPoint; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | |
| | | List<XpCruisePlanPoint> planPointList = xpCruisePlanPointService.list(new LambdaQueryWrapper<XpCruisePlanPoint>().eq(XpCruisePlanPoint::getCruisePlanId, plan.getCruisePlanId()).orderByAsc(XpCruisePlanPoint::getSortOrder)); |
| | | |
| | | |
| | | XpCruisePlanPoint xpCruisePlanPoint = planPointList.get(0); |
| | | Long pointId = xpCruisePlanPoint.getPointId(); |
| | | XpPoint point = pointService.getById(pointId); |
| | | |
| | | XpCruiseOrder newXpCruiseOrder = new XpCruiseOrder(); |
| | | newXpCruiseOrder.setFleetId(dto.getFleetId()); |
| | | newXpCruiseOrder.setVehicleId(dto.getVehicleId()); |
| | |
| | | newXpCruiseOrder.setMissionId(plan.getCruisePlanId()); |
| | | newXpCruiseOrder.setStatus(1); |
| | | newXpCruiseOrder.setOrderReverse(1); |
| | | GeoJsonPoint point = dto.getPoint(); |
| | | |
| | | // 起点 |
| | | newXpCruiseOrder.setStartLon(point.getPointLon()); |
| | | newXpCruiseOrder.setStartLat(point.getPointLat()); |
| | | newXpCruiseOrder.setStartPointId(pointId); |
| | | newXpCruiseOrder.setStartPointName(point.getPointName()); |
| | | newXpCruiseOrder.setStartLon(point.getX()); |
| | | newXpCruiseOrder.setStartLat(point.getY()); |
| | | |
| | | // 终点 |
| | | |
| | | XpCruisePlanPoint endCruisePlanPoint = planPointList.get(1); |
| | | XpCruisePlanPoint endCruisePlanPoint = planPointList.get(0); |
| | | Long endPointId = endCruisePlanPoint.getPointId(); |
| | | XpPoint endPoint = pointService.getById(endPointId); |
| | | newXpCruiseOrder.setEndPointId(endPointId); |
| | |
| | | newXpCruiseOrder.setEndLat(endPoint.getPointLat()); |
| | | |
| | | |
| | | |
| | | |
| | | return R.ok(newXpCruiseOrder); |
| | | } |
| | | |