|
@@ -3,6 +3,7 @@ package com.ningdatech.carapi.radar.manage; |
|
|
import java.io.IOException; |
|
|
import java.io.IOException; |
|
|
import java.io.InputStream; |
|
|
import java.io.InputStream; |
|
|
import java.math.BigDecimal; |
|
|
import java.math.BigDecimal; |
|
|
|
|
|
import java.math.RoundingMode; |
|
|
import java.net.InetSocketAddress; |
|
|
import java.net.InetSocketAddress; |
|
|
import java.net.ServerSocket; |
|
|
import java.net.ServerSocket; |
|
|
import java.net.Socket; |
|
|
import java.net.Socket; |
|
@@ -247,8 +248,9 @@ public class RadarManage { |
|
|
} |
|
|
} |
|
|
// 计算实时流量的和 |
|
|
// 计算实时流量的和 |
|
|
List<String> list = radarDataList.stream().map(RadarData::getRealTimeTrafficFlow).collect(Collectors.toList()); |
|
|
List<String> list = radarDataList.stream().map(RadarData::getRealTimeTrafficFlow).collect(Collectors.toList()); |
|
|
List<BigDecimal> decimals = list.stream().map(d -> BigDecimal.valueOf(Double.parseDouble(d))).collect(Collectors.toList()); |
|
|
|
|
|
BigDecimal total = decimals.stream().reduce(BigDecimal.ZERO, BigDecimal::add).stripTrailingZeros(); |
|
|
|
|
|
|
|
|
List<BigDecimal> decimals = list.stream().map(BigDecimal::new).collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
|
|
|
BigDecimal total = decimals.stream().reduce(BigDecimal.ZERO, BigDecimal::add); |
|
|
vo.setRealTimeTrafficFlow(String.valueOf(total)); |
|
|
vo.setRealTimeTrafficFlow(String.valueOf(total)); |
|
|
return vo; |
|
|
return vo; |
|
|
} |
|
|
} |
|
|