| | |
| | | return ResponseResult.success(data); |
| | | } |
| | | |
| | | @GetMapping("/{workspace_id}/formatWayline") |
| | | @SysLogAnnotation(operModul = "航线库", operType = "查询", operDesc = "根据查询条件查询临时航路线文件的基本数据") |
| | | public ResponseResult<PaginationData<WaylineFileDTO>> getShowWaylinesPagination(@RequestParam(name = "order_by") String orderBy, |
| | | @RequestParam(required = false) boolean favorited, @RequestParam Integer page, |
| | | @RequestParam(name = "page_size", defaultValue = "10") Integer pageSize, |
| | | @RequestParam(name = "template_type", required = false) Integer[] templateType, |
| | | @PathVariable(name = "workspace_id") String workspaceId) { |
| | | WaylineQueryParam param = WaylineQueryParam.builder() |
| | | .favorited(favorited) |
| | | .page(page) |
| | | .pageSize(pageSize) |
| | | .orderBy(orderBy) |
| | | .templateType(templateType) |
| | | .build(); |
| | | PaginationData<WaylineFileDTO> data = waylineFileService.getShowWaylinesByParam(workspaceId, param); |
| | | return ResponseResult.success(data); |
| | | } |
| | | |
| | | /** |
| | | * 根据wayline文件id查询文件的下载地址; |
| | | * 和重定向到此地址直接下载。 |
| | |
| | | } catch (IOException | SQLException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | @GetMapping("/{workspace_id}/getWayline") |
| | | public ResponseResult getWaylineByJobId( |
| | | @PathVariable(name = "workspace_id") String workspaceId, |
| | | @RequestParam String jobId) { |
| | | return ResponseResult.success(waylineFileService.getWaylineByWaylineId(workspaceId,jobId)); |
| | | } |
| | | |
| | | @GetMapping("/{workspace_id}/waylines/{wayline_id}/urlData") |
| | |
| | | public ResponseResult importKmzFile(@PathVariable(name = "workspace_id") String workspaceId, |
| | | HttpServletRequest request, MultipartFile file, |
| | | @RequestParam(required = false) String patchesId, |
| | | @RequestParam(required = false) String spotInFreckle |
| | | @RequestParam(defaultValue = "1",required = false) String isTemp |
| | | ) { |
| | | if (Objects.isNull(file)) { |
| | | return ResponseResult.error("未上传文件"); |
| | | } |
| | | CustomClaim customClaim = (CustomClaim) request.getAttribute(TOKEN_CLAIM); |
| | | String creator = customClaim.getUsername(); |
| | | String back = waylineFileService.importKmzFile(file, workspaceId, creator, patchesId, spotInFreckle); |
| | | String back = waylineFileService.importKmzFile(file, workspaceId, creator, patchesId,isTemp,0); |
| | | if (back != null) { |
| | | return ResponseResult.error(back); |
| | | } |