李春阳 před 1 rokem
rodič
revize
6deec15450

+ 8 - 8
api-common/src/main/java/api/common/pojo/param/scene/SceneReferenceLibParam.java

@@ -21,21 +21,21 @@ public class SceneReferenceLibParam extends PageVO implements Serializable {
     // 基准场景名称
     private String sceneName;
     // 主车动作
-    private String[][] mainBehavior;
+    private List<String> mainBehavior;
     // 他车动作
-    private String[][] otherBehavior;
+    private List<String> otherBehavior;
     // 天气
-    private String[][] weather;
+    private List<String> weather;
     // 道路类型
-    private String[][] roadType;
+    private List<String> roadType;
     // 道路几何-平面
-    private String[][] roadGeometryPlane;
+    private List<String> roadGeometryPlane;
     // 道路几何-纵断面
-    private String[][] roadGeometryVertical;
+    private List<String> roadGeometryVertical;
     // 自动驾驶功能
-    private String[][] autoDriveFunction;
+    private List<String> autoDriveFunction;
     // 运行区域
-    private String[][] operationArea;
+    private List<String> operationArea;
     // 场景描述
     private String sceneDescription;
     // 复杂度下限

+ 2 - 1
simulation-resource-server/src/main/java/com/css/simulation/resource/server/adapter/controller/scene_library/scene_reference_lib/SceneReferenceLibController.java

@@ -4,6 +4,7 @@ import api.common.pojo.common.ResponseBodyVO;
 import api.common.pojo.constants.DictConstants;
 import api.common.pojo.param.scene.SceneImportParam;
 import api.common.pojo.param.scene.SceneReferenceLibParam;
+import api.common.pojo.param.scene.SceneReferenceLibSelectParam;
 import api.common.pojo.po.scene.*;
 import api.common.pojo.po.system.SceneImportPO;
 import api.common.pojo.vo.scene.SceneReferenceLibVO;
@@ -63,7 +64,7 @@ public class SceneReferenceLibController {
      * @return
      */
     @PostMapping("/querySceneReferenceLibList")
-    public ResponseBodyVO<PageInfo<SceneReferenceLibVO>> querySceneReferenceLibList(@RequestBody SceneReferenceLibParam params) {
+    public ResponseBodyVO<PageInfo<SceneReferenceLibVO>> querySceneReferenceLibList(@RequestBody SceneReferenceLibSelectParam params) {
         PageUtil.setPageInfo(params);
         List<SceneReferenceLibPO> list = sceneReferenceLibService.querySceneReferenceLibList(params);
         PageInfo<SceneReferenceLibPO> objectPageInfo = new PageInfo<>(list);

+ 9 - 82
simulation-resource-server/src/main/java/com/css/simulation/resource/server/app/service/SceneReferenceLibService.java

@@ -51,7 +51,7 @@ public class SceneReferenceLibService {
     @Resource
     private SystemScenePackageSublistMapper systemScenePackageSublistMapper;
 
-    public SceneEvaluationOperatePO getSceneEvaluationFirst(SceneReferenceLibParam params, List<String> sceneIdList) {
+    public SceneEvaluationOperatePO getSceneEvaluationFirst(SceneReferenceLibSelectParam params, List<String> sceneIdList) {
         // 添加复杂度 危险度数据
         SceneEvaluationForListParam sceneEvaluationForListParam = new SceneEvaluationForListParam();
         BeanUtils.copyProperties(params, sceneEvaluationForListParam);
@@ -59,95 +59,22 @@ public class SceneReferenceLibService {
         return sceneEvaluationRuleService.getSceneEvaluationFirst(sceneEvaluationForListParam);
     }
 
-    private void copyEvaluationParams(SceneReferenceLibParam params, SceneReferenceLibSelectParam po) {
-        po.setComplexityLevel(params.getComplexityLevel());
-        po.setMinComplexity(params.getMinComplexity());
-        po.setMaxComplexity(params.getMaxComplexity());
-        po.setRiskLevel(params.getRiskLevel());
-        po.setMinRisk(params.getMinRisk());
-        po.setMaxRisk(params.getMaxRisk());
-        if (StringUtil.isNotEmpty(params.getComplexityLevel()) || StringUtil.isNotEmpty(params.getMinComplexity()) || StringUtil.isNotEmpty(params.getMaxComplexity())) {
-            po.setNeedComplexity("1");
-        }
-        if (StringUtil.isNotEmpty(params.getRiskLevel()) || StringUtil.isNotEmpty(params.getMinRisk()) || StringUtil.isNotEmpty(params.getMaxRisk())) {
-            po.setNeedRisk("1");
-        }
-        po.setComplexityLevels(SceneEvaluationLevel.getEvaluationLevelList(params.getComplexityLevel()));
-        po.setRiskLevels(SceneEvaluationLevel.getEvaluationLevelList(params.getRiskLevel()));
-    }
-
     /**
      * 获取基准场景库列表
      *
-     * @param params
+     * @param srl
      * @return
      */
-    public List<SceneReferenceLibPO> querySceneReferenceLibList(SceneReferenceLibParam params) {
+    public List<SceneReferenceLibPO> querySceneReferenceLibList(SceneReferenceLibSelectParam srl) {
 
-        SceneReferenceLibSelectParam srl = new SceneReferenceLibSelectParam();
-        copyEvaluationParams(params, srl);
-        // 场景名称
-        String sceneName = params.getSceneName();
-        // 主车行为
-        String[][] mainBehavior = params.getMainBehavior();
-        String[][] otherBehavior = params.getOtherBehavior();
-        String[][] weather = params.getWeather();
-        String[][] roadType = params.getRoadType();
-        String[][] roadGeometryPlane = params.getRoadGeometryPlane();
-        String[][] roadGeometryVertical = params.getRoadGeometryVertical();
-        String[][] autoDriveFunction = params.getAutoDriveFunction();
-        String[][] operationArea = params.getOperationArea();
-        //判断下拉选项是否为空
-        if (ObjectUtil.isNotNull(params.getIds())) {
-            srl.setIds(params.getIds());
-        }
-        if (mainBehavior != null && mainBehavior.length > 0) {
-            ParamUtil.arrConvertObj(mainBehavior, srl);
-            for (String[] arr : mainBehavior) {
-                if (arr != null && arr.length == 1) {
-                    List<String> list = srl.getMainBehavior();
-                    if (list == null) {
-                        List<String> newList = new ArrayList<>();
-                        newList.add(arr[0]);
-                        srl.setMainBehavior(newList);
-                    } else {
-                        list.add(arr[0]);
-                        srl.setMainBehavior(list);
-                    }
-                }
-            }
-        }
-        srl.setSceneId(params.getSceneId());
-        srl.setMinComplexity(params.getMinComplexity());
-        srl.setMaxComplexity(params.getMaxComplexity());
-        srl.setMinRisk(params.getMinRisk());
-        srl.setMaxRisk(params.getMaxRisk());
-        srl.setComplexityLevel(params.getComplexityLevel());
-        srl.setRiskLevel(params.getRiskLevel());
-        srl.setSceneDescription(params.getSceneDescription());
-        srl.setLabel(params.getLabel());
-        srl.setSceneName(sceneName);
-        if (otherBehavior != null && otherBehavior.length > 0) {
-            ParamUtil.arrConvertObj(otherBehavior, srl);
-        }
-        if (weather != null && weather.length > 0) {
-            ParamUtil.arrConvertObj(weather, srl);
-        }
-        if (roadType != null && roadType.length > 0) {
-            ParamUtil.arrConvertObj(roadType, srl);
-        }
-        if (roadGeometryPlane != null && roadGeometryPlane.length > 0) {
-            ParamUtil.arrConvertObj(roadGeometryPlane, srl);
-        }
-        if (roadGeometryVertical != null && roadGeometryVertical.length > 0) {
-            ParamUtil.arrConvertObj(roadGeometryVertical, srl);
-        }
-        if (autoDriveFunction != null && autoDriveFunction.length > 0) {
-            ParamUtil.arrConvertObj(autoDriveFunction, srl);
+        if (StringUtil.isNotEmpty(srl.getComplexityLevel()) || StringUtil.isNotEmpty(srl.getMinComplexity()) || StringUtil.isNotEmpty(srl.getMaxComplexity())) {
+            srl.setNeedComplexity("1");
         }
-        if (operationArea != null && operationArea.length > 0) {
-            ParamUtil.arrConvertObj(operationArea, srl);
+        if (StringUtil.isNotEmpty(srl.getRiskLevel()) || StringUtil.isNotEmpty(srl.getMinRisk()) || StringUtil.isNotEmpty(srl.getMaxRisk())) {
+            srl.setNeedRisk("1");
         }
+        srl.setComplexityLevels(SceneEvaluationLevel.getEvaluationLevelList(srl.getComplexityLevel()));
+        srl.setRiskLevels(SceneEvaluationLevel.getEvaluationLevelList(srl.getRiskLevel()));
 
         // 查询
         List<SceneReferenceLibPO> sceneReferenceLibPOS = sceneReferenceLibMapper.querySceneReferenceLibList(srl);