李春阳 1 năm trước cách đây
mục cha
commit
43f1a90937
25 tập tin đã thay đổi với 174 bổ sung108 xóa
  1. 1 0
      api-common/src/main/java/api/common/pojo/constants/DictConstants.java
  2. 0 48
      api-common/src/main/java/api/common/pojo/enums/SceneEvaluationEnum.java
  3. 29 0
      api-common/src/main/java/api/common/pojo/enums/SceneEvaluationLevel.java
  4. 2 0
      api-common/src/main/java/api/common/pojo/param/scene/SceneAccidentParam.java
  5. 2 0
      api-common/src/main/java/api/common/pojo/param/scene/SceneNaturalParam.java
  6. 2 0
      api-common/src/main/java/api/common/pojo/param/scene/SceneReferenceLibSelectParam.java
  7. 2 0
      api-common/src/main/java/api/common/pojo/param/scene/StandardsRegulationsParam.java
  8. 1 0
      api-common/src/main/java/api/common/pojo/po/scene/SceneComplexityPO.java
  9. 1 0
      api-common/src/main/java/api/common/pojo/po/scene/SceneRiskPO.java
  10. 4 4
      simulation-resource-scene/src/main/java/com/css/simulation/resource/scene/controller/SceneImportController.java
  11. 2 3
      simulation-resource-scheduler/src/main/java/com/css/simulation/resource/scheduler/infra/runnable/SceneEvaluationComputeRunnable.java
  12. 0 5
      simulation-resource-server/src/main/java/com/css/simulation/resource/server/adapter/controller/scene_library/score_rule/ScoreRuleController.java
  13. 0 3
      simulation-resource-server/src/main/java/com/css/simulation/resource/server/app/impl/SimulationProjectServiceImpl.java
  14. 4 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/server/app/service/SceneAccidentService.java
  15. 3 5
      simulation-resource-server/src/main/java/com/css/simulation/resource/server/app/service/SceneEvaluationRuleService.java
  16. 3 2
      simulation-resource-server/src/main/java/com/css/simulation/resource/server/app/service/SceneNaturalService.java
  17. 3 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/server/app/service/SceneReferenceLibService.java
  18. 3 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/server/app/service/SceneStandardsService.java
  19. 36 12
      simulation-resource-server/src/main/resources/mysql/mapper/SceneAccidentMapper.xml
  20. 6 2
      simulation-resource-server/src/main/resources/mysql/mapper/SceneComplexityMapper.xml
  21. 4 2
      simulation-resource-server/src/main/resources/mysql/mapper/SceneEvaluationRuleMapper.xml
  22. 24 8
      simulation-resource-server/src/main/resources/mysql/mapper/SceneNaturalMapper.xml
  23. 12 4
      simulation-resource-server/src/main/resources/mysql/mapper/SceneReferenceLibMapper.xml
  24. 6 2
      simulation-resource-server/src/main/resources/mysql/mapper/SceneRiskMapper.xml
  25. 24 8
      simulation-resource-server/src/main/resources/mysql/mapper/SceneStandardsRegulationsMapper.xml

+ 1 - 0
api-common/src/main/java/api/common/pojo/constants/DictConstants.java

@@ -166,6 +166,7 @@ public class DictConstants {
     public static final String SCENE_IMPORT_STATUS_2 = "2"; //上传完成
     public static final String SCENE_IMPORT_STATUS_3 = "3"; //解析中
     public static final String SCENE_IMPORT_STATUS_4 = "4"; //解析完成
+    public static final String SCENE_IMPORT_STATUS_5 = "5"; //上传失败
 
     // 项目类型
     public static final String PROJECT_TYPE_MANUAL = "1"; // 手动运行项目

+ 0 - 48
api-common/src/main/java/api/common/pojo/enums/SceneEvaluationEnum.java

@@ -1,48 +0,0 @@
-package api.common.pojo.enums;
-
-import lombok.Getter;
-
-import java.util.Objects;
-
-@Getter
-public enum SceneEvaluationEnum {
-
-    S_LEVEL("S", "90"),
-    AA_LEVEL("AA", "85"),
-    A_LEVEL("A", "80"),
-    B_LEVEL("B", "70"),
-    C_LEVEL("C", "60");
-
-    private String level;
-
-    private String levelValue;
-
-    SceneEvaluationEnum(String level, String levelValue) {
-        this.level = level;
-        this.levelValue = levelValue;
-    }
-
-    public static String matchLevelEnumByLevelValue(String levelValue) {
-        if (Objects.isNull(levelValue)) {
-            return null;
-        }
-        for (SceneEvaluationEnum enums : SceneEvaluationEnum.values()) {
-            if (enums.getLevelValue().equals(levelValue)) {
-                return enums.getLevel();
-            }
-        }
-        return levelValue;
-    }
-
-    public static String matchLevelEnumByLevel(String level) {
-        if (Objects.isNull(level)) {
-            return null;
-        }
-        for (SceneEvaluationEnum enums : SceneEvaluationEnum.values()) {
-            if (enums.getLevel().equals(level)) {
-                return enums.getLevelValue();
-            }
-        }
-        return level;
-    }
-}

+ 29 - 0
api-common/src/main/java/api/common/pojo/enums/SceneEvaluationLevel.java

@@ -0,0 +1,29 @@
+package api.common.pojo.enums;
+
+import lombok.Getter;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+@Getter
+public class SceneEvaluationLevel {
+
+    // 由小到大
+    private final static List<String> EVALUATION_LEVEL = new ArrayList<>(Arrays.asList("C", "B", "A", "AA", "S"));
+
+    public static List<String> getEvaluationLevelList(String level) {
+        List<String> selectEvaluationLevels = new ArrayList<>();
+        int index = -1;
+        for (int i = 0; i < EVALUATION_LEVEL.size(); i++) {
+            if (EVALUATION_LEVEL.get(i).equals(level)) {
+                index = i;
+            }
+            if (index >= i) {
+                selectEvaluationLevels.add(EVALUATION_LEVEL.get(i));
+                index++;
+            }
+        }
+        return selectEvaluationLevels;
+    }
+}

+ 2 - 0
api-common/src/main/java/api/common/pojo/param/scene/SceneAccidentParam.java

@@ -54,6 +54,8 @@ public class SceneAccidentParam extends PageVO implements Serializable {
     private String maxRisk;
     // 复杂度等级
     private String complexityLevel;
+    private List<String> complexityLevels;
+    private List<String> riskLevels;
     // 危险度等级
     private String riskLevel;
     private String needComplexity;

+ 2 - 0
api-common/src/main/java/api/common/pojo/param/scene/SceneNaturalParam.java

@@ -86,4 +86,6 @@ public class SceneNaturalParam extends PageVO implements Serializable {
     private String riskLevel;
     private String needComplexity;
     private String needRisk;
+    private List<String> complexityLevels;
+    private List<String> riskLevels;
 }

+ 2 - 0
api-common/src/main/java/api/common/pojo/param/scene/SceneReferenceLibSelectParam.java

@@ -64,4 +64,6 @@ public class SceneReferenceLibSelectParam extends PageVO implements Serializable
     private String userId;
     private String needComplexity;
     private String needRisk;
+    private List<String> complexityLevels;
+    private List<String> riskLevels;
 }

+ 2 - 0
api-common/src/main/java/api/common/pojo/param/scene/StandardsRegulationsParam.java

@@ -52,4 +52,6 @@ public class StandardsRegulationsParam extends PageVO implements Serializable {
     private String riskLevel;
     private String needComplexity;
     private String needRisk;
+    private List<String> complexityLevels;
+    private List<String> riskLevels;
 }

+ 1 - 0
api-common/src/main/java/api/common/pojo/po/scene/SceneComplexityPO.java

@@ -24,6 +24,7 @@ public class SceneComplexityPO implements Serializable {
     private String taskId;
     private String complexity;
     private String complexityLevel;
+    private List<String> complexityLevels;
     private String isDeleted;
     // 复杂度下限
     private String minComplexity;

+ 1 - 0
api-common/src/main/java/api/common/pojo/po/scene/SceneRiskPO.java

@@ -27,6 +27,7 @@ public class SceneRiskPO implements Serializable {
     private String taskId;
     private String risk;
     private String riskLevel;
+    private List<String> riskLevels;
     private String minRisk;
     private String maxRisk;
     private List<String> sceneIdList;

+ 4 - 4
simulation-resource-scene/src/main/java/com/css/simulation/resource/scene/controller/SceneImportController.java

@@ -100,7 +100,7 @@ public class SceneImportController {
         SceneEvaluationRulePO sceneEvaluationRulePO = new SceneEvaluationRulePO();
         sceneEvaluationRulePO.setRuleId(po.getRuleId());
         if (!file.exists()) {
-            sceneEvaluationRulePO.setStatus(DictConstants.SCENE_IMPORT_STATUS_0);
+            sceneEvaluationRulePO.setStatus(DictConstants.SCENE_IMPORT_STATUS_5);
             sceneEvaluationRulePO.setErrorMsg("路径错误,文件不存在");
             sceneImportService.updateSceneEvaluationRule(sceneEvaluationRulePO);
             return new ResponseBodyVO<>(ResponseBodyVO.Response.CLIENT_FAILURE);
@@ -114,8 +114,8 @@ public class SceneImportController {
             String fileName = file.getName();
             boolean uploadSuccess = sceneImportService.startUploadEvaluationScript(objectPath, fileName, po.getLocalPath());
             if (!uploadSuccess) {
-                sceneEvaluationRulePO.setStatus(DictConstants.SCENE_IMPORT_STATUS_0);
-                sceneEvaluationRulePO.setErrorMsg("文件上传失败");
+                sceneEvaluationRulePO.setStatus(DictConstants.SCENE_IMPORT_STATUS_5);
+                sceneEvaluationRulePO.setErrorMsg("上传到 minio 失败");
                 sceneImportService.updateSceneEvaluationRule(sceneEvaluationRulePO);
                 return new ResponseBodyVO<>(ResponseBodyVO.Response.CLIENT_FAILURE);
             }
@@ -136,7 +136,7 @@ public class SceneImportController {
         } catch (Exception e) {
             log.error("上传可执行文件失败:" + po.getRuleId(), e);
             sceneImportService.deleteOldSceneEvaluationRuleFile(objectPath);
-            sceneEvaluationRulePO.setStatus(DictConstants.SCENE_IMPORT_STATUS_0);
+            sceneEvaluationRulePO.setStatus(DictConstants.SCENE_IMPORT_STATUS_5);
             sceneEvaluationRulePO.setErrorMsg("上传失败");
             sceneEvaluationRulePO.setModifyTime(TimeUtil.getNowForMysql());
             sceneEvaluationRulePO.setModifyUserId(AuthUtil.getCurrentUserId());

+ 2 - 3
simulation-resource-scheduler/src/main/java/com/css/simulation/resource/scheduler/infra/runnable/SceneEvaluationComputeRunnable.java

@@ -33,7 +33,6 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 
-import static api.common.pojo.enums.SceneEvaluationEnum.matchLevelEnumByLevel;
 
 /**
  * @author 15765
@@ -224,7 +223,7 @@ public class SceneEvaluationComputeRunnable implements Runnable {
                     sceneComplexityPO.setSceneType(sceneEvaluationComputeSubParam.getSceneType());
                     sceneComplexityPO.setRuleId(ruleId);
                     sceneComplexityPO.setTaskId(sceneEvaluationComputeParam.getTaskId());
-                    sceneComplexityPO.setComplexityLevel(matchLevelEnumByLevel(complexityLevel));
+                    sceneComplexityPO.setComplexityLevel(complexityLevel);
                     sceneComplexityPO.setIsDeleted(DictConstants.IS_NOT_DELETED);
                     sceneComplexityPO.setCreateUserId(sceneEvaluationComputeParam.getCreateUserId());
                     sceneComplexityPO.setCreateTime(TimeUtil.getNowForMysql());
@@ -244,7 +243,7 @@ public class SceneEvaluationComputeRunnable implements Runnable {
                     sceneRiskPO.setSceneType(sceneEvaluationComputeSubParam.getSceneType());
                     sceneRiskPO.setRuleId(ruleId);
                     sceneRiskPO.setTaskId(sceneEvaluationComputeParam.getTaskId());
-                    sceneRiskPO.setRiskLevel(matchLevelEnumByLevel(riskLevel));
+                    sceneRiskPO.setRiskLevel(riskLevel);
                     sceneRiskPO.setIsDeleted(DictConstants.IS_NOT_DELETED);
                     sceneRiskPO.setCreateUserId(sceneEvaluationComputeParam.getCreateUserId());
                     sceneRiskPO.setAlgorithmId(sceneEvaluationComputeParam.getAlgorithmId());

+ 0 - 5
simulation-resource-server/src/main/java/com/css/simulation/resource/server/adapter/controller/scene_library/score_rule/ScoreRuleController.java

@@ -3,7 +3,6 @@ package com.css.simulation.resource.server.adapter.controller.scene_library.scor
 import api.common.pojo.common.ResponseBodyVO;
 import api.common.pojo.constants.DictConstants;
 import api.common.pojo.constants.LogConstants;
-import api.common.pojo.enums.SceneEvaluationEnum;
 import api.common.pojo.param.scene.SceneEvaluationDetailParam;
 import api.common.pojo.param.scene.SceneEvaluationRuleParam;
 import api.common.pojo.param.scene.SceneEvaluationScriptParam;
@@ -273,7 +272,6 @@ public class ScoreRuleController {
         }
         PageUtil.setPageInfo(params);
         List<SceneRiskPO> list = sceneEvaluationRuleService.querySceneEvaluationRiskDetail(params);
-        list.forEach(po -> po.setRiskLevel(SceneEvaluationEnum.matchLevelEnumByLevelValue(po.getRiskLevel())));
         PageInfo<SceneRiskPO> sceneRiskPOPageInfo = new PageInfo<>(list);
         List<SceneRiskVO> list1 = new ArrayList<>();
         // po 转 vo
@@ -297,7 +295,6 @@ public class ScoreRuleController {
         }
         PageUtil.setPageInfo(params);
         List<SceneComplexityPO> list = sceneEvaluationRuleService.querySceneEvaluationComplexityDetail(params);
-        list.forEach(po -> po.setComplexityLevel(SceneEvaluationEnum.matchLevelEnumByLevelValue(po.getComplexityLevel())));
         PageInfo<SceneComplexityPO> sceneComplexityPOPageInfo = new PageInfo<>(list);
         List<SceneComplexityVO> list1 = new ArrayList<>();
         // po 转 vo
@@ -320,7 +317,6 @@ public class ScoreRuleController {
             return new ResponseBodyVO<>(ResponseBodyVO.Response.CLIENT_FAILURE, "请输入 sceneId");
         }
         List<SceneRiskPO> list = sceneEvaluationRuleService.querySceneEvaluationRiskDetail(params);
-        list.forEach(po -> po.setRiskLevel(SceneEvaluationEnum.matchLevelEnumByLevelValue(po.getRiskLevel())));
         List<SceneRiskVO> list1 = new ArrayList<>();
         // po 转 vo
         for (SceneRiskPO po : list) {
@@ -340,7 +336,6 @@ public class ScoreRuleController {
             return new ResponseBodyVO<>(ResponseBodyVO.Response.CLIENT_FAILURE, "请输入 sceneId");
         }
         List<SceneComplexityPO> list = sceneEvaluationRuleService.querySceneEvaluationComplexityDetail(params);
-        list.forEach(po -> po.setComplexityLevel(SceneEvaluationEnum.matchLevelEnumByLevelValue(po.getComplexityLevel())));
         List<SceneComplexityVO> list1 = new ArrayList<>();
         // po 转 vo
         for (SceneComplexityPO po : list) {

+ 0 - 3
simulation-resource-server/src/main/java/com/css/simulation/resource/server/app/impl/SimulationProjectServiceImpl.java

@@ -5,7 +5,6 @@ import api.common.pojo.common.ResponseBodyVO;
 import api.common.pojo.constants.DictConstants;
 import api.common.pojo.constants.ProjectConstants;
 import api.common.pojo.constants.StateConstant;
-import api.common.pojo.enums.SceneEvaluationEnum;
 import api.common.pojo.param.KafkaParameter;
 import api.common.pojo.param.MinioParameter;
 import api.common.pojo.param.algorithm.AlgorithmParameter;
@@ -3022,9 +3021,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
         List<SceneReferenceLibPO> sceneReferenceLibPOS = sceneReferenceLibMapper.querySceneReferenceLibList(SceneReferenceLibSelectParam.builder().names(sceneScoreLi.stream().map(SceneScListVo::getSceneId).toArray(String[]::new)).build());
         // 查询复杂度和危险度
         List<SceneComplexityPO> sceneComplexityPOS = sceneComplexityMapper.selectSceneComplexityEvaluationForExport(param.getId(), null);
-        sceneComplexityPOS.forEach(sceneComplexityPO -> sceneComplexityPO.setComplexityLevel(SceneEvaluationEnum.matchLevelEnumByLevelValue(sceneComplexityPO.getComplexityLevel())));
         List<SceneRiskPO> sceneRiskPOS = sceneRiskMapper.selectSceneRiskEvaluationForExport(param.getId(), null);
-        sceneRiskPOS.forEach(sceneRiskPO -> sceneRiskPO.setRiskLevel(SceneEvaluationEnum.matchLevelEnumByLevelValue(sceneRiskPO.getRiskLevel())));
         Map<String, SceneComplexityPO> compPOMap = null;
         Map<String, SceneRiskPO> riskPOMap = null;
         if (CollectionUtil.isNotEmpty(sceneComplexityPOS)) {

+ 4 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/server/app/service/SceneAccidentService.java

@@ -3,6 +3,7 @@ package com.css.simulation.resource.server.app.service;
 import api.common.pojo.common.ResponseBodyVO;
 import api.common.pojo.constants.DictConstants;
 import api.common.pojo.constants.LogConstants;
+import api.common.pojo.enums.SceneEvaluationLevel;
 import api.common.pojo.param.MinioParameter;
 import api.common.pojo.param.scene.*;
 import api.common.pojo.po.scene.*;
@@ -213,6 +214,9 @@ public class SceneAccidentService {
             params.setNeedRisk("1");
         }
 
+        params.setComplexityLevels(SceneEvaluationLevel.getEvaluationLevelList(params.getComplexityLevel()));
+        params.setRiskLevels(SceneEvaluationLevel.getEvaluationLevelList(params.getRiskLevel()));
+
         List<SceneAccidentPO> list = new ArrayList<>();
         String roleCode = AuthUtil.getCurrentUserRoleCode();
         log.info("交通事故查询------" + roleCode);

+ 3 - 5
simulation-resource-server/src/main/java/com/css/simulation/resource/server/app/service/SceneEvaluationRuleService.java

@@ -2,7 +2,7 @@ package com.css.simulation.resource.server.app.service;
 
 import api.common.pojo.common.ResponseBodyVO;
 import api.common.pojo.constants.DictConstants;
-import api.common.pojo.enums.SceneEvaluationEnum;
+import api.common.pojo.enums.SceneEvaluationLevel;
 import api.common.pojo.param.MinioParameter;
 import api.common.pojo.param.scene.*;
 import api.common.pojo.po.scene.SceneComplexityPO;
@@ -256,23 +256,21 @@ public class SceneEvaluationRuleService {
         SceneComplexityPO sceneComplexityPO = new SceneComplexityPO();
         sceneComplexityPO.setMinComplexity(param.getMinComplexity());
         sceneComplexityPO.setMaxComplexity(param.getMaxComplexity());
-        sceneComplexityPO.setComplexityLevel(SceneEvaluationEnum.matchLevelEnumByLevel(param.getComplexityLevel()));
+        sceneComplexityPO.setComplexityLevels(SceneEvaluationLevel.getEvaluationLevelList(param.getComplexityLevel()));
         sceneComplexityPO.setSceneIdList(param.getSceneIdList());
         sceneComplexityPO.setTaskId(param.getTaskId());
         // 查询复杂度的符合条件的第一条数据
         List<SceneComplexityPO> sceneReferenceLibCSPOS = sceneComplexityMapper.selectSceneIdsByEvaluation(sceneComplexityPO);
-        sceneReferenceLibCSPOS.forEach(po -> po.setComplexityLevel(SceneEvaluationEnum.matchLevelEnumByLevelValue(po.getComplexityLevel())));
 
         Map<String, SceneComplexityPO> complexityPOMap = sceneReferenceLibCSPOS.stream().collect(Collectors.toMap(SceneComplexityPO::getSceneId, Function.identity()));
         SceneRiskPO sceneRiskPO = new SceneRiskPO();
         sceneRiskPO.setMaxRisk(param.getMaxRisk());
         sceneRiskPO.setMinRisk(param.getMinRisk());
-        sceneRiskPO.setRiskLevel(SceneEvaluationEnum.matchLevelEnumByLevel(param.getRiskLevel()));
+        sceneRiskPO.setRiskLevels(SceneEvaluationLevel.getEvaluationLevelList(param.getRiskLevel()));
         sceneRiskPO.setSceneIdList(param.getSceneIdList());
         sceneRiskPO.setTaskId(param.getTaskId());
         // 查询复杂度的符合条件的第一条数据
         List<SceneRiskPO> sceneReferenceLibCRPOS = sceneRiskMapper.selectSceneIdsByEvaluation(sceneRiskPO);
-        sceneReferenceLibCRPOS.forEach(po -> po.setRiskLevel(SceneEvaluationEnum.matchLevelEnumByLevelValue(po.getRiskLevel())));
         Map<String, SceneRiskPO> riskPOMap = sceneReferenceLibCRPOS.stream().collect(Collectors.toMap(SceneRiskPO::getSceneId, Function.identity()));
         return SceneEvaluationOperatePO.builder().sceneComplexityPOMap(complexityPOMap).sceneRiskPOMap(riskPOMap).build();
     }

+ 3 - 2
simulation-resource-server/src/main/java/com/css/simulation/resource/server/app/service/SceneNaturalService.java

@@ -3,6 +3,7 @@ package com.css.simulation.resource.server.app.service;
 import api.common.pojo.common.ResponseBodyVO;
 import api.common.pojo.constants.DictConstants;
 import api.common.pojo.constants.LogConstants;
+import api.common.pojo.enums.SceneEvaluationLevel;
 import api.common.pojo.param.MinioParameter;
 import api.common.pojo.param.scene.*;
 import api.common.pojo.po.scene.*;
@@ -226,6 +227,8 @@ public class SceneNaturalService {
         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()));
     }
 
     public SceneEvaluationOperatePO getSceneEvaluationFirst(SceneNaturalNewParam params, List<String> sceneIdList) {
@@ -327,8 +330,6 @@ public class SceneNaturalService {
         }
 
         for (SceneNaturalPO vo : list) {
-            // 赋值复杂度
-            // 赋值复杂度
             if (vo.getRoadType().equals("高速")) {
                 if (ObjectUtil.isNull(vo.getLabel())) {
                     vo.setLabel("高速");

+ 3 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/server/app/service/SceneReferenceLibService.java

@@ -2,6 +2,7 @@ package com.css.simulation.resource.server.app.service;
 
 import api.common.pojo.constants.DictConstants;
 import api.common.pojo.constants.LogConstants;
+import api.common.pojo.enums.SceneEvaluationLevel;
 import api.common.pojo.param.MinioParameter;
 import api.common.pojo.param.scene.*;
 import api.common.pojo.po.scene.*;
@@ -71,6 +72,8 @@ public class SceneReferenceLibService {
         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()));
     }
 
     /**

+ 3 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/server/app/service/SceneStandardsService.java

@@ -3,6 +3,7 @@ package com.css.simulation.resource.server.app.service;
 import api.common.pojo.common.ResponseBodyVO;
 import api.common.pojo.constants.DictConstants;
 import api.common.pojo.constants.LogConstants;
+import api.common.pojo.enums.SceneEvaluationLevel;
 import api.common.pojo.param.MinioParameter;
 import api.common.pojo.param.scene.*;
 import api.common.pojo.po.scene.*;
@@ -131,6 +132,8 @@ public class SceneStandardsService {
             params.setNeedRisk("1");
         }
 
+        params.setComplexityLevels(SceneEvaluationLevel.getEvaluationLevelList(params.getComplexityLevel()));
+        params.setRiskLevels(SceneEvaluationLevel.getEvaluationLevelList(params.getRiskLevel()));
         List<StandardsRegulationsPO> list = new ArrayList<>();
 
         //添加权限

+ 36 - 12
simulation-resource-server/src/main/resources/mysql/mapper/SceneAccidentMapper.xml

@@ -137,8 +137,12 @@
                 <if test="maxComplexity != null and maxComplexity != ''">
                     AND  complexity+0 &lt;=  #{maxComplexity}
                 </if>
-                <if test="complexityLevel != null and complexityLevel != ''">
-                    AND complexity_level+0 >=  #{complexityLevel}
+                <if test="complexityLevels != null and complexityLevels.size()>0">
+                    AND complexity_level IN
+                    <foreach collection="complexityLevels" item="item" index="index"
+                             separator="," open="(" close=")">
+                        #{item}
+                    </foreach>
                 </if>
                 )
             </if>
@@ -150,8 +154,12 @@
                 <if test="maxRisk != null and maxRisk != ''">
                     AND risk+0 &lt;=  #{maxRisk}
                 </if>
-                <if test="riskLevel != null and riskLevel != ''">
-                    AND risk_level+0 >=  #{riskLevel}
+                <if test="riskLevels != null and riskLevels.size()>0">
+                    AND risk_level IN
+                    <foreach collection="riskLevels" item="item" index="index"
+                             separator="," open="(" close=")">
+                        #{item}
+                    </foreach>
                 </if>
                 )
             </if>
@@ -282,8 +290,12 @@
                 <if test="maxComplexity != null and maxComplexity != ''">
                     AND  complexity+0 &lt;=  #{maxComplexity}
                 </if>
-                <if test="complexityLevel != null and complexityLevel != ''">
-                    AND complexity_level+0 >=  #{complexityLevel}
+                <if test="complexityLevels != null and complexityLevels.size()>0">
+                    AND complexity_level IN
+                    <foreach collection="complexityLevels" item="item" index="index"
+                             separator="," open="(" close=")">
+                        #{item}
+                    </foreach>
                 </if>
                 )
             </if>
@@ -295,8 +307,12 @@
                 <if test="maxRisk != null and maxRisk != ''">
                     AND risk+0 &lt;=  #{maxRisk}
                 </if>
-                <if test="riskLevel != null and riskLevel != ''">
-                    AND risk_level+0 >=  #{riskLevel}
+                <if test="riskLevels != null and riskLevels.size()>0">
+                    AND risk_level IN
+                    <foreach collection="riskLevels" item="item" index="index"
+                             separator="," open="(" close=")">
+                        #{item}
+                    </foreach>
                 </if>
                 )
             </if>
@@ -500,8 +516,12 @@
                 <if test="maxComplexity != null and maxComplexity != ''">
                     AND  complexity+0 &lt;=  #{maxComplexity}
                 </if>
-                <if test="complexityLevel != null and complexityLevel != ''">
-                    AND complexity_level+0 >=  #{complexityLevel}
+                <if test="complexityLevels != null and complexityLevels.size()>0">
+                    AND complexity_level IN
+                    <foreach collection="complexityLevels" item="item" index="index"
+                             separator="," open="(" close=")">
+                        #{item}
+                    </foreach>
                 </if>
                 )
             </if>
@@ -513,8 +533,12 @@
                 <if test="maxRisk != null and maxRisk != ''">
                     AND risk+0 &lt;=  #{maxRisk}
                 </if>
-                <if test="riskLevel != null and riskLevel != ''">
-                    AND risk_level+0 >=  #{riskLevel}
+                <if test="riskLevels != null and riskLevels.size()>0">
+                    AND risk_level IN
+                    <foreach collection="riskLevels" item="item" index="index"
+                             separator="," open="(" close=")">
+                        #{item}
+                    </foreach>
                 </if>
                 )
             </if>

+ 6 - 2
simulation-resource-server/src/main/resources/mysql/mapper/SceneComplexityMapper.xml

@@ -25,8 +25,12 @@
             <if test="maxComplexity != null and maxComplexity != ''">
                 AND complexity+0 &lt;=  #{maxComplexity}
             </if>
-            <if test="complexityLevel != null and complexityLevel != ''">
-                AND complexity_level+0 >=  #{complexityLevel}
+            <if test="complexityLevels != null and complexityLevels.size()>0">
+                AND complexity_level IN
+                <foreach collection="complexityLevels" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
             </if>
             <if test="sceneIdList != null and sceneIdList.size()>0">
                 AND scene_id IN

+ 4 - 2
simulation-resource-server/src/main/resources/mysql/mapper/SceneEvaluationRuleMapper.xml

@@ -52,8 +52,7 @@
             resultType="api.common.pojo.po.scene.SceneEvaluationRulePO">
         select
         rule_id,rule_code,rule_name, rule_description,rule_type,script_name,script_path,
-        create_user_id,create_time,modify_user_id,modify_time,
-        is_deleted
+        create_user_id,create_time,modify_user_id,modify_time,error_msg,status,is_deleted,local_path
         from simulation.scene_evaluation_rule
         <where>
             is_deleted = '0'
@@ -75,6 +74,9 @@
             <if test="createUserId != null and createUserId != ''">
                 and create_user_id=#{createUserId,jdbcType=VARCHAR}
             </if>
+            <if test="createUserId != null and createUserId != ''">
+                and create_user_id=#{createUserId,jdbcType=VARCHAR}
+            </if>
             order by modify_time desc
         </where>
 

+ 24 - 8
simulation-resource-server/src/main/resources/mysql/mapper/SceneNaturalMapper.xml

@@ -408,8 +408,12 @@
                 <if test="maxComplexity != null and maxComplexity != ''">
                     AND  complexity+0 &lt;=  #{maxComplexity}
                 </if>
-                <if test="complexityLevel != null and complexityLevel != ''">
-                    AND complexity_level+0 >=  #{complexityLevel}
+                <if test="complexityLevels != null and complexityLevels.size()>0">
+                    AND complexity_level IN
+                    <foreach collection="complexityLevels" item="item" index="index"
+                             separator="," open="(" close=")">
+                        #{item}
+                    </foreach>
                 </if>
                 )
             </if>
@@ -421,8 +425,12 @@
                 <if test="maxRisk != null and maxRisk != ''">
                     AND risk+0 &lt;=  #{maxRisk}
                 </if>
-                <if test="riskLevel != null and riskLevel != ''">
-                    AND risk_level+0 >=  #{riskLevel}
+                <if test="riskLevels != null and riskLevels.size()>0">
+                    AND risk_level IN
+                    <foreach collection="riskLevels" item="item" index="index"
+                             separator="," open="(" close=")">
+                        #{item}
+                    </foreach>
                 </if>
                 )
             </if>
@@ -1830,8 +1838,12 @@
                 <if test="maxComplexity != null and maxComplexity != ''">
                     AND  complexity+0 &lt;=  #{maxComplexity}
                 </if>
-                <if test="complexityLevel != null and complexityLevel != ''">
-                    AND complexity_level+0 >=  #{complexityLevel}
+                <if test="complexityLevels != null and complexityLevels.size()>0">
+                    AND complexity_level IN
+                    <foreach collection="complexityLevels" item="item" index="index"
+                             separator="," open="(" close=")">
+                        #{item}
+                    </foreach>
                 </if>
                 )
             </if>
@@ -1843,8 +1855,12 @@
                 <if test="maxRisk != null and maxRisk != ''">
                     AND risk+0 &lt;=  #{maxRisk}
                 </if>
-                <if test="riskLevel != null and riskLevel != ''">
-                    AND risk_level+0 >=  #{riskLevel}
+                <if test="riskLevels != null and riskLevels.size()>0">
+                    AND risk_level IN
+                    <foreach collection="riskLevels" item="item" index="index"
+                             separator="," open="(" close=")">
+                        #{item}
+                    </foreach>
                 </if>
                 )
             </if>

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

@@ -190,8 +190,12 @@
                 <if test="maxComplexity != null and maxComplexity != ''">
                     AND  complexity+0 &lt;=  #{maxComplexity}
                 </if>
-                <if test="complexityLevel != null and complexityLevel != ''">
-                    AND complexity_level+0 >=  #{complexityLevel}
+                <if test="complexityLevels != null and complexityLevels.size()>0">
+                    AND complexity_level IN
+                    <foreach collection="complexityLevels" item="item" index="index"
+                             separator="," open="(" close=")">
+                        #{item}
+                    </foreach>
                 </if>
                 )
             </if>
@@ -203,8 +207,12 @@
                 <if test="maxRisk != null and maxRisk != ''">
                     AND risk+0 &lt;=  #{maxRisk}
                 </if>
-                <if test="riskLevel != null and riskLevel != ''">
-                    AND risk_level+0 >=  #{riskLevel}
+                <if test="riskLevels != null and riskLevels.size()>0">
+                    AND risk_level IN
+                    <foreach collection="riskLevels" item="item" index="index"
+                             separator="," open="(" close=")">
+                        #{item}
+                    </foreach>
                 </if>
                 )
             </if>

+ 6 - 2
simulation-resource-server/src/main/resources/mysql/mapper/SceneRiskMapper.xml

@@ -25,8 +25,12 @@
             <if test="maxRisk != null and maxRisk != ''">
                 AND risk+0 &lt;=  #{maxRisk}
             </if>
-            <if test="riskLevel != null and riskLevel != ''">
-                AND risk_level+0 >=  #{riskLevel}
+            <if test="riskLevels != null and riskLevels.size()>0">
+                AND risk_level IN
+                <foreach collection="riskLevels" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
             </if>
             <if test="sceneIdList != null and sceneIdList.size()>0">
                 AND scene_id IN

+ 24 - 8
simulation-resource-server/src/main/resources/mysql/mapper/SceneStandardsRegulationsMapper.xml

@@ -109,8 +109,12 @@
                 <if test="maxComplexity != null and maxComplexity != ''">
                     AND  complexity+0 &lt;=  #{maxComplexity}
                 </if>
-                <if test="complexityLevel != null and complexityLevel != ''">
-                    AND complexity_level+0 >=  #{complexityLevel}
+                <if test="complexityLevels != null and complexityLevels.size()>0">
+                    AND complexity_level IN
+                    <foreach collection="complexityLevels" item="item" index="index"
+                             separator="," open="(" close=")">
+                        #{item}
+                    </foreach>
                 </if>
                 )
             </if>
@@ -122,8 +126,12 @@
                 <if test="maxRisk != null and maxRisk != ''">
                     AND risk+0 &lt;=  #{maxRisk}
                 </if>
-                <if test="riskLevel != null and riskLevel != ''">
-                    AND risk_level+0 >=  #{riskLevel}
+                <if test="riskLevels != null and riskLevels.size()>0">
+                    AND risk_level IN
+                    <foreach collection="riskLevels" item="item" index="index"
+                             separator="," open="(" close=")">
+                        #{item}
+                    </foreach>
                 </if>
                 )
             </if>
@@ -310,8 +318,12 @@
                 <if test="maxComplexity != null and maxComplexity != ''">
                     AND  complexity+0 &lt;=  #{maxComplexity}
                 </if>
-                <if test="complexityLevel != null and complexityLevel != ''">
-                    AND complexity_level+0 >=  #{complexityLevel}
+                <if test="complexityLevels != null and complexityLevels.size()>0">
+                    AND complexity_level IN
+                    <foreach collection="complexityLevels" item="item" index="index"
+                             separator="," open="(" close=")">
+                        #{item}
+                    </foreach>
                 </if>
                 )
             </if>
@@ -323,8 +335,12 @@
                 <if test="maxRisk != null and maxRisk != ''">
                     AND risk+0 &lt;=  #{maxRisk}
                 </if>
-                <if test="riskLevel != null and riskLevel != ''">
-                    AND risk_level+0 >=  #{riskLevel}
+                <if test="riskLevels != null and riskLevels.size()>0">
+                    AND risk_level IN
+                    <foreach collection="riskLevels" item="item" index="index"
+                             separator="," open="(" close=")">
+                        #{item}
+                    </foreach>
                 </if>
                 )
             </if>