Просмотр исходного кода

批量插入飞行数据

tags/v1.3.1
chengwang 1 год назад
Родитель
Сommit
b91413ef34
1 измененных файлов: 15 добавлений и 14 удалений
  1. +15
    -14
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/update/status/UpdateWaittStatusService.java

+ 15
- 14
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/update/status/UpdateWaittStatusService.java Просмотреть файл

@@ -6,15 +6,13 @@ 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;
import com.tuoheng.admin.enums.TaskStatusEnum;
import com.tuoheng.admin.enums.code.inspection.EditInspectionStatusCodeEnum;
import com.tuoheng.admin.mapper.FlightDataMapper;
import com.tuoheng.admin.mapper.InspectionMapper;
import com.tuoheng.admin.mapper.ReportMapper;
import com.tuoheng.admin.mapper.TenantMapper;
import com.tuoheng.admin.mapper.*;
import com.tuoheng.admin.service.third.dsp.IDspService;
import com.tuoheng.admin.utils.AirWeatherUtil;
import com.tuoheng.admin.vo.AirWeatherVO;
@@ -42,6 +40,9 @@ public class UpdateWaittStatusService {
@Autowired
private FlightDataMapper flightDataMapper;

@Autowired
private FlightDataHlMapper flightDataHlMapper;

@Autowired
private ReportMapper reportMapper;

@@ -73,21 +74,21 @@ public class UpdateWaittStatusService {
log.info("修改任务状态业务接口:获取天气信息:weatherStr={}", weatherStr);
inspectionUpdate.setWeather(weatherStr);

Integer flightDataCount = flightDataMapper.selectCount(new LambdaQueryWrapper<FlightData>()
.eq(FlightData::getInspectionId, inspection.getId())
.eq(FlightData::getTenantId, inspection.getTenantId())
.eq(FlightData::getMark, MarkEnum.VALID.getCode()));
Integer flightDataCount = flightDataHlMapper.selectCount(new LambdaQueryWrapper<FlightDataHl>()
.eq(FlightDataHl::getInspectionId, inspection.getId())
.eq(FlightDataHl::getTenantId, inspection.getTenantId())
.eq(FlightDataHl::getMark, MarkEnum.VALID.getCode()));
log.info("坐标数据,flightDataCount:{}", flightDataCount);
if (flightDataCount > 0) {
int index = (int) Math.ceil((double) flightDataCount / 2);
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)
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)
.last("limit " + index + ",1"));
if (ObjectUtil.isNotNull(flightData)) {
inspectionUpdate.setFlyHeight(flightData.getUltrasonic());
inspectionUpdate.setFlyHeight(flightData.getAlt());
}
}


Загрузка…
Отмена
Сохранить