| | |
| | | .waylineType(param.getWaylineType()) |
| | | .outOfControlAction(param.getOutOfControlAction()) |
| | | .rthAltitude(param.getRthAltitude()) |
| | | .rthMode(param.getRth_mode()) |
| | | .mediaCount(0) |
| | | .parentId(param.getParentId()) |
| | | .loopSum(param.getLoopSum()) |
| | |
| | | if (WaylineTaskTypeEnum.IMMEDIATE.getVal() == param.getTaskType()) { |
| | | param.setExecuteTime(System.currentTimeMillis()); |
| | | } |
| | | param.setRth_mode(1); |
| | | Optional<WaylineJobDTO> waylineJobOpt = this.createWaylineJob(param, loginUser.getUsername(), |
| | | param.getExecuteTime(), param.getExecuteTime()); |
| | | // 循环任务 |
| | |
| | | try (InputStream inputStream = _ossService.getObject(kmzPath, minioUrl)) { |
| | | md5 = DigestUtils.md5Hex(inputStream); |
| | | url = new URL(ardRouteOpt.getPath()); |
| | | log.info("机场任务航线文件url地址:{}", url); |
| | | log.info("机场任务航线文件md5值:{}", md5); |
| | | } catch (Exception e) { |
| | | log.error("机场任务航线文件地址错误!{}", e.getMessage()); |
| | | return ResponseResult.error("机场任务航线文件地址错误!" + e.getMessage()); |
| | | } |
| | | |
| | | log.info("机场任务-rth_mode的值:{}", waylineJob.getRthMode()); |
| | | |
| | | WaylineTaskCreateDTO flightTask = WaylineTaskCreateDTO.builder() |
| | | .flightId(waylineJob.getJobId()) |
| | |
| | | .waylineType(waylineJob.getWaylineType()) |
| | | .rthAltitude(waylineJob.getRthAltitude()) |
| | | .outOfControlAction(waylineJob.getOutOfControlAction()) |
| | | .rthMode(waylineJob.getRthMode()) |
| | | .file(WaylineTaskFileDTO.builder() |
| | | .url(url.toString()) |
| | | // .fingerprint(waylineFile.get().getSign()) |
| | |
| | | .method(WaylineMethodEnum.FLIGHT_TASK_PREPARE.getMethod()) |
| | | .build(); |
| | | |
| | | // 下发参数打印 |
| | | try{ |
| | | String json = objectMapper.writeValueAsString(response); |
| | | log.info("机场下发航线任务的参数response:{}", json); |
| | | } |
| | | catch (Exception e){ |
| | | log.error("机场下发航线任务的参数response异常:{}", e.getMessage()); |
| | | } |
| | | |
| | | ServiceReply serviceReply = messageSender.publishWithReply(topic, response); |
| | | |
| | | log.info("下发任务结果: {}", serviceReply.getResult()); |
| | | |
| | | if (ResponseResult.CODE_SUCCESS != serviceReply.getResult()) { |
| | | log.info("Prepare task ====> Error code: {}", serviceReply.getResult()); |
| | | this.updateJob(WaylineJobDTO.builder() |
| | |
| | | |
| | | WaylineJobDTO job = waylineJob.get(); |
| | | WaylineTaskCreateDTO flightTask = WaylineTaskCreateDTO.builder().flightId(jobId).build(); |
| | | |
| | | // flightTask中,只有任务id是有值的,其他字段不返回 |
| | | String topic = TopicConst.THING_MODEL_PRE + TopicConst.PRODUCT + |
| | | job.getDockSn() + TopicConst.SERVICES_SUF; |
| | | CommonTopicResponse<Object> response = CommonTopicResponse.builder() |
| | |
| | | .method(WaylineMethodEnum.FLIGHT_TASK_EXECUTE.getMethod()) |
| | | .build(); |
| | | |
| | | // 下发参数打印 |
| | | try{ |
| | | String json = objectMapper.writeValueAsString(response); |
| | | log.info("机场下发-执行飞行任务-的参数response:{}", json); |
| | | } |
| | | catch (Exception e){ |
| | | log.error("机场下发-执行飞行任务-的参数response异常:{}", e.getMessage()); |
| | | } |
| | | |
| | | ServiceReply serviceReply = messageSender.publishWithReply(topic, response); |
| | | |
| | | log.info("下发-执行飞行任务-结果: {}", serviceReply.getResult()); |
| | | |
| | | if (ResponseResult.CODE_SUCCESS != serviceReply.getResult()) { |
| | | log.info("Execute job ====> Error code: {}", serviceReply.getResult()); |
| | | this.updateJob(WaylineJobDTO.builder() |
| | |
| | | // try { |
| | | // url = waylineFileService.getObjectUrl(waylineFile.get().getWaylineId()); |
| | | // url = new URL(ardRouteOpt.getUpPath()); |
| | | |
| | | Map<String, Object> jsonResourceGet = new HashMap<>(); |
| | | jsonResourceGet.put("url", url.toString()); |
| | | jsonResourceGet.put("fingerprint", md5); |
| | | |
| | | builder.data(RequestsReply.success(WaylineTaskCreateDTO.builder() |
| | | .file(WaylineTaskFileDTO.builder() |
| | | .url(url.toString()) |
| | | // .fingerprint(waylineFile.get().getSign()) |
| | | .fingerprint(md5) |
| | | .build()) |
| | | .url(url.toString()) |
| | | .fingerprint(md5) |
| | | .build()) |
| | | .build())); |
| | | |
| | | // WaylineTaskFileDTO.builder() |
| | | // .url(url.toString()) |
| | | //// .fingerprint(waylineFile.get().getSign()) |
| | | // .fingerprint(md5) |
| | | // .build() |
| | | |
| | | } catch (NullPointerException | IOException e) { |
| | | e.printStackTrace(); |
| | |
| | | .taskType(entity.getTaskType()) |
| | | .waylineType(entity.getWaylineType()) |
| | | .rthAltitude(entity.getRthAltitude()) |
| | | .rthMode(entity.getRthMode()) |
| | | .outOfControlAction(entity.getOutOfControlAction()) |
| | | .mediaCount(entity.getMediaCount()) |
| | | .loopSum(entity.getLoopSum()); |