李春阳 1 年之前
父节点
当前提交
d0b91b02bb

+ 5 - 0
simulation-resource-scheduler/src/main/java/com/css/simulation/resource/scheduler/app/service/ProjectApplicationService.java

@@ -662,6 +662,7 @@ public class ProjectApplicationService {
             String standardIds = leafIndex.getSceneStatueIds();
             String accidentIds = leafIndex.getSceneTrafficIds();
             String generalizationIds = leafIndex.getSceneGeneralizationIds();
+            String sceneReferenceIds = leafIndex.getSceneReferenceLibIds();
             if (StringUtil.isNotEmpty(naturalIds)) {
                 List<String> naturalIdList = new ArrayList<>(Arrays.asList(naturalIds.split(",")));
                 sceneList.addAll(sceneMapper.selectNaturalByIdList(naturalIdList));
@@ -678,6 +679,10 @@ public class ProjectApplicationService {
                 List<String> generalizationIdList = new ArrayList<>(Arrays.asList(generalizationIds.split(",")));
                 sceneList.addAll(sceneMapper.selectGeneralizationByIdList(generalizationIdList));
             }
+            if (StringUtil.isNotEmpty(sceneReferenceIds)) {
+                List<String> sceneReferenceIdList = new ArrayList<>(Arrays.asList(sceneReferenceIds.split(",")));
+                sceneList.addAll(sceneMapper.selectReferenceLibByIdList(sceneReferenceIdList));
+            }
         });
         log.info("项目" + projectId + " 共有 " + sceneList.size() + " 个任务:" + sceneList);
         return sceneList;

+ 2 - 0
simulation-resource-scheduler/src/main/java/com/css/simulation/resource/scheduler/infra/db/mysql/mapper/IndexMapper.java

@@ -82,6 +82,7 @@ public interface IndexMapper {
             "       or scene_traffic_ids like #{idExtend}\n" +
             "       or scene_statue_ids like #{idExtend}\n" +
             "       or scene_generalization_ids like #{idExtend}\n" +
+            "       or scene_reference_lib_ids like #{idExtend}\n" +
             "       )")
     List<String> selectLeafIndexIdByManualProjectIdAndSceneId(@Param("projectId") String projectId, @Param("idExtend") String idExtend);
 
@@ -97,6 +98,7 @@ public interface IndexMapper {
             "    or scene_traffic_ids like #{idExtend}\n" +
             "    or scene_statue_ids like #{idExtend}\n" +
             "    or scene_generalization_ids like #{idExtend}\n" +
+            "    or scene_reference_lib_ids like #{idExtend}\n" +
             "    )")
     List<String> selectLeafIndexIdByAutoSubProjectIdAndSceneId(@Param("projectId") String projectId, @Param("idExtend") String idExtend);
 

+ 1 - 0
simulation-resource-scheduler/src/main/java/com/css/simulation/resource/scheduler/infra/db/mysql/mapper/IndexTemplateMapper.java

@@ -35,6 +35,7 @@ public interface IndexTemplateMapper {
             "       sps.scene_traffic_ids,\n" +
             "       sps.scene_statue_ids,\n" +
             "       sps.scene_generalization_ids,\n" +
+            "       sps.scene_reference_lib_ids,\n" +
             "       sps.weight,\n" +
             "       sps.parent_id,\n" +
             "       sps.root_id,\n" +

+ 19 - 0
simulation-resource-scheduler/src/main/java/com/css/simulation/resource/scheduler/infra/db/mysql/mapper/SceneMapper.java

@@ -118,4 +118,23 @@ public interface SceneMapper {
             "</if>\n" +
             "</script>")
     List<SceneEntity> selectGeneralizationByIdList(@Param("idList")List<String> idList);
+
+    @ResultMap("scene")
+    @Select("<script>" +
+            "select id           id,\n" +
+            "       scene_id     name,\n" +
+            "       '5'          type,\n" +
+            "       xosc_address osc,\n" +
+            "       osgb_address osgb,\n" +
+            "       xodr_address odr\n" +
+            "from scene_reference_lib\n" +
+            "where 1 = 1\n\n" +
+            "<if test='idList != null and idList.size() > 0'>\n" +
+            "   and id in\n" +
+            "       <foreach collection='idList' index='index' item='item' open='(' close=')' separator=','>\n" +
+            "           #{item}" +
+            "       </foreach>\n" +
+            "</if>\n" +
+            "</script>")
+    List<SceneEntity> selectReferenceLibByIdList(@Param("idList")List<String> idList);
 }

+ 2 - 0
simulation-resource-scheduler/src/main/java/com/css/simulation/resource/scheduler/infra/entity/IndexTemplateEntity.java

@@ -16,6 +16,7 @@ public class IndexTemplateEntity {
     private String sceneTrafficIds;
     private String sceneStatueIds;
     private String sceneGeneralizationIds;
+    private String sceneReferenceLibIds;
     private String weight;  // 权重
     private String parentId;  // 父指标 id
     private String rootId;  // 场景测试包 id
@@ -34,6 +35,7 @@ public class IndexTemplateEntity {
                 ", sceneTrafficIds='" + sceneTrafficIds + '\'' +
                 ", sceneStatueIds='" + sceneStatueIds + '\'' +
                 ", sceneGeneralizationIds='" + sceneGeneralizationIds + '\'' +
+                ", sceneReferenceLibIds='" + sceneReferenceLibIds + '\'' +
                 ", weight='" + weight + '\'' +
                 ", parentId='" + parentId + '\'' +
                 ", rootId='" + rootId + '\'' +