This commit is contained in:
2026-07-29 13:08:49 +08:00
parent 29ecbf321f
commit 6be6d5d333
59 changed files with 1396 additions and 304 deletions

View File

@@ -1,10 +1,15 @@
package com.maibu.uav.service;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.maibu.core.business.dto.uav.FlightTaskCreateDTO;
import com.maibu.core.business.inter.uav.UAVCommandInter;
import com.maibu.uav.dto.SK2ResultDTO;
import com.maibu.utils.json.JsonUtils;
@Component
public class UAVCommamdHandler implements UAVCommandInter {
@@ -13,8 +18,18 @@ public class UAVCommamdHandler implements UAVCommandInter {
private UAVService uService;
@Override
public void createFlightTask(FlightTaskCreateDTO dto){
uService.createFlightTask(dto);
public String createFlightTask(FlightTaskCreateDTO dto) {
String json = uService.createFlightTask(dto);
SK2ResultDTO res = JsonUtils.parseObject(json, SK2ResultDTO.class);
String taskId = null;
if (res != null && res.getData() != null) {
ObjectMapper objectMapper = new ObjectMapper();
Map<String, Object> map = objectMapper.convertValue(
res.getData(),
Map.class);
taskId = (String) map.get("task_uuid");
}
return taskId;
}
}