|
|
@@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import com.tuoheng.admin.constant.SystemConstant; |
|
|
|
import com.tuoheng.admin.entity.FlightData; |
|
|
|
import com.tuoheng.admin.entity.FlightDataHl; |
|
|
|
import com.tuoheng.admin.entity.Inspection; |
|
|
|
import com.tuoheng.admin.entity.Report; |
|
|
|
import com.tuoheng.admin.enums.MarkEnum; |
|
|
@@ -40,9 +39,6 @@ public class UpdateWaittStatusService { |
|
|
|
@Autowired |
|
|
|
private FlightDataMapper flightDataMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private FlightDataHlMapper flightDataHlMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private ReportMapper reportMapper; |
|
|
|
|
|
|
@@ -81,11 +77,11 @@ public class UpdateWaittStatusService { |
|
|
|
log.info("坐标数据,flightDataCount:{}", flightDataCount); |
|
|
|
if (flightDataCount > 0) { |
|
|
|
int index = (int) Math.ceil((double) flightDataCount / 2); |
|
|
|
FlightDataHl flightData = flightDataHlMapper.selectOne(new LambdaQueryWrapper<FlightDataHl>() |
|
|
|
.eq(FlightDataHl::getInspectionId, inspection.getId()) |
|
|
|
.eq(FlightDataHl::getTenantId, inspection.getTenantId()) |
|
|
|
.eq(FlightDataHl::getMark, MarkEnum.VALID.getCode()) |
|
|
|
.orderByDesc(FlightDataHl::getTime) |
|
|
|
FlightData flightData = flightDataMapper.selectOne(new LambdaQueryWrapper<FlightData>() |
|
|
|
.eq(FlightData::getInspectionId, inspection.getId()) |
|
|
|
.eq(FlightData::getTenantId, inspection.getTenantId()) |
|
|
|
.eq(FlightData::getMark, MarkEnum.VALID.getCode()) |
|
|
|
.orderByDesc(FlightData::getTimestamp) |
|
|
|
.last("limit " + index + ",1")); |
|
|
|
if (ObjectUtil.isNotNull(flightData)) { |
|
|
|
inspectionUpdate.setFlyHeight(flightData.getAlt()); |