| | |
| | | double sum = deviceDOS.stream().mapToDouble(s -> Double.parseDouble(s.getProgress())).sum(); |
| | | BigDecimal deviceOver = BigDecimal.valueOf(sum); |
| | | BigDecimal divideDevice = deviceOver.divide(deviceSize, 2, RoundingMode.HALF_UP); |
| | | List<SgDeviceDO> sortDeviceDOs = deviceDOS.stream().sorted(Comparator.comparing(SgDeviceDO::getPrice)).collect(Collectors.toList()); |
| | | List<SgDeviceDO> sortDeviceDOs = deviceDOS.stream().filter(s->s.getPrice()!=null).sorted(Comparator.comparing(SgDeviceDO::getPrice)).collect(Collectors.toList()); |
| | | typeVO.setDeviceDOS(sortDeviceDOs); |
| | | typeVO.setTypeProgress(getBigDecimalPercent(divideDevice)); |
| | | typeVO.setProgress(divideDevice.toString()); |