修改人工拍照图片保存,新增面状航线保存、修改接口,图斑文件上传格式修改
15 files modified
272 ■■■■ changed files
src/main/java/com/dji/sample/media/model/MediaFileNailEntity.java 4 ●●●● patch | view | raw | blame | history
src/main/java/com/dji/sample/media/service/impl/FileServiceImpl.java 25 ●●●●● patch | view | raw | blame | history
src/main/java/com/dji/sample/patches/config/pojo/PatchesConfigPojo.java 14 ●●●●● patch | view | raw | blame | history
src/main/java/com/dji/sample/patches/controller/PatchesController.java 2 ●●● patch | view | raw | blame | history
src/main/java/com/dji/sample/patches/service/impl/GetPatchesServiceImpl.java 63 ●●●● patch | view | raw | blame | history
src/main/java/com/dji/sample/patches/utils/ShapeFileUtil.java 32 ●●●●● patch | view | raw | blame | history
src/main/java/com/dji/sample/patches/utils/TimerUtil.java 3 ●●●● patch | view | raw | blame | history
src/main/java/com/dji/sample/patches/xml/mode/XMLTemplateModel.java 6 ●●●● patch | view | raw | blame | history
src/main/java/com/dji/sample/patches/xml/utils/CreateWaylineFileUtils.java 4 ●●●● patch | view | raw | blame | history
src/main/java/com/dji/sample/wayline/plane/controller/CreateWayLineController.java 59 ●●●● patch | view | raw | blame | history
src/main/java/com/dji/sample/wayline/plane/param/CreateWaylineParam.java 2 ●●●●● patch | view | raw | blame | history
src/main/java/com/dji/sample/wayline/service/IWaylineFileService.java 2 ●●● patch | view | raw | blame | history
src/main/java/com/dji/sample/wayline/service/impl/WaylineFileServiceImpl.java 37 ●●●●● patch | view | raw | blame | history
src/main/resources/application-dev.yml 13 ●●●●● patch | view | raw | blame | history
src/main/resources/application-prod.yml 6 ●●●●● patch | view | raw | blame | history
src/main/java/com/dji/sample/media/model/MediaFileNailEntity.java
@@ -69,4 +69,8 @@
    @TableField("job_name")
    private String jobName;
    @TableField(value = "drone_data", typeHandler = FastjsonTypeHandler.class)
    private Object dronedata;
}
src/main/java/com/dji/sample/media/service/impl/FileServiceImpl.java
@@ -118,23 +118,22 @@
        fileEntity.setFileId(UUID.randomUUID().toString());
        int count=mapper.insert(fileEntity);
        String url = pojo.getEndpoint() + "/" + pojo.getBucket() + file.getObjectKey();
        updateStatue(file.getName());
        if (!file.getObjectKey().endsWith(".mp4")){
            if (file.getObjectKey().endsWith(".jpeg")) {
        File file1 = TbFjServiceImpl.downloadFile(url);
        saveNailFile(workspaceId,file,file1);
        Object data = ImgUtil.getInfo(file1);
        fileEntity.setDroneData(data);
                saveNailFile(workspaceId, file, file1,data);
                count = mapper.insert(fileEntity);
        file1.delete();
        }
        else {
            File file1 = TbFjServiceImpl.downloadFile(url);
            saveNailFile(workspaceId,file,file1);
            file1.delete();
            if (file.getObjectKey().endsWith(".mp4")) {
                saveNailFile(workspaceId, file, null,null);
        }
        return count;
    }
    public void saveNailFile(String workspaceId,FileUploadDTO file,File file1) throws IOException {
    public void saveNailFile(String workspaceId, FileUploadDTO file, File file1,Object data) throws IOException {
        updateStatue(file.getName());
        boolean endsWith = file.getObjectKey().endsWith(".mp4");
        if (endsWith) {
            MediaFileNailEntity nailEntity = this.fileUploadConvertToNailEntity((file));
@@ -145,6 +144,7 @@
            File nailFile = new File(ImgZipUtil.compressImage(file1, 50).toURI());
            MediaFileNailEntity nailEntity = this.fileUploadConvertToNailEntity(file);
            nailEntity.setIsOriginal(false);
            nailEntity.setDronedata(data);
            nailEntity.setWorkspaceId(workspaceId);
            nailEntity.setFileName("nail" + file.getName());
            nailEntity.setObjectKey("/nail" + file.getPath() + "/" + file.getName());
@@ -152,6 +152,7 @@
            String nailName = nailEntity.getObjectKey();
            nailEntity.setFileId(UUID.randomUUID().toString());
            uploadFile(pojo.getEndpoint(), pojo.getAccessKey(), pojo.getSecretKey(), pojo.getBucket(), nailName, nailFile, "image/jpeg");
            uploadFile("http://139.196.74.78:9000", "sxkj", "sxkj2024", "cloud-bucket", nailName, nailFile, "image/jpeg");
            nailMapper.insert(nailEntity);
        }
    }
@@ -169,6 +170,7 @@
            }
        }
    }
    @Override
    public Object mediaInfo(String filename) {
        String name = filename;
@@ -432,6 +434,7 @@
        }
        return ResponseResult.success("下载成功");
    }
    @Override
    public List<String> getUniqueFilePaths(List<String> jobIds) {
        return mapper.selectList(
@@ -442,6 +445,7 @@
                .distinct()
                .collect(Collectors.toList());
    }
    @Override
    public List<MediaFileDTO> getFilesByWorkspaceAndJobId(String workspaceId, String jobId) {
        return mapper.selectList(new LambdaQueryWrapper<MediaFileEntity>()
@@ -580,6 +584,7 @@
        return builder.build();
    }
    public static void uploadFile(String endpoint, String accessKey, String secretKey, String bucketName, String objectName, File file, String type) {
        try {
            // 创建MinIO客户端实例
@@ -804,6 +809,7 @@
            e.printStackTrace();
        }
    }
    @Override
    public PaginationData<MediaFileEntity> getJobId(int pageNum, int pageSize, String workspaceId) {
        List<MediaFileEntity> allRecords = new ArrayList<>();
@@ -858,8 +864,6 @@
    }
    @Override
    public PaginationData<MediaFileEntity> getPhotoByJobId(int pageNum, int pageSize, String workspaceId, String jobId) {
@@ -897,7 +901,6 @@
        return new PaginationData<>(pagedUniqueFiles, pagination);
    }
    public List<MediaFileEntity> getMedia(String jobId) {
src/main/java/com/dji/sample/patches/config/pojo/PatchesConfigPojo.java
@@ -23,13 +23,27 @@
    private String destKMZFile;
    @Value("${patches.url.path.kmz.sourceDir}")
    private String sourceDir;
    @Value("${patches.url.path.kmz.planeKmzFile}")
    private String planeKMZFile;
    @Value("${patches.xml.temple.template}")
    private String template;
    @Value("${patches.xml.temple.waylines}")
    private String waylines;
    @Value("${patches.xml.temple.planeTemplate}")
    private String planeTemplate;
    @Value("${patches.xml.temple.planeWaylines}")
    private String planeWaylines;
    @Value("${patches.xml.target.template}")
    private String targetTemplate;
    @Value("${patches.xml.target.waylines}")
    private String targetWaylines;
    @Value("${patches.xml.target.planeTemplate}")
    private String planeTargetTemplate;
    @Value("${patches.xml.target.planeWaylines}")
    private String planeTargetWaylines;
}
src/main/java/com/dji/sample/patches/controller/PatchesController.java
@@ -140,7 +140,7 @@
    public ResponseResult patchesToWayline(@RequestBody List<LotInfo> lotInfos,
                                           @RequestParam String waylineName,
                                           @RequestParam String workspaceId,
                                           @RequestParam String patchesId,
                                           @RequestParam (required = false) String patchesId,
                                           @RequestParam double lat,
                                           @RequestParam double lon,
                                           @RequestParam(defaultValue = "1",required = false) String isTemp,
src/main/java/com/dji/sample/patches/service/impl/GetPatchesServiceImpl.java
@@ -95,36 +95,37 @@
    @Override
    public PaginationData getPhoto(PatchesParam param, String dkbh) {
        LotInfo lotInfo = getLotinfoToDb(dkbh);
        int statue = lotInfo.getIsPush();
        if (statue == 1) {
            List<MediaFileMarkEntity> allResults = markMapper.selectList(
                    new LambdaQueryWrapper<MediaFileMarkEntity>()
                            .like(MediaFileMarkEntity::getFileName, "%" + dkbh + "~" + "%"));
            // 去重处理
            Map<String, MediaFileMarkEntity> uniqueFileMap = new LinkedHashMap<>();
            List<MediaFileMarkEntity> uniqueResults = allResults.stream()
                    .filter(mediaFile -> uniqueFileMap.putIfAbsent(mediaFile.getFileName(), mediaFile) == null)
                    .collect(Collectors.toList());
            // 计算分页信息
            int total = uniqueResults.size();
            int start = (param.getPage() - 1) * param.getPageSize();
            int end = Math.min(start + param.getPageSize(), total);
            // 获取当前页的结果
            List<MediaFileMarkEntity> pageResults = uniqueResults.subList(start, end);
            // 创建临时的 Page 对象
            Page<MediaFileMarkEntity> resultPage = new Page<>(param.getPage(), param.getPageSize());
            resultPage.setRecords(pageResults);
            resultPage.setTotal(total);
            // 返回分页数据
            return new PaginationData<>(pageResults, new Pagination(resultPage));
        } else {
//        LotInfo lotInfo = getLotinfoToDb(dkbh);
//        int statue = lotInfo.getIsPush();
//
//        if (statue == 1) {
//            List<MediaFileMarkEntity> allResults = markMapper.selectList(
//                    new LambdaQueryWrapper<MediaFileMarkEntity>()
//                            .like(MediaFileMarkEntity::getFileName, "%" + dkbh + "~" + "%"));
//
//            // 去重处理
//            Map<String, MediaFileMarkEntity> uniqueFileMap = new LinkedHashMap<>();
//            List<MediaFileMarkEntity> uniqueResults = allResults.stream()
//                    .filter(mediaFile -> uniqueFileMap.putIfAbsent(mediaFile.getFileName(), mediaFile) == null)
//                    .collect(Collectors.toList());
//
//            // 计算分页信息
//            int total = uniqueResults.size();
//            int start = (param.getPage() - 1) * param.getPageSize();
//            int end = Math.min(start + param.getPageSize(), total);
//
//            // 获取当前页的结果
//            List<MediaFileMarkEntity> pageResults = uniqueResults.subList(start, end);
//
//            // 创建临时的 Page 对象
//            Page<MediaFileMarkEntity> resultPage = new Page<>(param.getPage(), param.getPageSize());
//            resultPage.setRecords(pageResults);
//            resultPage.setTotal(total);
//
//            // 返回分页数据
//            return new PaginationData<>(pageResults, new Pagination(resultPage));
//        }
//        else {
            List<MediaFileEntity> allResults = fileMapper.selectList(
                    new LambdaQueryWrapper<MediaFileEntity>()
                            .like(MediaFileEntity::getFileName, "%" + dkbh + "~" + "%"));
@@ -151,7 +152,7 @@
            // 返回分页数据
            return new PaginationData<>(pageResults, new Pagination(resultPage));
        }
    }
//    }
src/main/java/com/dji/sample/patches/utils/ShapeFileUtil.java
@@ -22,6 +22,9 @@
import java.io.StringWriter;
import java.util.*;
import static com.dji.sample.patches.utils.TimerUtil.getNowDay;
import static com.dji.sample.patches.utils.TimerUtil.getNowTimeName;
public class ShapeFileUtil {
    //将文件解压
@@ -83,20 +86,43 @@
                byte[] b = temp.getBytes("iso8859-1");
                temp = new String(b, "gbk");
                JSONObject json = JSONObject.parseObject(temp);
                shpDTO.setDKFW(json.getJSONObject("geometry").get("coordinates").toString());
                shpDTO.setGEO(json.getJSONObject("geometry").get("type").toString());
                shpDTO.setXZQDM(json.getJSONObject("properties").get("XZQDM").toString());
            shpDTO.setDKFW(json.getJSONObject("geometry").getString("coordinates"));
            if ((json.getJSONObject("geometry").get("type")) != null) {
                shpDTO.setGEO(json.getJSONObject("geometry").getString("type"));
            }
            if ((json.getJSONObject("properties").get("XZQDM")) != null) {
                shpDTO.setXZQDM(json.getJSONObject("properties").getString("XZQDM"));
            }
            if ((json.getJSONObject("properties").getDouble("XZB")) != null &&
                    json.getJSONObject("properties").getDouble("YZB") != null) {
                double[] xy = getLongitudeLatitude(CoordinateSystemUtil.pointCGCStoWGS(
                                json.getJSONObject("properties").getDouble("XZB"),
                                json.getJSONObject("properties").getDouble("YZB")));
                shpDTO.setXZB(xy[0]);
                shpDTO.setYZB(xy[1]);
            }
            if ((json.getJSONObject("properties").getString("JCBH") != null)) {
                shpDTO.setDKBH(json.getJSONObject("properties").getString("JCBH"));
            }else {
                shpDTO.setDKBH(getNowDay());
            }
            if (json.getJSONObject("properties").getDouble("JCMC") != null) {
                shpDTO.setJCMJ(json.getJSONObject("properties").getDouble("JCMC"));
            }
            if (json.getJSONObject("properties").getString("TBLX") != null) {
                shpDTO.setTBLX(json.getJSONObject("properties").getString("TBLX"));
            }
            if (json.getJSONObject("properties").getString("DDTC") != null) {
                shpDTO.setDDTC(json.getJSONObject("properties").getString("DDTC"));
            }
            if (json.getJSONObject("properties").getString("HSX") != null) {
                shpDTO.setHSX(json.getJSONObject("properties").getString("HSX"));
            }
            if (json.getJSONObject("properties").getString("JCLX") != null) {
                shpDTO.setJCLX(json.getJSONObject("properties").getString("JCLX"));
            }
                dtoList.add(shpDTO);
            }
            iterator.close();
src/main/java/com/dji/sample/patches/utils/TimerUtil.java
@@ -660,7 +660,6 @@
    public static String getNowTimeName() {
        LocalDateTime currentTime = LocalDateTime.now();
        // 格式化时间,生成当前时间
        return "云飞行计划" + currentTime.format(DateTimeFormatter.ofPattern("MMddHHmmssSS"));
    }
@@ -669,6 +668,6 @@
        LocalDateTime currentTime = LocalDateTime.now();
        // 格式化时间,生成当前时间
        return "云飞行计划" + currentTime.format(DateTimeFormatter.ofPattern("MMdd"));
        return currentTime.format(DateTimeFormatter.ofPattern("MMddHHmmssSSS"));
    }
}
src/main/java/com/dji/sample/patches/xml/mode/XMLTemplateModel.java
@@ -231,8 +231,8 @@
        XMLTemplateModel xmlModel = XMLTemplateModel.initPolygon(param);
        //生成航线文件
        CreateWaylineFileUtils.createWaylineFileByPolygon(xmlModel, "src\\main\\resources\\template\\template-polygon.xml", "src\\main\\resources\\template\\wpmz2\\template.xml");
        CreateWaylineFileUtils.createWaylineFileByPolygon(xmlModel, "src\\main\\resources\\template\\waylines-polygon.xml", "src\\main\\resources\\template\\wpmz2\\waylines.xml");
        CreateWaylineFileUtils.createWaylineFileByPolygon(xmlModel, "src\\main\\resources\\template\\template-polygon.xml", "src\\main\\resources\\template\\wpmz\\template.kml");
        CreateWaylineFileUtils.createWaylineFileByPolygon(xmlModel, "src\\main\\resources\\template\\waylines-polygon.xml", "src\\main\\resources\\template\\wpmz\\waylines.wpml");
    }
    //新建点航线测试
@@ -261,7 +261,7 @@
//        XMLTemplateModel xmlModel = XMLTemplateModel.init(coordinates, list);
//
//        //生成航线文件
//        CreateWaylineFileUtils.createWaylineFile(xmlModel, "src\\main\\resources\\template\\template.xml", "src\\main\\resources\\template\\wpmz\\template.xml", "src\\main\\resources\\template\\waylines.xml", "src\\main\\resources\\template\\wpmz\\waylines.xml");
//        CreateWaylineFileUtils.createWaylineFile(xmlModel, "src\\main\\resources\\template\\template.kml", "src\\main\\resources\\template\\wpmz\\template.kml", "src\\main\\resources\\template\\waylines.wpml", "src\\main\\resources\\template\\wpmz\\waylines.wpml");
//
//
//    }
src/main/java/com/dji/sample/patches/xml/utils/CreateWaylineFileUtils.java
@@ -23,8 +23,8 @@
     */
    public static void createWaylineFile(XMLTemplateModel xmlModel,String templeFilePath,String targetTempleFilePath,String waylineFilePath,String targetWaylineFilePath) {
//        xml2XmlDoc(xmlModel, "home\\drone\\server\\template\\template.xml", "home\\drone\\server\\template\\wpmz\\template.kml");
//        xml2XmlDoc(xmlModel, "home\\drone\\server\\template\\waylines.xml", "home\\drone\\server\\template\\wpmz\\waylines.wpml");
//        xml2XmlDoc(xmlModel, "home\\drone\\server\\template\\template.kml", "home\\drone\\server\\template\\wpmz\\template.kml");
//        xml2XmlDoc(xmlModel, "home\\drone\\server\\template\\waylines.wpml", "home\\drone\\server\\template\\wpmz\\waylines.wpml");
        xml2XmlDoc(xmlModel, templeFilePath, targetTempleFilePath);
        xml2XmlDoc(xmlModel, waylineFilePath, targetWaylineFilePath);
src/main/java/com/dji/sample/wayline/plane/controller/CreateWayLineController.java
@@ -1,11 +1,25 @@
package com.dji.sample.wayline.plane.controller;
import com.dji.sample.common.model.CustomClaim;
import com.dji.sample.common.model.ResponseResult;
import com.dji.sample.patches.config.pojo.PatchesConfigPojo;
import com.dji.sample.patches.utils.MultipartFileTOFileUtil;
import com.dji.sample.patches.utils.TimerUtil;
import com.dji.sample.patches.utils.ZipUtil;
import com.dji.sample.patches.xml.mode.XMLTemplateModel;
import com.dji.sample.patches.xml.utils.CreateWaylineFileUtils;
import com.dji.sample.wayline.plane.PlaneCourseUtils;
import com.dji.sample.wayline.plane.param.CreateWaylineParam;
import com.dji.sample.wayline.service.IWaylineFileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.io.IOException;
import static com.dji.sample.component.AuthInterceptor.TOKEN_CLAIM;
/**
 * @Author AIX
@@ -15,25 +29,54 @@
@RestController
@RequestMapping("/wayline/plane/createWayline")
public class CreateWayLineController {
    @Autowired
    private PatchesConfigPojo patchesConfigPojo;
    @Autowired
    private IWaylineFileService waylineFileService;
    @PostMapping("/createPoints")
    public ResponseResult createPoints(@RequestBody CreateWaylineParam param) {
        return ResponseResult.success(PlaneCourseUtils.createWaylinePoints(param));
    }
    @PostMapping("/saveWayLineFile")
    public ResponseResult saveWayLineFile(@RequestBody CreateWaylineParam param) {
    @PostMapping("/{workspace_id}/saveWayLineFile")
    public ResponseResult saveWayLineFile(@PathVariable(name = "workspace_id") String workspaceId,
                                          @RequestBody CreateWaylineParam param,
                                          HttpServletRequest request
    ) throws IOException {
        CustomClaim customClaim = (CustomClaim) request.getAttribute(TOKEN_CLAIM);
        String creator = customClaim.getUsername();
        // 初始化模板对象
        XMLTemplateModel xmlModel = XMLTemplateModel.initPolygon(param);
        //生成航线文件
        CreateWaylineFileUtils.createWaylineFileByPolygon(xmlModel, "src\\main\\resources\\template\\template-polygon.xml", "src\\main\\resources\\template\\wpmz2\\template.xml");
        CreateWaylineFileUtils.createWaylineFileByPolygon(xmlModel, "src\\main\\resources\\template\\waylines-polygon.xml", "src\\main\\resources\\template\\wpmz2\\waylines.xml");
        CreateWaylineFileUtils.createWaylineFileByPolygon(xmlModel, patchesConfigPojo.getPlaneTemplate(), patchesConfigPojo.getPlaneTargetTemplate());
        CreateWaylineFileUtils.createWaylineFileByPolygon(xmlModel, patchesConfigPojo.getPlaneWaylines(), patchesConfigPojo.getPlaneTargetWaylines());
        //kmz、上传航线库
        String destKMZFile = patchesConfigPojo.getPlaneKMZFile() + param.getWaylineName() + ".kmz"; // 输出的KMZ文件路径
        ZipUtil.zipFolder(patchesConfigPojo.getSourceDir(), destKMZFile);
        MultipartFile multipartFile = MultipartFileTOFileUtil.convert(new File(destKMZFile));
        waylineFileService.importKmzFile(multipartFile, workspaceId, creator, null, "1");
        return ResponseResult.success();
    }
    @PutMapping("/{workspace_id}/updateWayLineFile/{id}")
    public ResponseResult updateWayLineFile(@PathVariable(name = "workspace_id") String workspaceId,
                                            @PathVariable(name = "id") String id,
                                            @RequestBody CreateWaylineParam param,
                                            HttpServletRequest request) throws IOException {
        CustomClaim customClaim = (CustomClaim) request.getAttribute(TOKEN_CLAIM);
        String creator = customClaim.getUsername();
        String newName = param.getWaylineName() + TimerUtil.getNowDay();
//         初始化模板对象
        XMLTemplateModel xmlModel = XMLTemplateModel.initPolygon(param);
//        生成航线文件
        CreateWaylineFileUtils.createWaylineFileByPolygon(xmlModel, patchesConfigPojo.getPlaneTemplate(), patchesConfigPojo.getPlaneTargetTemplate());
        CreateWaylineFileUtils.createWaylineFileByPolygon(xmlModel, patchesConfigPojo.getPlaneWaylines(), patchesConfigPojo.getPlaneTargetWaylines());
//        kmz、上传航线库
        String destKMZFile = patchesConfigPojo.getPlaneKMZFile() + newName + ".kmz"; // 输出的KMZ文件路径
        ZipUtil.zipFolder(patchesConfigPojo.getSourceDir(), destKMZFile);
        MultipartFile multipartFile = MultipartFileTOFileUtil.convert(new File(destKMZFile));
        waylineFileService.importPlaneKmzFile(multipartFile, workspaceId, creator, newName, id);
        return ResponseResult.success();
    }
}
src/main/java/com/dji/sample/wayline/plane/param/CreateWaylineParam.java
@@ -61,4 +61,6 @@
     */
    private PayloadInfo payloadInfo;
    private String waylineName;
}
src/main/java/com/dji/sample/wayline/service/IWaylineFileService.java
@@ -99,7 +99,7 @@
     */
    WaylineFileDTO importKmzFileBack (MultipartFile file, String workspaceId, String creator);
    WaylineFileEntity selectByName(String name);
    WaylineFileDTO importPlaneKmzFile (MultipartFile file, String workspaceId, String creator,String newName,String id);
    List<WaylineListDTO> waylineList(String workspaceId,String droneName);
    int updateWayline(WaylineFileEntity entity);
src/main/java/com/dji/sample/wayline/service/impl/WaylineFileServiceImpl.java
@@ -138,7 +138,6 @@
        WaylineFileEntity file = this.dtoConvertToEntity(metadata);
        file.setWaylineId(UUID.randomUUID().toString());
        file.setWorkspaceId(workspaceId);
        if (!StringUtils.hasText(file.getSign())) {
            try (InputStream object = ossService.getObject(OssConfiguration.bucket, metadata.getObjectKey())) {
                if (object.available() == 0) {
@@ -153,6 +152,23 @@
        int insertId = mapper.insert(file);
        return insertId > 0 ? file.getId() : insertId;
    }
    public Integer updateWaylineFile(String workspaceId, String newName, String id) {
        String objectKey = "/" + newName;
        LambdaUpdateWrapper<WaylineFileEntity> updateWrapper = new LambdaUpdateWrapper<>();
        updateWrapper.eq(WaylineFileEntity::getWaylineId, id)
                .eq(WaylineFileEntity::getWorkspaceId, workspaceId)
                .set(WaylineFileEntity::getObjectKey, objectKey);
        // 使用 mapper 执行更新操作
        boolean updated = mapper.update(null, updateWrapper) > 0;
        if (!updated) {
            throw new RuntimeException("更新 objectKey 失败");
        }
        return updated ? 1 : 0; // 返回更新结果
    }
    @Override
    public Integer saveWaylineFiles(String workspaceId, WaylineFileDTO metadata, String patchesId,String isTemp) {
@@ -261,6 +277,25 @@
        }
        return waylineFile;
    }
    @Override
    public WaylineFileDTO importPlaneKmzFile(MultipartFile file, String workspaceId, String creator,String newName,String id) {
        WaylineFileDTO waylineFile = null;
        Optional<WaylineFileDTO> waylineFileOpt = validKmzFile(file);
        if (waylineFileOpt.isEmpty()) {
            throw new RuntimeException("文件格式错误");
        }
        try {
            waylineFile = waylineFileOpt.get();
            waylineFile.setWaylineId(workspaceId);
            waylineFile.setUsername(creator);
            ossService.putObject(OssConfiguration.bucket, waylineFile.getObjectKey(), file.getInputStream());
            this.updateWaylineFile(workspaceId,newName,id);
        } catch (IOException e) {
            e.printStackTrace();
        }
        return waylineFile;
    }
    @Override
    public WaylineFileEntity selectByName(String name) {
src/main/resources/application-dev.yml
@@ -85,10 +85,10 @@
oss:
  enable: true
  provider: minio
  endpoint: http://139.196.74.78:9000
  external-endpoint: http://139.196.74.78:9000
  access-key: sxkj
  secret-key: sxkj2024
  endpoint: http://dev.jxpskj.com:9000
  external-endpoint: http://dev.jxpskj.com:9000
  access-key: pskj
  secret-key: pskj@2021
  bucket: cloud-bucket
  expire: 3600
  region: us-east-1
@@ -102,15 +102,20 @@
      unzip: src/main/resources/tmp/
      kmz:
        destKMZFile: src/main/resources/template/kmz/
        planeKmzFile: src/main/resources/template/kmz2/
        sourceDir: src/main/resources/template/wpmz/
  xml:
    temple:
      template: src/main/resources/template/template.xml
      waylines: src/main/resources/template/waylines.xml
      planeTemplate: src/main/resources/template/template-polygon.xml
      planeWaylines: src/main/resources/template/waylines-polygon.xml
    target:
      template: src/main/resources/template/wpmz/template.kml
      waylines: src/main/resources/template/wpmz/waylines.wpml
      planeTemplate: src/main/resources/template/wpmz/template.kml
      planeWaylines: src/main/resources/template/wpmz/waylines.wpml
db:
src/main/resources/application-prod.yml
@@ -113,15 +113,21 @@
      unzip: /home/drone/server/temp/
      kmz:
        destKMZFile: /home/drone/server/template/kmz/
        planeKmzFile: /home/drone/server/template/kmz2/
        sourceDir: /home/drone/server/template/wpmz/
#解析图斑航线模板的地址
  xml:
    temple:
      template: /home/drone/server/template/template.xml
      waylines: /home/drone/server/template/waylines.xml
      planeTemplate: /home/drone/server/template/template-polygon.xml
      planeWaylines: /home/drone/server/template/waylines-polygon.xml
    target:
      template: /home/drone/server/template/wpmz/template.kml
      waylines: /home/drone/server/template/wpmz/waylines.wpml
      planeTemplate: /home/drone/server/template/wpmz/template.kml
      planeWaylines: /home/drone/server/template/wpmz/waylines.wpml
db:
  sqlite: