| | |
| | | import com.ard.route.domain.WaypointTurnReq; |
| | | import com.ard.route.domain.kml.*; |
| | | import com.ard.route.domain.route.ArdRouteInfo; |
| | | import com.ard.route.domain.vo.KmzInfoVO; |
| | | import com.ard.route.domain.vo.KmzInfoVo; |
| | | import com.ard.route.domain.vo.KmzResultVo; |
| | | import com.ard.route.enums.kml.ExitOnRCLostEnums; |
| | | import com.ard.route.service.IArdRouteInfoService; |
| | |
| | | } |
| | | |
| | | // 获取文件 |
| | | String minioUrlName = subStringMinioUrlName(routeInformation.getUpPath()); |
| | | String minioUrlName = subStringMinioUrlName(routeInformation.getPath()); |
| | | try (InputStream inputStream = ossService.getObject(kmzPath,minioUrlName); |
| | | ArchiveInputStream archiveInputStream = new ZipArchiveInputStream(inputStream)){ |
| | | ArchiveEntry entry; |
| | |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | result.setUpPath(localFilePath + fileName + ".kmz"); |
| | | result.setPath(localFilePath + fileName + ".kmz"); |
| | | return result; |
| | | }else { |
| | | try (ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
| | |
| | | new ByteArrayInputStream(baos.toByteArray()) |
| | | ); |
| | | String kmzFilePath = ossService.upload(kmzPath,multipartFile); |
| | | result.setUpPath(kmzFilePath); |
| | | result.setPath(kmzFilePath); |
| | | return result; |
| | | } catch (Exception e) { |
| | | throw new RuntimeException("KMZ文件生成或上传失败", e); |
| | |
| | | * 解析kmz文件 |
| | | */ |
| | | @Override |
| | | public KmzInfoVO parseKmz(String fileUrl){ |
| | | KmzInfoVO kmzInfoVO = new KmzInfoVO(); |
| | | public KmzInfoVo parseKmz(String fileUrl){ |
| | | KmzInfoVo kmzInfoVO = new KmzInfoVo(); |
| | | try (InputStream inputStream = ossService.getObject(kmzPath,fileUrl); |
| | | ArchiveInputStream archiveInputStream = new ZipArchiveInputStream(inputStream)){ |
| | | ArchiveEntry entry; |
| | |
| | | } |
| | | |
| | | // 获取文件 |
| | | String minioUrl = subStringMinioUrlName(routeInformation.getUpPath()); |
| | | String minioUrl = subStringMinioUrlName(routeInformation.getPath()); |
| | | try (InputStream inputStream = ossService.getObject(kmzPath,minioUrl); |
| | | ArchiveInputStream archiveInputStream = new ZipArchiveInputStream(inputStream)){ |
| | | ArchiveEntry entry; |