瀏覽代碼

重构定点飞行代码

tags/v1.2.0^2
wanjing 1 年之前
父節點
當前提交
294cc4c52a
共有 1 個文件被更改,包括 7 次插入9 次删除
  1. +7
    -9
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/airport/PointFlightService.java

+ 7
- 9
tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/airport/PointFlightService.java 查看文件

@@ -56,31 +56,29 @@ public class PointFlightService {
Tenant tenant = this.getTenant(tenantId);

// 创建应急任务
ThMission mission = this.createMission(user, request);

log.info("进入调用机场平台,执行定点飞行, mission = {}", mission);
ThMission emergencyMission = this.createMission(user, request);

// 调用机场平台
// 修改原巡检任务状态为已完成
if (TaskStatusEnum.COMPLETE.getCode() == mission.getStatus()) {
if (TaskStatusEnum.COMPLETE.getCode() == oldMission.getStatus()) {
log.info("执行定点飞行, 原巡检任务已完成");
// 巡检任务已经结束
// 再次选择原来机场进行定点飞行,
if (mission.getAirportId() == request.getAirportId()) {
if (emergencyMission.getAirportId() == request.getAirportId()) {
log.info("新机场执行定点飞行");
} else {
log.info("新机场执行定点飞行");
}
this.callNewAirpor(tenant, request, mission.getId());
this.callNewAirpor(tenant, request, emergencyMission.getId());
} else {
log.info("执行定点飞行, 原巡检任务在执行");
if (oldMission.getAirportId().equals(request.getAirportId())) {
log.info("原机场执行定点飞行");
oldMission.setEmergencyDataMissionId(mission.getId());
oldMission.setEmergencyDataMissionId(emergencyMission.getId());
this.callOldAirpor(request);
} else {
log.info("新机场执行定点飞行");
this.callNewAirpor(tenant, request, mission.getId());
this.callNewAirpor(tenant, request, emergencyMission.getId());
}
}

@@ -88,7 +86,7 @@ public class PointFlightService {
missionMapper.updateById(oldMission);

// 创建预警记录
WarningRecord warningRecord = this.createWarningRecord(user.getId(), tenantId, request, mission.getId());
WarningRecord warningRecord = this.createWarningRecord(user.getId(), tenantId, request, emergencyMission.getId());

log.info("调用机场平台方法: 执行定点飞行结束");
return JsonResult.success(warningRecord);

Loading…
取消
儲存