| | |
| | | Integer h = Integer.valueOf(data.getCumulative_charging_time() / 60); |
| | | Integer m = Integer.valueOf(data.getCumulative_charging_time() % 60); |
| | | chargingDetails.setChargedTime(String.format("%02d", h) + ":" + String.format("%02d", m)); |
| | | } |
| | | if(null != data && null != one.getAppUserCarId()){ |
| | | TAppUserCar appUserCar = appUserCarClient.getCarById(one.getAppUserCarId().toString()).getData(); |
| | | // 续航 = 续航里程 * soc |
| | | BigDecimal multiply = new BigDecimal(data.getSoc() / 100).multiply(new BigDecimal(appUserCar.getEndurance())); |
| | | chargingDetails.setEndurance(multiply.setScale(2, RoundingMode.HALF_EVEN)); |
| | | System.err.println("续航--" + multiply); |
| | | if(null != one.getAppUserCarId()){ |
| | | TAppUserCar appUserCar = appUserCarClient.getCarById(one.getAppUserCarId().toString()).getData(); |
| | | // 续航 = 续航里程 * soc |
| | | BigDecimal multiply = new BigDecimal(data.getSoc()).divide(new BigDecimal(100)).multiply(new BigDecimal(appUserCar.getEndurance())); |
| | | chargingDetails.setEndurance(multiply.setScale(2, RoundingMode.HALF_EVEN)); |
| | | } |
| | | } |
| | | return chargingDetails; |
| | | } |