|
|
@@ -146,28 +146,26 @@ public class SyncAirDataService { |
|
|
|
.eq(Inspection::getStatus, InspectionStatusEnum.IN_FLIGHT.getCode()) |
|
|
|
.orderByDesc(Inspection::getCreateTime) |
|
|
|
.last(" limit 1")); |
|
|
|
if(CollectionUtil.isEmpty(inspectionList) || inspectionList.size() == 0){ |
|
|
|
return JsonResult.error("未查询出最新的一条人工执飞任务"); |
|
|
|
} |
|
|
|
Inspection inspection = inspectionList.get(0); |
|
|
|
if (ObjectUtil.isNotNull(inspection)) { |
|
|
|
log.info("正在飞行的飞手任务,inspection={}",inspection); |
|
|
|
}else if(ObjectUtil.isNull(inspection)){ |
|
|
|
Inspection inspection = null; |
|
|
|
if (CollectionUtil.isNotEmpty(inspectionList) || inspectionList.size() != 0) { |
|
|
|
inspection = inspectionList.get(0); |
|
|
|
log.info("正在飞行的飞手任务,inspection={}", inspection); |
|
|
|
} else if (inspection == null) { |
|
|
|
//再查询最新的一条任务 |
|
|
|
inspectionList = inspectionMapper.selectList(Wrappers.<Inspection>lambdaQuery() |
|
|
|
inspectionList = inspectionMapper.selectList(Wrappers.<Inspection>lambdaQuery() |
|
|
|
.eq(Inspection::getMark, 1) |
|
|
|
.eq(Inspection::getStatus, InspectionStatusEnum.IN_FLIGHT.getCode()) |
|
|
|
.orderByDesc(Inspection::getCreateTime) |
|
|
|
.last(" limit 1")); |
|
|
|
if(CollectionUtil.isEmpty(inspectionList) || inspectionList.size() == 0){ |
|
|
|
return JsonResult.error("未查询出最新的一条机场巡检任务"); |
|
|
|
if (CollectionUtil.isNotEmpty(inspectionList) || inspectionList.size() != 0) { |
|
|
|
inspection = inspectionList.get(0); |
|
|
|
log.info("正在飞行的巡检任务,inspection={}", inspection); |
|
|
|
} else { |
|
|
|
log.info("没有正在飞行的任务,无法关联推送的灵嗅数据,serial={}", response.getSerial()); |
|
|
|
return JsonResult.error("没有正在飞行的任务"); |
|
|
|
} |
|
|
|
inspection = inspectionList.get(0); |
|
|
|
}else { |
|
|
|
log.info("没有正在飞行的任务,无法关联推送的灵嗅数据,serial={}", response.getSerial()); |
|
|
|
return JsonResult.error("没有正在飞行的任务"); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
return JsonResult.success(inspection); |
|
|
|
} |
|
|
|
|