|
|
@ -145,27 +145,4 @@ public class WaylineJobController { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/{workspace_id}/getJobFileUrlByDeviceSn") |
|
|
|
@Operation(summary = "根据设备查询飞行任务。", description = "根据设备查询飞行任务。") |
|
|
|
public void getJobFileUrlByDeviceSn(@PathVariable(name = "workspace_id") String workspaceId, |
|
|
|
@RequestParam(name = "device_sn") String deviceSn, HttpServletRequest req, HttpServletResponse rsp) { |
|
|
|
try { |
|
|
|
Optional<EventsReceiver<FlighttaskProgress>> runningWaylineJob = waylineRedisService.getRunningWaylineJob(deviceSn); |
|
|
|
if(runningWaylineJob.isEmpty()) { |
|
|
|
return; |
|
|
|
} |
|
|
|
String jobId = runningWaylineJob.get().getOutput().getExt().getFlightId(); |
|
|
|
Optional<WaylineJobDTO> waylineJobDTO = waylineJobService.getJobByJobId(workspaceId, jobId); |
|
|
|
if(waylineJobDTO.isEmpty()) { |
|
|
|
return; |
|
|
|
} |
|
|
|
URL url = waylineFileService.getObjectUrl(workspaceId, waylineJobDTO.get().getFileId()); |
|
|
|
rsp.sendRedirect(url.toString()); |
|
|
|
} catch (IOException | SQLException e) { |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|