添加日志
This commit is contained in:
parent
3f1c4c21be
commit
3d4d995d05
|
|
@ -275,17 +275,19 @@ public class AircraftFlyController extends BaseController
|
||||||
CommandResult result = future.get();
|
CommandResult result = future.get();
|
||||||
|
|
||||||
if (result.isSuccess()) {
|
if (result.isSuccess()) {
|
||||||
log.info("无人机起飞命令发送成功: sn={}", request.getSn());
|
log.info("无人机起飞命令发送成功 executeCommand: sn={}", request.getSn());
|
||||||
flightService.updateFlightStatus(request.getTaskId(), TaskResultVO.Checking());
|
flightService.updateFlightStatus(request.getTaskId(), TaskResultVO.Checking("无人机起飞命令发送成功"));
|
||||||
return R.ok("无人机起飞命令发送成功");
|
return R.ok("无人机起飞命令发送成功");
|
||||||
} else {
|
} else {
|
||||||
log.error("无人机起飞失败 无人机起飞命令发送失败: sn={}, reason={}", request.getSn(), result.getErrorMessage());
|
log.error("无人机起飞失败 无人机起飞命令发送失败: sn={}, reason={}", request.getSn(), result.getErrorMessage());
|
||||||
flightService.updateFlightStatus(request.getTaskId(), TaskResultVO.Error("人机起飞命令发送失败"));
|
flightService.updateFlightStatus(request.getTaskId(),
|
||||||
|
TaskResultVO.Error("人机起飞命令发送失败 executeCommand"+ result.getErrorMessage()));
|
||||||
return R.fail("无人机起飞命令发送失败: " + result.getErrorMessage());
|
return R.fail("无人机起飞命令发送失败: " + result.getErrorMessage());
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("无人机起飞失败 无人机起飞命令发送失败: sn={}", request.getSn(), e);
|
log.error("无人机起飞失败 无人机起飞命令发送失败: sn={}", request.getSn(), e);
|
||||||
flightService.updateFlightStatus(request.getTaskId(), TaskResultVO.Error("人机起飞命令发送失败E"));
|
flightService.updateFlightStatus(request.getTaskId(),
|
||||||
|
TaskResultVO.Error("人机起飞命令发送失败 executeCommand E" + e.getMessage()));
|
||||||
return R.fail("无人机起飞命令发送失败: " + e.getMessage());
|
return R.fail("无人机起飞命令发送失败: " + e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -126,12 +126,12 @@ public class FlightEventCallback implements IAirportFlyControlCallback, IAirport
|
||||||
String dataContent = data.getString("data");
|
String dataContent = data.getString("data");
|
||||||
if ("操作成功".equals(msg) && "[地面站]任务飞行完成".equals(dataContent)) {
|
if ("操作成功".equals(msg) && "[地面站]任务飞行完成".equals(dataContent)) {
|
||||||
log.info("【FlightEventCallback】检测到 [地面站]任务飞行完成 ,更新状态为HOME: deviceSn={}, flightId={}", deviceSn, taskId);
|
log.info("【FlightEventCallback】检测到 [地面站]任务飞行完成 ,更新状态为HOME: deviceSn={}, flightId={}", deviceSn, taskId);
|
||||||
flightService.updateFlightStatus(taskId, TaskResultVO.Completed());
|
flightService.updateFlightStatus(taskId, TaskResultVO.Completed("检测到 [地面站]任务飞行完成 ,更新状态为HOME"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ("[机巢]无人机关机成功".equals(dataContent)) {
|
if ("[机巢]无人机关机成功".equals(dataContent)) {
|
||||||
log.info("【FlightEventCallback】检测到 [机巢]无人机关机成功 ,更新状态为HOME: deviceSn={}, flightId={}", deviceSn, taskId);
|
log.info("【FlightEventCallback】检测到 [机巢]无人机关机成功 ,更新状态为HOME: deviceSn={}, flightId={}", deviceSn, taskId);
|
||||||
flightService.updateFlightStatus(taskId, TaskResultVO.Completed());
|
flightService.updateFlightStatus(taskId, TaskResultVO.Completed("[机巢]无人机关机成功 ,更新状态为HOME"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -144,7 +144,7 @@ public class FlightEventCallback implements IAirportFlyControlCallback, IAirport
|
||||||
// 检查是否自检失败(code=1 表示失败)
|
// 检查是否自检失败(code=1 表示失败)
|
||||||
if (code != null && (code == 1 || code == -1)) {
|
if (code != null && (code == 1 || code == -1)) {
|
||||||
log.info("无人机起飞失败【FlightEventCallback】检测到自检失败(code=1),更新状态为ERROR: deviceSn={}, flightId={} msg {}", deviceSn, taskId, msg);
|
log.info("无人机起飞失败【FlightEventCallback】检测到自检失败(code=1),更新状态为ERROR: deviceSn={}, flightId={} msg {}", deviceSn, taskId, msg);
|
||||||
flightService.updateFlightStatus(taskId, TaskResultVO.Error("检测到自检失败(code=1)"));
|
flightService.updateFlightStatus(taskId, TaskResultVO.Error("handleControlDataMessage 检测到自检失败(code=1)"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,8 @@ public class FlightLogCallback implements IDroneRealTimeCallback {
|
||||||
|
|
||||||
if(Boolean.FALSE.equals(result)){
|
if(Boolean.FALSE.equals(result)){
|
||||||
log.info("无人机起飞失败: sn={}", deviceSn);
|
log.info("无人机起飞失败: sn={}", deviceSn);
|
||||||
flightService.updateFlightStatus(taskId, TaskResultVO.Error("无人机起飞失败" + deviceSn));
|
flightService.updateFlightStatus(taskId, TaskResultVO.Error("无人机起飞失败 " +
|
||||||
|
"handlePreCheckLog 自检失败" + deviceSn));
|
||||||
}
|
}
|
||||||
|
|
||||||
logEntity.setLogContent(logContent);
|
logEntity.setLogContent(logContent);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue