Commit c9a388ff authored by hanbing's avatar hanbing

运行计划,修复空指针异

parent b46d764a
package net.wanji.web.service.scheme.impl;
import cn.hutool.core.collection.CollectionUtil;
import net.wanji.web.common.constant.ControlModeConst;
import net.wanji.web.common.exception.PhaseNoNotUniqueException;
import net.wanji.web.dto.CrossIdDTO;
......@@ -391,17 +392,19 @@ public class SchemeConfigServiceImpl implements SchemeConfigService {
List<String> laneIds = crossLaneLightsPOList.stream()
.map(CrossLaneLightsPO::getLaneId)
.collect(Collectors.toList());
List<LaneInfoPO> laneInfoPOList = laneInfoMapper.selectByLaneIds(laneIds);
// 根据转向去重
TreeSet<LaneInfoPO> laneInfoPOTreeSet = laneInfoPOList.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());
laneList.add(laneListElement);
if (CollectionUtil.isNotEmpty(laneIds)) {
List<LaneInfoPO> laneInfoPOList = laneInfoMapper.selectByLaneIds(laneIds);
// 根据转向去重
TreeSet<LaneInfoPO> laneInfoPOTreeSet = laneInfoPOList.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());
laneList.add(laneListElement);
}
}
}
}
......
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