| | |
| | | package com.ard.work.service.impl; |
| | | |
| | | import com.ard.common.config.OssConfiguration; |
| | | import com.ard.common.utils.file.MinioUtil; |
| | | import com.ard.oss.service.impl.OssServiceContext; |
| | | import com.ard.work.config.WaylinePlaningConfig; |
| | | import com.ard.work.domain.dto.wayline.*; |
| | | import com.ard.work.domain.entity.UavWayline; |
| | |
| | | |
| | | @Resource |
| | | private UavWaylineMapper uavWaylineMapper; |
| | | |
| | | @Resource |
| | | private OssServiceContext ossService; |
| | | |
| | | private Document initWayline(Boolean isTemplate) { |
| | | //创建Document对象 |
| | |
| | | InputStream inputStream = new FileInputStream(kmzPath); |
| | | //构建记录 |
| | | String objectKey = fileName; |
| | | //若已经存在,则先删除,再添加 |
| | | if (MinioUtil.exists(OssConfiguration.bucket, objectKey)) |
| | | MinioUtil.delete(OssConfiguration.bucket, objectKey); |
| | | String kmzUrl = MinioUtil.uploadInputStream(OssConfiguration.bucket, objectKey, inputStream, |
| | | inputStream.available(), "application/octet-stream"); |
| | | String kmzUrl = ossService.upload(OssConfiguration.bucket, objectKey, inputStream); |
| | | // 更新航线kmz地址 |
| | | UavWayline uavWayline = UavWayline.builder() |
| | | .id(ardWaylineDTO.waylineId) |