Commit e9cb7517 authored by hanbing's avatar hanbing

[update] 渠化配置,取消按车道代码排序

parent e6116bca
...@@ -44,9 +44,7 @@ public class CrossConfigController { ...@@ -44,9 +44,7 @@ public class CrossConfigController {
}) })
public JsonViewObject saveLaneInfo(@RequestBody SaveLaneInfoDTO saveLaneInfoDTO) { public JsonViewObject saveLaneInfo(@RequestBody SaveLaneInfoDTO saveLaneInfoDTO) {
crossConfigService.saveLaneInfo(saveLaneInfoDTO); crossConfigService.saveLaneInfo(saveLaneInfoDTO);
JsonViewObject jsonViewObject = JsonViewObject.newInstance(); return JsonViewObject.newInstance().success();
return jsonViewObject.success();
} }
@AspectLog(description = "渠化配置/灯组设置、车道配置列表", operationType = BaseEnum.OperationTypeEnum.UPDATE) @AspectLog(description = "渠化配置/灯组设置、车道配置列表", operationType = BaseEnum.OperationTypeEnum.UPDATE)
......
...@@ -274,11 +274,8 @@ public class CrossConfigServiceImpl implements CrossConfigService { ...@@ -274,11 +274,8 @@ public class CrossConfigServiceImpl implements CrossConfigService {
for (DirListElement dirListElement : dirList) { for (DirListElement dirListElement : dirList) {
Integer dir = dirListElement.getDir(); Integer dir = dirListElement.getDir();
List<LaneInfoPO> laneInfoPOList = laneInfoMapper.selectByCrossIdAndDir(crossId, dir); List<LaneInfoPO> laneInfoPOList = laneInfoMapper.selectByCrossIdAndDir(crossId, dir);
// 按车道代码排序
List<LaneListElement> laneListFromClient = dirListElement.getLaneList(); List<LaneListElement> laneListFromClient = dirListElement.getLaneList();
laneListFromClient.sort((x,y) -> String.CASE_INSENSITIVE_ORDER.compare(x.getName(), y.getName()));
List<LaneListElement> laneListFromDb = buildLaneListFromDb(laneInfoPOList); List<LaneListElement> laneListFromDb = buildLaneListFromDb(laneInfoPOList);
laneListFromDb.sort((x,y) -> String.CASE_INSENSITIVE_ORDER.compare(x.getName(), y.getName()));
// 比较入参数据与已有数据 // 比较入参数据与已有数据
if (!laneListFromClient.equals(laneListFromDb) || CollectionUtil.isEmpty(laneListFromClient)) { if (!laneListFromClient.equals(laneListFromDb) || CollectionUtil.isEmpty(laneListFromClient)) {
cleanDataBase(crossId, dir, laneInfoPOList); cleanDataBase(crossId, dir, laneInfoPOList);
...@@ -522,7 +519,10 @@ public class CrossConfigServiceImpl implements CrossConfigService { ...@@ -522,7 +519,10 @@ public class CrossConfigServiceImpl implements CrossConfigService {
private List<LaneListElement> buildLaneListFromDb(List<LaneInfoPO> laneInfoPOList) { private List<LaneListElement> buildLaneListFromDb(List<LaneInfoPO> laneInfoPOList) {
List<LaneListElement> laneListElements = new ArrayList<>(); List<LaneListElement> laneListElements = new ArrayList<>();
for (LaneInfoPO laneInfoPO : laneInfoPOList) { List<LaneInfoPO> collect = laneInfoPOList.stream()
.sorted(Comparator.comparing(LaneInfoPO::getSort))
.collect(Collectors.toList());
for (LaneInfoPO laneInfoPO : collect) {
LaneListElement laneListElement = new LaneListElement(); LaneListElement laneListElement = new LaneListElement();
Integer turn = laneInfoPO.getTurn(); Integer turn = laneInfoPO.getTurn();
laneListElement.setDirection(turn); laneListElement.setDirection(turn);
......
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