| | |
| | | @Override |
| | | public MinioUploadResult uploadArdRouteInfo(MultipartFile file) { |
| | | try { |
| | | String url = ossService.upload("kmz",file); |
| | | String urlDock = ossDockService.upload("kmz",file); |
| | | ArdRouteInfo information = new ArdRouteInfo(); |
| | | information.setName(file.getOriginalFilename()); |
| | | information.setPath(url); |
| | | information.setPath1(urlDock); |
| | | information.setGroupId("0"); // 默认分组 |
| | | information.setReadOnly("1"); // 默认只读 |
| | | // 增加航线实体类信息 |
| | | UavRouteReq uavRouteReq = fileConversionEntity(file); |
| | | ArdRouteInfo ardRouteInfo = new ArdRouteInfo(); |
| | | if (uavRouteReq != null){ |
| | | information.setUavRouteReq(uavRouteReq); |
| | | information.setType(templateTypeData(uavRouteReq)); |
| | | information.setAircraft(droneTypeData(uavRouteReq)); |
| | | ardRouteInfo.setUavRouteReq(uavRouteReq); |
| | | ardRouteInfo.setType(templateTypeData(uavRouteReq)); |
| | | ardRouteInfo.setAircraft(droneTypeData(uavRouteReq)); |
| | | } |
| | | insertRouteInfomation(information); |
| | | // 判断禁飞区 |
| | | List<RoutePointReq> routePointList = ardRouteInfo.getUavRouteReq().getRoutePointList(); |
| | | for (RoutePointReq routePointReq : routePointList) { |
| | | ArdNoflyDto ardNoflyDto = new ArdNoflyDto(); |
| | | ardNoflyDto.setCurrent(new Vertex(routePointReq.getLongitude(), routePointReq.getLatitude())); |
| | | verifyNoFlyZone(ardNoflyDto); |
| | | } |
| | | String url = ossService.upload("kmz",file); |
| | | String urlDock = ossDockService.upload("kmz",file); |
| | | ardRouteInfo.setName(file.getOriginalFilename()); |
| | | ardRouteInfo.setPath(url); |
| | | ardRouteInfo.setPath1(urlDock); |
| | | ardRouteInfo.setGroupId("0"); // 默认分组 |
| | | ardRouteInfo.setReadOnly("1"); // 默认只读 |
| | | insertRouteInfomation(ardRouteInfo); |
| | | return MinioUploadResult.builder() |
| | | .url(url) |
| | | .newFileName(FileUtils.getName(url)) |