Commit 8d632358 authored by duanruiming's avatar duanruiming

Merge remote-tracking branch 'origin/master'

parents 2d17e884 47c37a7a
...@@ -44,6 +44,9 @@ public class GreenwaveHist extends TrackableEntity { ...@@ -44,6 +44,9 @@ public class GreenwaveHist extends TrackableEntity {
@ApiModelProperty(value = "行程速度(km/h)") @ApiModelProperty(value = "行程速度(km/h)")
private BigDecimal speed; private BigDecimal speed;
@ApiModelProperty(value = "速度异常系数")
private Double speedCv;
@ApiModelProperty(value = "行程时间(秒)") @ApiModelProperty(value = "行程时间(秒)")
private Integer trvalTime; private Integer trvalTime;
......
...@@ -65,8 +65,14 @@ public class EventServiceImpl implements EventService { ...@@ -65,8 +65,14 @@ public class EventServiceImpl implements EventService {
String[] dirList = dirs.split("@"); String[] dirList = dirs.split("@");
List<String> allDirList = new ArrayList<>(); List<String> allDirList = new ArrayList<>();
for (String dirArr : dirList) { for (String dirArr : dirList) {
if (!dirArr.startsWith("[") || !dirArr.endsWith("]")){
//过滤不合规格式数据
continue;
}
List<String> jsonArray = JSONArray.parseArray(dirArr, String.class); List<String> jsonArray = JSONArray.parseArray(dirArr, String.class);
allDirList.addAll(jsonArray.stream().map(o -> (Integer.valueOf(o).toString())).distinct().collect(Collectors.toList())); if (jsonArray.size()>0) {
allDirList.addAll(jsonArray.stream().map(o -> (Integer.valueOf(o).toString())).distinct().collect(Collectors.toList()));
}
} }
//统计每个方向发生的次数 //统计每个方向发生的次数
countMap = allDirList.stream().collect(Collectors.groupingBy(String::valueOf, Collectors.counting())); countMap = allDirList.stream().collect(Collectors.groupingBy(String::valueOf, Collectors.counting()));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment