Commit cd02b82d authored by hanbing's avatar hanbing

[update] 快速特勤,修改特勤详情过滤已经过路口

parent 04c1964d
......@@ -501,7 +501,11 @@ public class SpecialServiceServiceImpl implements SpecialServiceService {
String currentCrossId = initCrossId;
Integer sort = 1;
Set<String> visitedCrossIds = new HashSet<>(); // 用于验证已经过的路口不可再经过
while (!StrUtil.equals(finalCrossId, currentCrossId)) { // 未到最后一个路口
if (visitedCrossIds.contains(currentCrossId)) {
throw new RidException("路线规划不正确或路网数据不连续");
}
for (CrossListElement crossListElement : crossList) {
String crossId = crossListElement.getCrossId();
if (StrUtil.equals(currentCrossId, crossId) && !StrUtil.equals(currentCrossId, finalCrossId)) {
......@@ -539,6 +543,7 @@ public class SpecialServiceServiceImpl implements SpecialServiceService {
specialServiceCrossPO.setStatus(crossListElement.getStatus());
specialServiceCrossPO.setAutoUnlock(0);
specialServiceCrossMapper.insertOne(specialServiceCrossPO);
visitedCrossIds.add(currentCrossId);
currentCrossId = nextCrossId;
sort++;
}
......
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