Browse Source

获取无人机数据,添加日志

tags/v1.2.0^2
wanjing 1 year ago
parent
commit
c40c9cefd5
2 changed files with 9 additions and 5 deletions
  1. +1
    -1
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/airport/AirportServiceImpl.java
  2. +8
    -4
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/airport/drone/QueryDroneDataService.java

+ 1
- 1
tuoheng-admin/src/main/java/com/tuoheng/admin/service/airport/AirportServiceImpl.java View File

@@ -32,7 +32,7 @@ public class AirportServiceImpl implements AirportService {
}

/**
* 定点飞行
* 无人机信息
* @param airportId
* @return
*/

+ 8
- 4
tuoheng-admin/src/main/java/com/tuoheng/admin/service/airport/drone/QueryDroneDataService.java View File

@@ -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为空");
}
}

Loading…
Cancel
Save