|
|
@@ -71,18 +71,27 @@ public class GetDroneDataByIdService { |
|
|
|
log.info("获取无人机数据信息,数据为空"); |
|
|
|
JsonResult.success("数据为空"); |
|
|
|
} |
|
|
|
List<DroneDataVo> droneDataVoList = new ArrayList<>(); |
|
|
|
for (FlightData flightData : flightDataList) { |
|
|
|
DroneDataVo droneDataVo = new DroneDataVo(); |
|
|
|
droneDataVo.setInspectionId(flightData.getInspectionId()); |
|
|
|
droneDataVo.setUavPower(79 + "%"); |
|
|
|
droneDataVo.setRange(6 + "km"); |
|
|
|
double dist = Integer.valueOf(flightData.getDistHome())/1000d; |
|
|
|
droneDataVo.setTargetLocation(dist+ "km"); |
|
|
|
droneDataVo.setYsingal(flightData.getYsingal() + "%"); |
|
|
|
droneDataVoList.add(droneDataVo); |
|
|
|
} |
|
|
|
//取最新的一条数据给前端 |
|
|
|
FlightData flightData = flightDataList.get(0); |
|
|
|
DroneDataVo droneDataVo = new DroneDataVo(); |
|
|
|
droneDataVo.setInspectionId(flightData.getInspectionId()); |
|
|
|
droneDataVo.setUavPower(79 + "%"); |
|
|
|
droneDataVo.setRange(6 + "km"); |
|
|
|
double dist = Integer.valueOf(flightData.getDistHome())/1000d; |
|
|
|
droneDataVo.setTargetLocation(dist+ "km"); |
|
|
|
droneDataVo.setYsingal(flightData.getYsingal() + "%"); |
|
|
|
// List<DroneDataVo> droneDataVoList = new ArrayList<>(); |
|
|
|
// for (FlightData flightData2 : flightDataList) { |
|
|
|
// DroneDataVo droneDataVo = new DroneDataVo(); |
|
|
|
// droneDataVo.setInspectionId(flightData.getInspectionId()); |
|
|
|
// droneDataVo.setUavPower(79 + "%"); |
|
|
|
// droneDataVo.setRange(6 + "km"); |
|
|
|
// double dist = Integer.valueOf(flightData.getDistHome())/1000d; |
|
|
|
// droneDataVo.setTargetLocation(dist+ "km"); |
|
|
|
// droneDataVo.setYsingal(flightData.getYsingal() + "%"); |
|
|
|
// droneDataVoList.add(droneDataVo); |
|
|
|
// } |
|
|
|
|
|
|
|
return JsonResult.success(droneDataVoList); |
|
|
|
return JsonResult.success(droneDataVo); |
|
|
|
} |
|
|
|
} |