|
@@ -167,6 +167,7 @@ public class MultiSimulationProjectServiceImpl implements MultiSimulationProject
|
|
}
|
|
}
|
|
MultiSimulationSceneCarParam sceneCarParam = new MultiSimulationSceneCarParam();
|
|
MultiSimulationSceneCarParam sceneCarParam = new MultiSimulationSceneCarParam();
|
|
sceneCarParam.setSceneId(sceneVoId);
|
|
sceneCarParam.setSceneId(sceneVoId);
|
|
|
|
+ sceneCarParam.setMapId(mapId);
|
|
List<MultiSimulationSceneCarVO> multiSimulationSceneCarVOS = sceneCarMapper.selectSceneCarList(sceneCarParam);
|
|
List<MultiSimulationSceneCarVO> multiSimulationSceneCarVOS = sceneCarMapper.selectSceneCarList(sceneCarParam);
|
|
ResponseBodyVO sceneCars = checkAllSceneCars(multiSimulationSceneCarVOS, sceneVoId);
|
|
ResponseBodyVO sceneCars = checkAllSceneCars(multiSimulationSceneCarVOS, sceneVoId);
|
|
if (sceneCars.getCode() != ResponseBodyVO.Response.SUCCESS.getCode()){
|
|
if (sceneCars.getCode() != ResponseBodyVO.Response.SUCCESS.getCode()){
|
|
@@ -413,6 +414,19 @@ public class MultiSimulationProjectServiceImpl implements MultiSimulationProject
|
|
if (Objects.isNull(param.getPageSize())) {
|
|
if (Objects.isNull(param.getPageSize())) {
|
|
param.setPageSize(10);
|
|
param.setPageSize(10);
|
|
}
|
|
}
|
|
|
|
+ if (StringUtils.isBlank(param.getMapId())){
|
|
|
|
+ PageInfo<MultiSimulationSceneCarVO> pageInfo = new PageInfo<>(new ArrayList<>());
|
|
|
|
+ return new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS, pageInfo);
|
|
|
|
+// MultiSimulationSceneVO sceneVO = simulationSceneMapper.selectSceneDetailBySceneId(sceneId);
|
|
|
|
+// String mapId = sceneVO.getMapId();
|
|
|
|
+// if (StringUtils.isBlank(mapId)){
|
|
|
|
+//
|
|
|
|
+// }else {
|
|
|
|
+// param.setMapId(mapId);
|
|
|
|
+// }
|
|
|
|
+ }else {
|
|
|
|
+ param.setMapId(param.getMapId());
|
|
|
|
+ }
|
|
setPage(param.getPageNum(), param.getPageSize());
|
|
setPage(param.getPageNum(), param.getPageSize());
|
|
List<MultiSimulationSceneCarVO> multiSimulationSceneCarVOS = sceneCarMapper.selectSceneCarList(param);
|
|
List<MultiSimulationSceneCarVO> multiSimulationSceneCarVOS = sceneCarMapper.selectSceneCarList(param);
|
|
if (!CollectionUtils.isEmpty(multiSimulationSceneCarVOS)) {
|
|
if (!CollectionUtils.isEmpty(multiSimulationSceneCarVOS)) {
|
|
@@ -468,6 +482,20 @@ public class MultiSimulationProjectServiceImpl implements MultiSimulationProject
|
|
}
|
|
}
|
|
|
|
|
|
public ResponseBodyVO<MultiSimulationSceneCarVO> addOrUpdateMultiSimulationSceneCar(MultiSimulationSceneCarParam param) {
|
|
public ResponseBodyVO<MultiSimulationSceneCarVO> addOrUpdateMultiSimulationSceneCar(MultiSimulationSceneCarParam param) {
|
|
|
|
+
|
|
|
|
+ String mapId = param.getMapId();
|
|
|
|
+ if (StringUtils.isBlank(mapId)){
|
|
|
|
+ String pathId = param.getPathId();
|
|
|
|
+ if (StringUtils.isBlank(pathId)){
|
|
|
|
+ return new ResponseBodyVO<>(ResponseBodyVO.Response.CLIENT_FAILURE, "地图id为空");
|
|
|
|
+ }else {
|
|
|
|
+ SimulationMapPathVO simulationMapPathVO = mapPathMapper.selectSimulationMapById(pathId);
|
|
|
|
+ if (simulationMapPathVO == null){
|
|
|
|
+ return new ResponseBodyVO<>(ResponseBodyVO.Response.CLIENT_FAILURE, "地图id为空");
|
|
|
|
+ }
|
|
|
|
+ param.setMapId(mapId);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
param.setCarId(StringUtils.isBlank(param.getCarId()) ? "" : param.getCarId());
|
|
param.setCarId(StringUtils.isBlank(param.getCarId()) ? "" : param.getCarId());
|
|
param.setAlgorithmId(StringUtils.isBlank(param.getAlgorithmId()) ? "" : param.getAlgorithmId());
|
|
param.setAlgorithmId(StringUtils.isBlank(param.getAlgorithmId()) ? "" : param.getAlgorithmId());
|
|
param.setPathId(StringUtils.isBlank(param.getPathId()) ? "" : param.getPathId());
|
|
param.setPathId(StringUtils.isBlank(param.getPathId()) ? "" : param.getPathId());
|
|
@@ -477,10 +505,8 @@ public class MultiSimulationProjectServiceImpl implements MultiSimulationProject
|
|
// param.setPathEndPoint(StringUtils.isBlank(param.getPathEndPoint()) ? "" : param.getPathEndPoint());
|
|
// param.setPathEndPoint(StringUtils.isBlank(param.getPathEndPoint()) ? "" : param.getPathEndPoint());
|
|
param.setCarSort(Objects.isNull(param.getCarSort()) ? 0 : param.getCarSort());
|
|
param.setCarSort(Objects.isNull(param.getCarSort()) ? 0 : param.getCarSort());
|
|
param.setAlgorithmType(param.getAlgorithmType() == null ? 0 : param.getAlgorithmType());
|
|
param.setAlgorithmType(param.getAlgorithmType() == null ? 0 : param.getAlgorithmType());
|
|
-
|
|
|
|
param.setPathStartStr(param.getPathStart().toJSONString());
|
|
param.setPathStartStr(param.getPathStart().toJSONString());
|
|
param.setPathEndStr(param.getPathEnd().toJSONString());
|
|
param.setPathEndStr(param.getPathEnd().toJSONString());
|
|
-
|
|
|
|
if (StringUtils.isBlank(param.getSceneCarId())) {
|
|
if (StringUtils.isBlank(param.getSceneCarId())) {
|
|
param.setSceneCarId(StringUtil.getRandomUUID());
|
|
param.setSceneCarId(StringUtil.getRandomUUID());
|
|
if (StringUtils.isBlank(param.getSceneId())) {
|
|
if (StringUtils.isBlank(param.getSceneId())) {
|
|
@@ -504,6 +530,7 @@ public class MultiSimulationProjectServiceImpl implements MultiSimulationProject
|
|
|
|
|
|
@Transactional
|
|
@Transactional
|
|
public ResponseBodyVO<List<MultiSimulationSceneCarVO>> addOrUpdateMultiSimulationSceneCarList(AddOrUpdateMultiSimulationSceneCarParam sceneCarParam) {
|
|
public ResponseBodyVO<List<MultiSimulationSceneCarVO>> addOrUpdateMultiSimulationSceneCarList(AddOrUpdateMultiSimulationSceneCarParam sceneCarParam) {
|
|
|
|
+ String mapId = sceneCarParam.getMapId();
|
|
List<MultiSimulationSceneCarParam> paramList = sceneCarParam.getParamList();
|
|
List<MultiSimulationSceneCarParam> paramList = sceneCarParam.getParamList();
|
|
if (CollectionUtils.isEmpty(paramList) || StringUtils.isBlank(sceneCarParam.getMapId())) {
|
|
if (CollectionUtils.isEmpty(paramList) || StringUtils.isBlank(sceneCarParam.getMapId())) {
|
|
return new ResponseBodyVO<>(ResponseBodyVO.Response.CLIENT_FAILURE, "数据为空");
|
|
return new ResponseBodyVO<>(ResponseBodyVO.Response.CLIENT_FAILURE, "数据为空");
|
|
@@ -522,14 +549,15 @@ public class MultiSimulationProjectServiceImpl implements MultiSimulationProject
|
|
}
|
|
}
|
|
List<MultiSimulationSceneCarVO> ids = new ArrayList<>();
|
|
List<MultiSimulationSceneCarVO> ids = new ArrayList<>();
|
|
for (MultiSimulationSceneCarParam param : paramList) {
|
|
for (MultiSimulationSceneCarParam param : paramList) {
|
|
|
|
+ param.setMapId(mapId);
|
|
ResponseBodyVO<MultiSimulationSceneCarVO> responseBodyVO = addOrUpdateMultiSimulationSceneCar(param);
|
|
ResponseBodyVO<MultiSimulationSceneCarVO> responseBodyVO = addOrUpdateMultiSimulationSceneCar(param);
|
|
if (responseBodyVO.getCode() != 200) {
|
|
if (responseBodyVO.getCode() != 200) {
|
|
throw new RuntimeException("操作失败");
|
|
throw new RuntimeException("操作失败");
|
|
}
|
|
}
|
|
ids.add(responseBodyVO.getInfo());
|
|
ids.add(responseBodyVO.getInfo());
|
|
}
|
|
}
|
|
- String mapId = sceneVO.getMapId();
|
|
|
|
- if (!StringUtils.equals(mapId, sceneCarParam.getMapId())){
|
|
|
|
|
|
+ String oldMapId = sceneVO.getMapId();
|
|
|
|
+ if (!StringUtils.equals(oldMapId, sceneCarParam.getMapId())){
|
|
int i = simulationSceneMapper.updateMultiSimulationSceneMapId(sceneCarParam.getMapId(), sceneCarParam.getSceneId());
|
|
int i = simulationSceneMapper.updateMultiSimulationSceneMapId(sceneCarParam.getMapId(), sceneCarParam.getSceneId());
|
|
if (i <= 0){
|
|
if (i <= 0){
|
|
throw new RuntimeException("操作失败");
|
|
throw new RuntimeException("操作失败");
|
|
@@ -797,7 +825,9 @@ public class MultiSimulationProjectServiceImpl implements MultiSimulationProject
|
|
JSONObject objectEnd = JSONObject.parseObject(pathEnd);
|
|
JSONObject objectEnd = JSONObject.parseObject(pathEnd);
|
|
MultiSimulationSceneCarParam multiSimulationSceneCarParam = new MultiSimulationSceneCarParam();
|
|
MultiSimulationSceneCarParam multiSimulationSceneCarParam = new MultiSimulationSceneCarParam();
|
|
multiSimulationSceneCarParam.setSceneCarId(carVO.getId()).setSceneId(newSceneId)
|
|
multiSimulationSceneCarParam.setSceneCarId(carVO.getId()).setSceneId(newSceneId)
|
|
- .setCarId(carVO.getCarId()).setAlgorithmId(carVO.getAlgorithmId()).setPathId(carVO.getPathId())
|
|
|
|
|
|
+ .setCarId(carVO.getCarId()).setAlgorithmId(carVO.getAlgorithmId())
|
|
|
|
+ .setMapId(carVO.getMapId())
|
|
|
|
+ .setPathId(carVO.getPathId())
|
|
.setPathStart(objectStart).setPathEnd(objectEnd)
|
|
.setPathStart(objectStart).setPathEnd(objectEnd)
|
|
.setPathStartStr(pathStart)
|
|
.setPathStartStr(pathStart)
|
|
.setPathEndStr(pathEnd)
|
|
.setPathEndStr(pathEnd)
|