| | |
| | | } |
| | | } |
| | | MediaFileMarkEntity mediaFileMarkEntity = this.fileUploadConvertToMarkEntity(file); |
| | | String url = "http://dev.jxpskj.com:9000/cloud-bucket" + file.getObjectKey(); |
| | | String url = "http://139.196.74.78:9000/cloud-bucket" + file.getObjectKey(); |
| | | File file1 = TbFjServiceImpl.downloadFile(url); |
| | | long timestamp = convertToTimestamp(file.getMetadata().getCreatedTime()); |
| | | File file2 = new File(WaterMarkUtil.addWatermark(file1, timestamp, file.getMetadata().getShootPosition().getLat(), |
| | |
| | | mediaFileMarkEntity.setObjectKey("/mark" + file.getPath() + "/" + file.getName()); |
| | | mediaFileMarkEntity.setFileName("mark" + file.getName()); |
| | | mediaFileMarkEntity.setFilePath("mark" + file.getPath()); |
| | | String endpoint = "http://dev.jxpskj.com:9000"; |
| | | String accessKey = "pskj"; |
| | | String secretKey = "pskj@2021"; |
| | | String endpoint = "http://139.196.74.78:9000"; |
| | | String accessKey = "sxkj"; |
| | | String secretKey = "sxkj2024"; |
| | | String bucketName = "cloud-bucket"; |
| | | String objectName = mediaFileMarkEntity.getObjectKey(); // 例如 "folder/file.txt" |
| | | uploadFile(endpoint, accessKey, secretKey, bucketName, objectName, file2); |
| | |
| | | @GetMapping("/getWayline") |
| | | public ResponseResult getWayline(@RequestParam String waylineName, @RequestBody List<LotInfo> list) { |
| | | try { |
| | | MultipartFile file = timerUtil.getFile(waylineName, list); |
| | | MultipartFile file = timerUtil.getFile(waylineName, list, 25.8917266,116.020940643); |
| | | return ResponseResult.success(file); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | |
| | | public ResponseResult patchesToWayline(@RequestBody List<LotInfo> list, |
| | | @RequestParam String waylineName, |
| | | @RequestParam String workspaceId, |
| | | @RequestParam double lat, |
| | | @RequestParam double lon, |
| | | HttpServletRequest request) throws IOException { |
| | | CustomClaim customClaim = (CustomClaim) request.getAttribute(TOKEN_CLAIM); |
| | | String creator = customClaim.getUsername(); |
| | | MultipartFile file = timerUtil.getFile(waylineName, list); |
| | | MultipartFile file = timerUtil.getFile(waylineName, list,lat,lon); |
| | | waylineFileService.importKmzFileBack(file, workspaceId, creator); |
| | | WaylineFileEntity entity = waylineFileService.selectByName(waylineName); |
| | | Map<String, String> infoMap = new HashMap<>(); |
| | |
| | | //根据获取的图斑集合获得kmz航线文件 |
| | | MultipartFile multipartFile = null; |
| | | try { |
| | | multipartFile = getFile(waylineName, list); |
| | | multipartFile = getFile(waylineName, list,28.62452712442823, 115.85666327144976); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | |
| | | * @return |
| | | * @throws IOException |
| | | */ |
| | | public MultipartFile getFile(String waylineName, List<LotInfo> list) throws IOException { |
| | | List<PointPO> coordinates = GeoToolsUtil.getRoutePointOrder(list, 28.62452712442823, 115.85666327144976); |
| | | public MultipartFile getFile(String waylineName, List<LotInfo> list,double lat, double lon) throws IOException { |
| | | //南昌28.62452712442823, 115.85666327144976 瑞金 25.8917266,116.020940643 |
| | | List<PointPO> coordinates = GeoToolsUtil.getRoutePointOrder(list, lat, lon); |
| | | XMLTemplateModel xmlModel = XMLTemplateModel.init(coordinates, list); |
| | | CreateWaylineFileUtils.createWaylineFile(xmlModel, patchesConfigPojo.getTemplate(), patchesConfigPojo.getTargetTemplate(), patchesConfigPojo.getWaylines(), patchesConfigPojo.getTargetWaylines()); |
| | | // 压缩文件夹中的内容 |