|
@@ -515,17 +515,24 @@ public class MultiSimulationProjectServiceImpl implements MultiSimulationProject
|
|
}
|
|
}
|
|
param.setSceneId(sceneId);
|
|
param.setSceneId(sceneId);
|
|
List<MultiSimulationSceneCarVO> multiSimulationSceneCarVOS = sceneCarMapper.selectSceneCarList(param);
|
|
List<MultiSimulationSceneCarVO> multiSimulationSceneCarVOS = sceneCarMapper.selectSceneCarList(param);
|
|
|
|
+ boolean isLast = false;
|
|
for (MultiSimulationSceneCarVO car : multiSimulationSceneCarVOS) {
|
|
for (MultiSimulationSceneCarVO car : multiSimulationSceneCarVOS) {
|
|
Integer isSimulationCar = car.getIsSimulationCar();
|
|
Integer isSimulationCar = car.getIsSimulationCar();
|
|
- if (isSimulationCar == 1 && !StringUtils.equals(car.getId(), param.getSceneCarId())) {
|
|
|
|
- sceneCarMapper.updateMultiSimulationSceneCarView(car.getId(), 0);
|
|
|
|
|
|
+ if (isSimulationCar == 1){
|
|
|
|
+ if (!StringUtils.equals(car.getId(), param.getSceneCarId())){
|
|
|
|
+ sceneCarMapper.updateMultiSimulationSceneCarView(car.getId(), 0);
|
|
|
|
+ } else {
|
|
|
|
+ isLast = true;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- int i = sceneCarMapper.updateMultiSimulationSceneCarView(param.getSceneCarId(), 1);
|
|
|
|
- if (i > 0) {
|
|
|
|
- return new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS);
|
|
|
|
|
|
+ if (!isLast){
|
|
|
|
+ int i = sceneCarMapper.updateMultiSimulationSceneCarView(param.getSceneCarId(), 1);
|
|
|
|
+ if (i <= 0) {
|
|
|
|
+ return new ResponseBodyVO<>(ResponseBodyVO.Response.CLIENT_FAILURE);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- return new ResponseBodyVO<>(ResponseBodyVO.Response.CLIENT_FAILURE);
|
|
|
|
|
|
+ return new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|