|
|
@ -412,35 +412,30 @@ public class VideoController extends BaseController { |
|
|
|
Integer pileNumDistance = pileNumTransformMetre(pileNum); |
|
|
|
Map<String,Object> result = new HashMap<>(); |
|
|
|
|
|
|
|
//上行列表
|
|
|
|
//上行列表(包含双向)
|
|
|
|
List<Map<String,Object>> upCameraList = datalist.stream() |
|
|
|
.filter(item -> "0".equals(item.get("camOrientation"))) |
|
|
|
.map(item->{ |
|
|
|
item.put("distance",Math.abs(pileNumTransformMetre(item.get("pileNum").toString()) - pileNumDistance)); |
|
|
|
return item; |
|
|
|
}) |
|
|
|
.filter(item -> |
|
|
|
("0".equals(item.get("camOrientation")) || "2".equals(item.get("camOrientation"))) |
|
|
|
&& Integer.parseInt(item.get("distance").toString()) < 2000) |
|
|
|
.sorted(comparing(item -> Integer.parseInt(item.get("distance").toString()))) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
if (upCameraList.size() > 0 && Integer.parseInt(upCameraList.get(0).get("distance").toString()) < 2000){ |
|
|
|
result.put("upCamera",upCameraList.get(0)); |
|
|
|
} else { |
|
|
|
result.put("upCamera",new HashMap<>()); |
|
|
|
} |
|
|
|
result.put("upCamera",upCameraList); |
|
|
|
|
|
|
|
|
|
|
|
//下行列表
|
|
|
|
List<Map<String,Object>> downCameraList = datalist.stream() |
|
|
|
.filter(item -> "1".equals(item.get("camOrientation"))) |
|
|
|
.map(item->{ |
|
|
|
item.put("distance",Math.abs(pileNumTransformMetre(item.get("pileNum").toString()) - pileNumDistance)); |
|
|
|
return item; |
|
|
|
}) |
|
|
|
.filter(item -> "1".equals(item.get("camOrientation")) && Integer.parseInt(item.get("distance").toString()) < 2000) |
|
|
|
.sorted(comparing(item -> Integer.parseInt(item.get("distance").toString()))) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
if (downCameraList.size() > 0 && Integer.parseInt(downCameraList.get(0).get("distance").toString()) < 2000){ |
|
|
|
result.put("downCamera",downCameraList.get(0)); |
|
|
|
} else { |
|
|
|
result.put("downCamera",new HashMap<>()); |
|
|
|
} |
|
|
|
result.put("downCamera",downCameraList); |
|
|
|
|
|
|
|
|
|
|
|
return AjaxResult.success(result); |
|
|
|