|
|
@@ -135,29 +135,32 @@ public class SyncAirDataService { |
|
|
|
log.info("灵嗅设备推送数据,serial为空"); |
|
|
|
return JsonResult.error("灵嗅设备推送数据,serial为空"); |
|
|
|
} |
|
|
|
Inspection inspection = this.getInspection(response.getSerial()); |
|
|
|
Inspection inspection = inspectionMapper.selectOne(Wrappers.<Inspection>lambdaQuery() |
|
|
|
.eq(Inspection::getMark, 1) |
|
|
|
.eq(Inspection::getEquipmentMountCode, response.getSerial()) |
|
|
|
.eq(Inspection::getStatus, 10) |
|
|
|
.orderByDesc(Inspection::getCreateTime)); |
|
|
|
log.info("查询的正在飞行的巡检任务,inspection={}",inspection); |
|
|
|
//Inspection inspection = this.getInspection(response.getSerial()); |
|
|
|
if (ObjectUtil.isNull(inspection)) { |
|
|
|
log.info("没有正在飞行的任务,无法关联推送的灵嗅数据,serial={}", response.getSerial()); |
|
|
|
return JsonResult.error("没有正在飞行的任务"); |
|
|
|
} |
|
|
|
return JsonResult.success(); |
|
|
|
return JsonResult.success(inspection); |
|
|
|
} |
|
|
|
|
|
|
|
private Inspection getInspection(String serial) { |
|
|
|
Inspection inspection = inspectionMapper.selectOne(Wrappers.<Inspection>lambdaQuery() |
|
|
|
.eq(Inspection::getMark, 1) |
|
|
|
.eq(Inspection::getEquipmentMountCode, serial) |
|
|
|
.eq(Inspection::getStatus, 10)); |
|
|
|
// private Inspection getInspection(String serial) { |
|
|
|
// |
|
|
|
// Inspection inspection = inspectionMapper.selectOne(new LambdaQueryWrapper<Inspection>() |
|
|
|
// .eq(Inspection::getEquipmentMountCode, serial) |
|
|
|
// .eq(Inspection::getStatus, InspectionStatusEnum.IN_FLIGHT.getCode()) |
|
|
|
// .eq(Inspection::getMark, MarkEnum.VALID.getCode()) |
|
|
|
// .orderByDesc(Inspection::getCreateTime)); |
|
|
|
if (ObjectUtil.isNull(inspection)) { |
|
|
|
return null; |
|
|
|
} |
|
|
|
return inspection; |
|
|
|
} |
|
|
|
// if (ObjectUtil.isNull(inspection)) { |
|
|
|
// return null; |
|
|
|
// } |
|
|
|
// return inspection; |
|
|
|
// } |
|
|
|
|
|
|
|
private String getValue(Map<String, Object> airDataMap, String key) { |
|
|
|
if (airDataMap.containsKey(key)) { |