Commit b5f4cfcf authored by hanbing's avatar hanbing

[update] 方案管理增加根据转向去重

parent 50531727
......@@ -36,6 +36,7 @@ import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.TreeSet;
import java.util.stream.Collectors;
/**
......@@ -412,7 +413,10 @@ public class SchemeConfigServiceImpl implements SchemeConfigService {
List<LaneInfoPO> collect = laneInfoPOList.stream()
.sorted(Comparator.comparing(LaneInfoPO::getSort))
.collect(Collectors.toList());
for (LaneInfoPO laneInfoPO : collect) {
// 根据转向去重
TreeSet<LaneInfoPO> laneInfoPOTreeSet = collect.stream().collect(Collectors.toCollection(
() -> new TreeSet<>(Comparator.comparing(LaneInfoPO::getTurn))));
for (LaneInfoPO laneInfoPO : laneInfoPOTreeSet) {
SaveSchemeConfigDTO.LaneListElement laneListElement = new SaveSchemeConfigDTO.LaneListElement();
laneListElement.setDirection(laneInfoPO.getTurn());
laneListElement.setLaneType(laneInfoPO.getCategory());
......
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