| | |
| | | import org.apache.poi.ss.formula.functions.T; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | long daysBetween = ChronoUnit.DAYS.between(chargingPercentProvinceDto.getDate1(), chargingPercentProvinceDto.getDate2()); |
| | | BigDecimal multiply = bigDecimal1.multiply(new BigDecimal("24")).multiply(BigDecimal.valueOf(daysBetween)); |
| | | //得到利用率 |
| | | BigDecimal divide = datum.getChargingCapacity().divide(multiply, 0, BigDecimal.ROUND_HALF_UP); |
| | | BigDecimal divide; |
| | | if(CollectionUtils.isEmpty(chargingPiles)){ |
| | | divide = BigDecimal.ZERO; |
| | | }else { |
| | | divide = datum.getChargingCapacity().divide(multiply, 0, BigDecimal.ROUND_HALF_UP); |
| | | } |
| | | //如果利用率大于等于10 |
| | | if (divide.compareTo(BigDecimal.valueOf(10))>=0){ |
| | | chargingPercentBack.setCount1(chargingPercentBack.getCount1()+1); |