Sfoglia il codice sorgente

UpdateWaittStatusService类代码优化

tags/V1.3.2
chengwang 1 anno fa
parent
commit
91a92278ec
1 ha cambiato i file con 5 aggiunte e 9 eliminazioni
  1. +5
    -9
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/update/status/UpdateWaittStatusService.java

+ 5
- 9
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/update/status/UpdateWaittStatusService.java Vedi File

@@ -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());

Loading…
Annulla
Salva