Browse Source

大气数据入库方法回调

tags/V1.0.1^2
chengwang 1 year ago
parent
commit
9234190855
1 changed files with 15 additions and 12 deletions
  1. +15
    -12
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/airData/syncdata/SyncAirDataService.java

+ 15
- 12
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/airData/syncdata/SyncAirDataService.java View File

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

Loading…
Cancel
Save