|
|
@@ -7,6 +7,7 @@ import com.tuoheng.admin.conver.InspectionConverMapper; |
|
|
|
import com.tuoheng.admin.entity.domain.ThInspection; |
|
|
|
import com.tuoheng.admin.entity.domain.ThMission; |
|
|
|
import com.tuoheng.admin.entity.vo.index.DroneDataVo; |
|
|
|
import com.tuoheng.admin.enums.MarkTypeEnum; |
|
|
|
import com.tuoheng.admin.enums.TaskStatusEnum; |
|
|
|
import com.tuoheng.admin.mapper.TenantMapper; |
|
|
|
import com.tuoheng.admin.mapper.ThInspectionMapper; |
|
|
@@ -36,7 +37,7 @@ public class QueryDroneDataService { |
|
|
|
private ThInspectionMapper inspectionMapper; |
|
|
|
|
|
|
|
public JsonResult getDroneDataById(String airportId) { |
|
|
|
log.info("获取无人机数据信息"); |
|
|
|
log.info("获取无人机数据信息, airportId={}", airportId); |
|
|
|
|
|
|
|
this.check(airportId); |
|
|
|
|
|
|
@@ -46,16 +47,18 @@ public class QueryDroneDataService { |
|
|
|
|
|
|
|
ThMission mission = missionMapper.selectOne(new LambdaQueryWrapper<ThMission>() |
|
|
|
.eq(ThMission::getTenantId, tenantId) |
|
|
|
.eq(ThMission::getStatus, TaskStatusEnum.FLIGHT.getCode()) |
|
|
|
.eq(ThMission::getAirportId, airportId) |
|
|
|
.eq(ThMission::getMark, 1)); |
|
|
|
.eq(ThMission::getStatus, TaskStatusEnum.FLIGHT.getCode()) |
|
|
|
.eq(ThMission::getMark, MarkTypeEnum.VALID.getCode())); |
|
|
|
if (ObjectUtil.isNull(mission)) { |
|
|
|
log.info("获取无人机数据信息, 没有正在飞行的任务"); |
|
|
|
throw new ServiceException("没有正在飞行的任务"); |
|
|
|
} |
|
|
|
|
|
|
|
List<ThInspection> inspectionList = inspectionMapper.selectListByMissionId(mission.getId(), ShiroUtils.getTenantId()); |
|
|
|
if (CollectionUtil.isEmpty(inspectionList)) { |
|
|
|
JsonResult.success("无人机数据为空"); |
|
|
|
log.info("获取无人机数据信息, 数据为空"); |
|
|
|
JsonResult.success("数据为空"); |
|
|
|
} |
|
|
|
List<DroneDataVo> droneDataVoList = InspectionConverMapper.INSTANCE.fromInspectionListToDroneDataVoList(inspectionList); |
|
|
|
return JsonResult.success(droneDataVoList); |
|
|
@@ -69,6 +72,7 @@ public class QueryDroneDataService { |
|
|
|
*/ |
|
|
|
private void check(String airportId) { |
|
|
|
if (StringUtils.isEmpty(airportId)) { |
|
|
|
log.info("获取无人机数据信息, 机场ID为空"); |
|
|
|
throw new ServiceException("机场ID为空"); |
|
|
|
} |
|
|
|
} |