|
|
@@ -119,12 +119,31 @@ public class PointFlightService { |
|
|
|
throw new ServiceException("原巡检任务不存在"); |
|
|
|
} |
|
|
|
|
|
|
|
ThMission missionTmp = missionMapper.selectOne(new LambdaQueryWrapper<ThMission>() |
|
|
|
.eq(ThMission::getAirportId, request.getAirportId()) |
|
|
|
.eq(ThMission::getStatus, TaskStatusEnum.FLIGHT.getCode()) |
|
|
|
.eq(ThMission::getMark, MarkEnum.VALID.getCode())); |
|
|
|
if (ObjectUtil.isNotNull(missionTmp)) { |
|
|
|
throw new ServiceException("该机场正在执行任务"); |
|
|
|
if (mission.getAirportId() == request.getAirportId()) { |
|
|
|
WarningRecord warningRecord = warningRecordMapper.selectOne(new LambdaQueryWrapper<WarningRecord>() |
|
|
|
.eq(WarningRecord::getMissionId, mission.getId()) |
|
|
|
.eq(WarningRecord::getMark, MarkTypeEnum.VALID.getCode()) |
|
|
|
.orderByDesc(WarningRecord::getCreateTime) |
|
|
|
.last(" limit 1")); |
|
|
|
if (ObjectUtil.isNotNull(warningRecord)) { |
|
|
|
ThMission missionTmp = missionMapper.selectOne(new LambdaQueryWrapper<ThMission>() |
|
|
|
.eq(ThMission::getId, warningRecord.getEmergencyMissionId()) |
|
|
|
.eq(ThMission::getStatus, TaskStatusEnum.FLIGHT.getCode()) |
|
|
|
.eq(ThMission::getMark, MarkEnum.VALID.getCode())); |
|
|
|
if (ObjectUtil.isNotNull(missionTmp)) { |
|
|
|
log.info("原机场正在执行任务"); |
|
|
|
throw new ServiceException("原机场正在执行任务"); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
ThMission missionTmp = missionMapper.selectOne(new LambdaQueryWrapper<ThMission>() |
|
|
|
.eq(ThMission::getAirportId, request.getAirportId()) |
|
|
|
.eq(ThMission::getStatus, TaskStatusEnum.FLIGHT.getCode()) |
|
|
|
.eq(ThMission::getMark, MarkEnum.VALID.getCode())); |
|
|
|
if (ObjectUtil.isNotNull(missionTmp)) { |
|
|
|
log.info("新机场正在执行任务"); |
|
|
|
throw new ServiceException("新机场正在执行任务"); |
|
|
|
} |
|
|
|
} |
|
|
|
return JsonResult.success(mission); |
|
|
|
} |