Commit 8a7320f3 authored by hanbing's avatar hanbing

[update] 渠化配置,优化车道序号

parent aa487bf6
......@@ -480,13 +480,12 @@ public class CrossConfigServiceImpl implements CrossConfigService {
private List<LaneInfoPO> getLaneInfoPOListForInsert(
String crossId, Integer dir, List<LaneListElement> laneListFromClient) {
List<LaneInfoPO> laneInfoPOListForInsert = new ArrayList<>();
for (LaneListElement laneListElement : laneListFromClient) {
for (int i = 0; i < laneListFromClient.size(); i++) {
LaneListElement laneListElement = laneListFromClient.get(i);
LaneInfoPO laneInfoPO = new LaneInfoPO();
// 序号
String name = laneListElement.getName(); // 01
String substring = name.substring(name.length() - 1);// 1
String s = 1 + substring;
int sort = Integer.parseInt(s);
String sortStr = "1" + (i + 1);
int sort = Integer.parseInt(sortStr);
// 上一个路口ID
String preId = laneInfoMapper.selectPreId(crossId, dir);
if (ObjectUtil.isEmpty(preId)) {
......@@ -494,7 +493,7 @@ public class CrossConfigServiceImpl implements CrossConfigService {
}
// 0 主路;900 进口道渠化序号。信控车道类型都是进口车道
laneInfoPO.setId(preId + crossId + 0 + 900 + sort);
laneInfoPO.setCode(name);
laneInfoPO.setCode(laneListElement.getName());
laneInfoPO.setSort(sort);
laneInfoPO.setDir(dir);
Integer direction = laneListElement.getDirection();
......@@ -502,6 +501,9 @@ public class CrossConfigServiceImpl implements CrossConfigService {
laneInfoPO.setCategory(laneListElement.getLaneType());
laneInfoPO.setCrossId(crossId);
laneInfoPOListForInsert.add(laneInfoPO);
}
for (LaneListElement laneListElement : laneListFromClient) {
}
return laneInfoPOListForInsert;
}
......
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