|
|
@@ -36,27 +36,23 @@ public class QueryFlightDataTrackService { |
|
|
|
public JsonResult track(InspectionRequest inspectionRequest) { |
|
|
|
Inspection inspection = inspectionMapper.selectById(inspectionRequest.getRequestId()); |
|
|
|
if (ObjectUtil.isEmpty(inspection)) { |
|
|
|
log.info("被硬件调用,存飞行轨迹,巡检任务不存在,inspectionId={}", inspectionRequest.getRequestId()); |
|
|
|
throw new ServiceException(ServiceExceptionEnum.TASK_DOES_NOT_EXIST); |
|
|
|
} |
|
|
|
log.info("正在巡检的任务,inspection={}",inspection); |
|
|
|
|
|
|
|
FlightData flightData = new FlightData(); |
|
|
|
BeanUtils.copyProperties(inspectionRequest, flightData); |
|
|
|
flightData.setTenantId(inspection.getTenantId()); |
|
|
|
flightData.setInspectionId(inspection.getId()); |
|
|
|
flightData.setAltitude(null); |
|
|
|
//机场传过来的高度是相对高度 |
|
|
|
flightData.setUltrasonic(inspectionRequest.getAltitude()); |
|
|
|
flightData.setUltrasonic(inspectionRequest.getAltitude()); // 机场传过来的高度是相对高度 |
|
|
|
flightData.setSpeed(inspectionRequest.getHspeed()); |
|
|
|
flightData.setYsingal(inspectionRequest.getYsingal()); |
|
|
|
flightData.setDistHome(inspectionRequest.getDistHome()); |
|
|
|
|
|
|
|
log.info("云盒遥测数据,flightData={}",flightData); |
|
|
|
|
|
|
|
//将最新一条数据放入缓存,并设置过期时间 |
|
|
|
redisUtils.set(String.valueOf(inspection.getId()), flightData, 10); |
|
|
|
int result = flightDataMapper.insert(flightData); |
|
|
|
if(result<=0){ |
|
|
|
if (result <= 0) { |
|
|
|
log.info("被硬件调用,存飞行轨迹,数据报存失败,inspectionId={}", inspectionRequest.getRequestId()); |
|
|
|
return JsonResult.error("遥测数据保存失败"); |
|
|
|
} |
|
|
|
|