| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/upload") |
| | | public ResponseResult uploadFile(@RequestParam("file") MultipartFile file){ |
| | | public ResponseResult uploadFile(@RequestParam("file") MultipartFile file, |
| | | @RequestParam String taskName, |
| | | @RequestParam int taskId){ |
| | | String workspaceId="4a574db8-4ad3-48f7-9f16-3edbcd8056e1"; |
| | | tbDkjbxxService.uploadFile(file); |
| | | List<TbDkjbxxEntity> list = tbDkjbxxService.list(); |
| | | shpToDataSourceService.savaInMysql(list, workspaceId); |
| | | shpToDataSourceService.savaInMysql(list, workspaceId,taskId,taskName); |
| | | return ResponseResult.success("上传成功"); |
| | | } |
| | | |
| | |
| | | tbDkjbxxService.uploadUrl(param.getDbUrl()); |
| | | String workspaceId="4a574db8-4ad3-48f7-9f16-3edbcd8056e1"; |
| | | List<TbDkjbxxEntity> list = tbDkjbxxService.list(); |
| | | shpToDataSourceService.savaInMysql(list, workspaceId); |
| | | shpToDataSourceService.savaInMysql(list, workspaceId,param.getTaskId(),param.getTaskName()); |
| | | return ResponseResult.success("上传成功"); |
| | | } |
| | | |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @PostMapping("/uploadLot") |
| | | public ResponseResult getGeo(@RequestParam String workspaceId, |
| | | @RequestParam String waylineName, |
| | | @RequestParam double airportLat, |
| | | @RequestParam double airportLon, |
| | | HttpServletRequest request) throws Exception { |
| | | List<TbDkjbxxEntity> list = tbDkjbxxService.list(); |
| | | shpToDataSourceService.savaInMysql(list, workspaceId); |
| | | MultipartFile multipartFile = tbDkjbxxService.listFile(workspaceId, waylineName, airportLat, airportLon); |
| | | CustomClaim customClaim = (CustomClaim) request.getAttribute(TOKEN_CLAIM); |
| | | String creator = customClaim.getUsername(); |
| | | waylineFileService.importKmzFileBack(multipartFile, workspaceId, creator); |
| | | WaylineFileEntity entity = waylineFileService.selectByName(waylineName); |
| | | Map<String, String> infoMap = new HashMap<>(); |
| | | URL url = null; |
| | | try { |
| | | url = waylineFileService.getObjectUrl(workspaceId, entity.getWaylineId()); |
| | | infoMap.put("url", String.valueOf(MinioUrlUtils.getUrl(url))); |
| | | infoMap.put("waylineId", entity.getWaylineId()); |
| | | } catch (SQLException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | return ResponseResult.success(infoMap); |
| | | } |
| | | // @PostMapping("/uploadLot") |
| | | // public ResponseResult getGeo(@RequestParam String workspaceId, |
| | | // @RequestParam String waylineName, |
| | | // @RequestParam double airportLat, |
| | | // @RequestParam double airportLon, |
| | | // HttpServletRequest request) throws Exception { |
| | | // List<TbDkjbxxEntity> list = tbDkjbxxService.list(); |
| | | // shpToDataSourceService.savaInMysql(list, workspaceId); |
| | | // MultipartFile multipartFile = tbDkjbxxService.listFile(workspaceId, waylineName, airportLat, airportLon); |
| | | // CustomClaim customClaim = (CustomClaim) request.getAttribute(TOKEN_CLAIM); |
| | | // String creator = customClaim.getUsername(); |
| | | // waylineFileService.importKmzFileBack(multipartFile, workspaceId, creator); |
| | | // WaylineFileEntity entity = waylineFileService.selectByName(waylineName); |
| | | // Map<String, String> infoMap = new HashMap<>(); |
| | | // URL url = null; |
| | | // try { |
| | | // url = waylineFileService.getObjectUrl(workspaceId, entity.getWaylineId()); |
| | | // infoMap.put("url", String.valueOf(MinioUrlUtils.getUrl(url))); |
| | | // infoMap.put("waylineId", entity.getWaylineId()); |
| | | // } catch (SQLException e) { |
| | | // throw new RuntimeException(e); |
| | | // } |
| | | // return ResponseResult.success(infoMap); |
| | | // } |
| | | } |