|
|
@@ -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); |