|
|
@@ -79,7 +79,7 @@ public class QueryAirportMsgByIdService { |
|
|
|
//实时电压值大于现在电压最小值 |
|
|
|
double vol = (temp - Umin) / (Umax - Umin); |
|
|
|
String percent = CommonNumberTypeUtils.getPercentFormat(vol, Integer.MAX_VALUE, 2); |
|
|
|
vo.setVoltage(percent); |
|
|
|
vo.setVoltage(percent + "%"); |
|
|
|
}else { |
|
|
|
vo.setVoltage(0 + "%"); |
|
|
|
} |
|
|
@@ -90,7 +90,12 @@ public class QueryAirportMsgByIdService { |
|
|
|
//里程 |
|
|
|
double mileageTemp = Double.parseDouble(flightData.getMileage()) / 1000; |
|
|
|
double mileage = CommonNumberTypeUtils.round(mileageTemp, 2); |
|
|
|
vo.setMileage(mileage+ "km"); |
|
|
|
if(("0%").equals(vo.getVoltage())){ |
|
|
|
vo.setMileage(0 + "km"); |
|
|
|
}else { |
|
|
|
vo.setMileage(mileage+ "km"); |
|
|
|
} |
|
|
|
|
|
|
|
//机场距离 |
|
|
|
double distToHome = CommonNumberTypeUtils.round(Double.parseDouble(flightData.getDistToHome()), 2); |
|
|
|
vo.setDistToHome(distToHome + "m"); |