李春阳 1 год назад
Родитель
Сommit
acb151cb26

+ 26 - 15
simulation-resource-server/src/main/java/com/css/simulation/resource/server/app/service/SceneReferenceLibService.java

@@ -7,6 +7,7 @@ import api.common.pojo.param.scene.*;
 import api.common.pojo.po.scene.*;
 import api.common.pojo.po.system.SceneImportPO;
 import api.common.util.*;
+import com.alibaba.druid.util.StringUtils;
 import com.css.simulation.resource.server.infra.db.mysql.mapper.*;
 import com.css.simulation.resource.server.infra.feign.service.FileDownService;
 import com.css.simulation.resource.server.infra.util.AuthUtil;
@@ -226,7 +227,7 @@ public class SceneReferenceLibService {
                                     ObjectMapper objMap = new ObjectMapper();
                                     JsonNode root = objMap.readTree(json);
                                     // 判断场景名称唯一
-                                    sceneName = root.path("场景名称").asText();
+                                    sceneName = root.path("scenario_name").asText();
                                     sceneNames.add(sceneName);
                                     String osgb = root.path("osgb").asText();
                                     String xodr = root.path("xodr").asText();
@@ -245,20 +246,30 @@ public class SceneReferenceLibService {
                                     if (CollectionUtil.isNotEmpty(scenes)) {
                                         isupdate = true;
                                     }
-                                    String mainBehavior = root.path("主车行为").asText();
-                                    String otherBehavior = root.path("他车行为").asText();
-                                    sceneReferenceLibPO.setMainBehavior(mainBehavior);
-                                    sceneReferenceLibPO.setOtherBehavior(otherBehavior);
-                                    sceneReferenceLibPO.setMaxTime(root.path("max_time").asText());
-                                    sceneReferenceLibPO.setWeather(root.path("天气").asText());
-                                    sceneReferenceLibPO.setRoadType(root.path("道路类型").asText());
-                                    sceneReferenceLibPO.setRoadGeometryPlane(root.path("道路几何-平面").asText());
-                                    sceneReferenceLibPO.setRoadGeometryVertical(root.path("道路几何-纵断面").asText());
-                                    sceneReferenceLibPO.setAutoDriveFunction(root.path("自动驾驶功能").asText());
-                                    sceneReferenceLibPO.setOperationArea(root.path("运行区域").asText());
-                                    sceneReferenceLibPO.setSceneDescription(root.path("场景描述").asText());
-                                    sceneReferenceLibPO.setLabel(root.path("标签").asText());
-                                    sceneReferenceLibPO.setAutoDriveFunction(root.path("自动驾驶功能").asText());
+                                    String mainBehavior = root.path("ego_action").asText();
+                                    String otherBehavior = root.path("target_action").asText();
+                                    String replaceStr = "none";
+                                    String maxTime = root.path("max_time").asText();
+//                                    Iterator<JsonNode> weather = root.path("scenario_weather").elements();
+                                    String scenarioWeather = root.withArray("scenario_weather").asText();
+                                    String rodeType = root.path("rode_type").asText();
+                                    String roadPlaneGeometry = root.path("road_plane_geometry").asText();
+                                    String roadProfileGeometry = root.path("road_profile_geometry").asText();
+                                    String autonomousDrivingFunction = root.path("autonomous_driving_function").asText();
+                                    String drivingArea = root.path("driving_area").asText();
+                                    String sceneDescription = root.path("scene_description").asText();
+                                    String scenaroTag = root.path("scenaro_tag").asText();
+                                    sceneReferenceLibPO.setMainBehavior(StringUtils.equals(mainBehavior, replaceStr) ? "" : mainBehavior);
+                                    sceneReferenceLibPO.setOtherBehavior(StringUtils.equals(otherBehavior, replaceStr) ? "" : otherBehavior);
+                                    sceneReferenceLibPO.setMaxTime(StringUtils.equals(maxTime, replaceStr) ? "" : maxTime);
+                                    sceneReferenceLibPO.setWeather(StringUtils.equals(scenarioWeather, replaceStr) ? "" : scenarioWeather);
+                                    sceneReferenceLibPO.setRoadType(StringUtils.equals(rodeType, replaceStr) ? "" : rodeType);
+                                    sceneReferenceLibPO.setRoadGeometryPlane(StringUtils.equals(roadPlaneGeometry, replaceStr) ? "" : roadPlaneGeometry);
+                                    sceneReferenceLibPO.setRoadGeometryVertical(StringUtils.equals(roadProfileGeometry, replaceStr) ? "" : roadProfileGeometry);
+                                    sceneReferenceLibPO.setAutoDriveFunction(StringUtils.equals(autonomousDrivingFunction, replaceStr) ? "" : autonomousDrivingFunction);
+                                    sceneReferenceLibPO.setOperationArea(StringUtils.equals(drivingArea, replaceStr) ? "" : drivingArea);
+                                    sceneReferenceLibPO.setSceneDescription(StringUtils.equals(sceneDescription, replaceStr) ? "" : sceneDescription);
+                                    sceneReferenceLibPO.setLabel(StringUtils.equals(scenaroTag, replaceStr) ? "" : scenaroTag);
                                     sceneReferenceLibPO.setIsDeleted(DictConstants.IS_AVAILABLE);
                                     if (ObjectUtil.isNull(sceneReferenceLibPO.getOsgbAddress())) {
                                         sceneReferenceLibPO.setOsgbAddress(osgbAdress);

+ 2 - 1
simulation-resource-server/src/main/java/com/css/simulation/resource/server/infra/db/mysql/mapper/SceneRiskMapper.java

@@ -14,8 +14,9 @@ public interface SceneRiskMapper {
     List<SceneRiskPO> selectSceneIdsByEvaluation(SceneRiskPO sceneRiskPO);
 
 
-    @Select("select sr.risk_id, sr.scene_id, sr.scene_type,sr.rule_id ,ser.rule_name, sr.task_id ,sr.risk, sr.risk_level\n" +
+    @Select("select sr.risk_id, sr.scene_id, sr.scene_type,sr.rule_id ,ser.rule_name, sr.task_id ,sr.risk, sr.risk_level, mv.vehicle_name, a.algorithm_name \n" +
             "from scene_risk sr LEFT JOIN scene_evaluation_rule ser  ON ser.rule_id = sr.rule_id \n" +
+            "INNER JOIN algorithm a  ON sr.algorithm_id = a.id INNER JOIN model_vehicle mv ON mv.id = sr.vehicleId \n" +
             "where sr.scene_id = #{sceneId} order by sr.create_time desc" )
     List<SceneRiskPO> querySceneEvaluationRiskDetail(@Param("sceneId") String sceneId);
 

+ 6 - 4
simulation-resource-server/src/main/resources/mysql/mapper/SceneReferenceLibMapper.xml

@@ -5,12 +5,14 @@
 
     <insert id="saveSceneReference" parameterType="api.common.pojo.po.scene.SceneReferenceLibPO">
         insert into simulation.scene_standards_regulations
-        (regulations_id, scene_name, regulation_type, standard_type,
+        (scene_id, scene_name, main_behavior, other_behavior, weather,road_type,road_geometry_plane,road_geometry_vertical,
+         auto_drive_function, operation_area,scene_description,label,
          create_user_id, create_time, modify_user_id, modify_time,
-         is_deleted, share, video_preview, video_address, osgb_address, xml_address, xodr_address,
+         is_deleted, video_preview, video_address, osgb_address, xml_address, xodr_address,
          json_address, max_time)
-        values (#{regulationsId,jdbcType=VARCHAR}, #{sceneName,jdbcType=VARCHAR}, #{regulationType,jdbcType=VARCHAR},
-                #{standardType,jdbcType=VARCHAR},
+        values (#{sceneId,jdbcType=VARCHAR},#{sceneName,jdbcType=VARCHAR}, #{mainBehavior,jdbcType=VARCHAR}, #{otherBehavior,jdbcType=VARCHAR},
+                #{weather,jdbcType=VARCHAR}, #{roadType,jdbcType=VARCHAR}, #{roadGeometryPlane,jdbcType=VARCHAR}, #{roadGeometryVertical,jdbcType=VARCHAR},
+                #{autoDriveFunction,jdbcType=VARCHAR}, #{operationArea,jdbcType=VARCHAR}, #{sceneDescription,jdbcType=VARCHAR}, #{label,jdbcType=VARCHAR},
                 #{createUserId,jdbcType=VARCHAR}, #{createTime}, #{modifyUserId,jdbcType=VARCHAR}, #{modifyTime},
                 #{isDeleted,jdbcType=VARCHAR}, #{share,jdbcType=VARCHAR}, #{videoPreview,jdbcType=VARCHAR},
                 #{videoAddress,jdbcType=VARCHAR}, #{osgbAddress,jdbcType=VARCHAR},