@@ -1,11 +1,13 @@ | |||
package com.tuoheng.admin.service.flightdata.query; | |||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||
import com.tuoheng.admin.entity.FlightData; | |||
import com.tuoheng.admin.entity.FlightDataHl; | |||
import com.tuoheng.admin.entity.Inspection; | |||
import com.tuoheng.admin.enums.MarkEnum; | |||
import com.tuoheng.admin.enums.code.inspection.QueryInspectionInfoByIdCodeEnum; | |||
import com.tuoheng.admin.mapper.FlightDataHlMapper; | |||
import com.tuoheng.admin.mapper.FlightDataMapper; | |||
import com.tuoheng.admin.mapper.InspectionMapper; | |||
import com.tuoheng.common.core.utils.JsonResult; | |||
import com.tuoheng.common.core.utils.StringUtils; | |||
@@ -31,6 +33,9 @@ public class QueryFindFlightDataService { | |||
@Autowired | |||
private FlightDataHlMapper flightDataHlMapper; | |||
@Autowired | |||
private FlightDataMapper flightDataMapper; | |||
public JsonResult findFlightData(String id) { | |||
if (StringUtils.isEmpty(id)) { | |||
return JsonResult.error(QueryInspectionInfoByIdCodeEnum.INSPECTION_ID_IS_NULL.getCode(), QueryInspectionInfoByIdCodeEnum.INSPECTION_ID_IS_NULL.getMsg()); | |||
@@ -42,7 +47,7 @@ public class QueryFindFlightDataService { | |||
id = inspection.getEmergencyDataInspectionId(); | |||
} | |||
//根据任务id查询对应的云盒遥测数据 | |||
List<FlightDataHl> flightDataHls = flightDataHlMapper.selectListByInspectionId(id); | |||
List<FlightData> flightDataHls = flightDataMapper.selectListByInspectionId(id); | |||
return JsonResult.success(flightDataHls); | |||
} | |||
} |
@@ -58,20 +58,21 @@ public class QueryAirportMsgByIdService { | |||
} | |||
//获取遥测信号最新的一条数据 | |||
Object obj = redisUtils.get(inspectionId); | |||
FlightDataHl flightDataHl = null; | |||
FlightData flightDataHl = null; | |||
if (ObjectUtil.isNull(obj)) { | |||
return JsonResult.success(); | |||
} else { | |||
flightDataHl = (FlightDataHl) obj; | |||
flightDataHl = (FlightData) obj; | |||
} | |||
AirportMsgVo vo = new AirportMsgVo(); | |||
vo.setHt(flightDataHl.getHt() == null ? "" : flightDataHl.getHt()); | |||
vo.setDuration(flightDataHl.getDuration() == null ? "" : flightDataHl.getDuration()); | |||
vo.setBat(flightDataHl.getBat() == null ? "" : flightDataHl.getBat()); | |||
vo.setAbsp(flightDataHl.getAbsp() == null ? "" : flightDataHl.getAbsp()); | |||
vo.setRemainingFlightTime(flightDataHl.getRemainingFlightTime() == null ? "" : flightDataHl.getRemainingFlightTime()); | |||
vo.setSatellite(flightDataHl.getSatellite() == null ? "" : flightDataHl.getSatellite()); | |||
vo.setGps(flightDataHl.getGps() == null ? "" : flightDataHl.getGps()); | |||
vo.setGps(flightDataHl.getGpssingal() == null ? "" : flightDataHl.getGpssingal()); | |||
return JsonResult.success(vo); | |||
} | |||
} |
@@ -74,10 +74,10 @@ public class UpdateWaittStatusService { | |||
log.info("修改任务状态业务接口:获取天气信息:weatherStr={}", weatherStr); | |||
inspectionUpdate.setWeather(weatherStr); | |||
Integer flightDataCount = flightDataHlMapper.selectCount(new LambdaQueryWrapper<FlightDataHl>() | |||
.eq(FlightDataHl::getInspectionId, inspection.getId()) | |||
.eq(FlightDataHl::getTenantId, inspection.getTenantId()) | |||
.eq(FlightDataHl::getMark, MarkEnum.VALID.getCode())); | |||
Integer flightDataCount = flightDataMapper.selectCount(new LambdaQueryWrapper<FlightData>() | |||
.eq(FlightData::getInspectionId, inspection.getId()) | |||
.eq(FlightData::getTenantId, inspection.getTenantId()) | |||
.eq(FlightData::getMark, MarkEnum.VALID.getCode())); | |||
log.info("坐标数据,flightDataCount:{}", flightDataCount); | |||
if (flightDataCount > 0) { | |||
int index = (int) Math.ceil((double) flightDataCount / 2); |
@@ -19,6 +19,11 @@ public class AirportMsgVo { | |||
*/ | |||
private String duration; | |||
/** | |||
* 电池容量 | |||
*/ | |||
private String bat; | |||
/** | |||
* 速度 | |||
*/ |