李春阳 1 rok temu
rodzic
commit
d755ad2442
16 zmienionych plików z 383 dodań i 108 usunięć
  1. 2 0
      api-common/src/main/java/api/common/pojo/param/scene/SceneAccidentParam.java
  2. 15 0
      api-common/src/main/java/api/common/pojo/param/scene/SceneNaturalParam.java
  3. 2 0
      api-common/src/main/java/api/common/pojo/param/scene/SceneReferenceLibSelectParam.java
  4. 2 0
      api-common/src/main/java/api/common/pojo/param/scene/StandardsRegulationsParam.java
  5. 17 1
      simulation-resource-server/src/main/java/com/css/simulation/resource/server/adapter/controller/scene_library/accident/SceneAccidentController.java
  6. 18 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/server/adapter/controller/scene_library/natural/SceneNaturalController.java
  7. 17 1
      simulation-resource-server/src/main/java/com/css/simulation/resource/server/adapter/controller/scene_library/scene_reference_lib/SceneReferenceLibController.java
  8. 17 1
      simulation-resource-server/src/main/java/com/css/simulation/resource/server/adapter/controller/scene_library/standard/SceneStandardsController.java
  9. 18 26
      simulation-resource-server/src/main/java/com/css/simulation/resource/server/app/service/SceneAccidentService.java
  10. 26 25
      simulation-resource-server/src/main/java/com/css/simulation/resource/server/app/service/SceneNaturalService.java
  11. 26 25
      simulation-resource-server/src/main/java/com/css/simulation/resource/server/app/service/SceneReferenceLibService.java
  12. 15 29
      simulation-resource-server/src/main/java/com/css/simulation/resource/server/app/service/SceneStandardsService.java
  13. 78 0
      simulation-resource-server/src/main/resources/mysql/mapper/SceneAccidentMapper.xml
  14. 52 0
      simulation-resource-server/src/main/resources/mysql/mapper/SceneNaturalMapper.xml
  15. 26 0
      simulation-resource-server/src/main/resources/mysql/mapper/SceneReferenceLibMapper.xml
  16. 52 0
      simulation-resource-server/src/main/resources/mysql/mapper/SceneStandardsRegulationsMapper.xml

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

@@ -57,5 +57,7 @@ public class SceneAccidentParam extends PageVO implements Serializable {
     private String complexityLevel;
     // 危险度等级
     private String riskLevel;
+    private String needComplexity;
+    private String needRisk;
 
 }

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

@@ -72,4 +72,19 @@ public class SceneNaturalParam extends PageVO implements Serializable {
 
     private String userId;//用户id
     private String[] allSceneNames ; //场景名集合
+
+    // 复杂度下限
+    private String minComplexity;
+    // 复杂度上限
+    private String maxComplexity;
+    // 危险度下限
+    private String minRisk;
+    // 危险度上限
+    private String maxRisk;
+    // 复杂度等级
+    private String complexityLevel;
+    // 危险度等级
+    private String riskLevel;
+    private String needComplexity;
+    private String needRisk;
 }

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

@@ -61,4 +61,6 @@ public class SceneReferenceLibSelectParam extends PageVO implements Serializable
     private String[] ids; //回显数组
     private List<String> AllIds; //权限集合
     private String userId;
+    private String needComplexity;
+    private String needRisk;
 }

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

@@ -51,4 +51,6 @@ public class StandardsRegulationsParam extends PageVO implements Serializable {
     private String complexityLevel;
     // 危险度等级
     private String riskLevel;
+    private String needComplexity;
+    private String needRisk;
 }

+ 17 - 1
simulation-resource-server/src/main/java/com/css/simulation/resource/server/adapter/controller/scene_library/accident/SceneAccidentController.java

@@ -4,13 +4,14 @@ import api.common.pojo.common.ResponseBodyVO;
 import api.common.pojo.constants.DictConstants;
 import api.common.pojo.param.scene.SceneAccidentParam;
 import api.common.pojo.param.scene.SceneImportParam;
-import api.common.pojo.po.scene.SceneAccidentPO;
+import api.common.pojo.po.scene.*;
 import api.common.pojo.po.system.SceneImportPO;
 import api.common.pojo.vo.scene.SceneAccidentVO;
 import api.common.util.CollectionUtil;
 import com.css.simulation.resource.server.infra.util.PageUtil;
 import com.css.simulation.resource.server.app.service.SceneAccidentService;
 import com.css.simulation.resource.server.app.service.SceneImportService;
+import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import org.springframework.beans.BeanUtils;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -21,6 +22,8 @@ import org.springframework.web.bind.annotation.RestController;
 import javax.annotation.Resource;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
 
 //交通事故场景 1
 @RestController
@@ -63,10 +66,23 @@ public class SceneAccidentController {
         PageUtil.setPageInfo(params);
         List<SceneAccidentPO> list = sceneAccidentService.querySceneAccidentList(params);
         PageInfo<SceneAccidentPO> objectPageInfo = new PageInfo<>(list);
+        PageHelper.clearPage();
+        SceneEvaluationOperatePO sceneEvaluationOperatePO = sceneAccidentService.getSceneEvaluationFirst(params, list.stream().map(SceneAccidentPO::getAccidentId).collect(Collectors.toList()));
+        Map<String, SceneComplexityPO> complexityPOMap = sceneEvaluationOperatePO.getSceneComplexityPOMap();
+        Map<String, SceneRiskPO> riskPOMap = sceneEvaluationOperatePO.getSceneRiskPOMap();
         List<SceneAccidentVO> list1 = new ArrayList<>();
         for (SceneAccidentPO po : list) {
             SceneAccidentVO vo = new SceneAccidentVO();
             BeanUtils.copyProperties(po, vo);
+            // 赋值复杂度
+            if (complexityPOMap.get(po.getAccidentId()) != null) {
+                po.setComplexity(String.valueOf(complexityPOMap.get(po.getAccidentId()).getComplexity()));
+                po.setComplexityLevel(String.valueOf(complexityPOMap.get(po.getAccidentId()).getComplexityLevel()));
+            }
+            if (riskPOMap.get(po.getAccidentId()) != null) {
+                po.setRisk(String.valueOf(riskPOMap.get(po.getAccidentId()).getRisk()));
+                po.setRiskLevel(String.valueOf(riskPOMap.get(po.getAccidentId()).getRiskLevel()));
+            }
             list1.add(vo);
         }
         PageInfo<SceneAccidentVO> pageInfo = new PageInfo<>(list1);

+ 18 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/server/adapter/controller/scene_library/natural/SceneNaturalController.java

@@ -5,13 +5,17 @@ import api.common.pojo.constants.DictConstants;
 import api.common.pojo.param.scene.SceneImportParam;
 import api.common.pojo.param.scene.SceneNaturalNewParam;
 import api.common.pojo.param.scene.SceneNaturalParam;
+import api.common.pojo.po.scene.SceneComplexityPO;
+import api.common.pojo.po.scene.SceneEvaluationOperatePO;
 import api.common.pojo.po.scene.SceneNaturalPO;
+import api.common.pojo.po.scene.SceneRiskPO;
 import api.common.pojo.po.system.SceneImportPO;
 import api.common.pojo.vo.scene.SceneNaturalVO;
 import api.common.util.CollectionUtil;
 import com.css.simulation.resource.server.infra.util.PageUtil;
 import com.css.simulation.resource.server.app.service.SceneNaturalService;
 import com.css.simulation.resource.server.app.service.SceneImportService;
+import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import org.springframework.beans.BeanUtils;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -22,6 +26,8 @@ import org.springframework.web.bind.annotation.RestController;
 import javax.annotation.Resource;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
 
 //自然场景
 @RestController
@@ -63,10 +69,22 @@ public class SceneNaturalController {
         PageUtil.setPageInfo(params);
         List<SceneNaturalPO> list = sceneNaturalService.querySceneNaturalList(params);
         PageInfo<SceneNaturalPO> objectPageInfo = new PageInfo<>(list);
+        PageHelper.clearPage();
+        SceneEvaluationOperatePO sceneEvaluationOperatePO = sceneNaturalService.getSceneEvaluationFirst(params, list.stream().map(SceneNaturalPO::getNaturalId).collect(Collectors.toList()));
+        Map<String, SceneComplexityPO> complexityPOMap = sceneEvaluationOperatePO.getSceneComplexityPOMap();
+        Map<String, SceneRiskPO> riskPOMap = sceneEvaluationOperatePO.getSceneRiskPOMap();
         List<SceneNaturalVO> list1 = new ArrayList<>();
         for (SceneNaturalPO po : list) {
             SceneNaturalVO vo = new SceneNaturalVO();
             BeanUtils.copyProperties(po, vo);
+            if (complexityPOMap.get(vo.getNaturalId()) != null) {
+                vo.setComplexity(String.valueOf(complexityPOMap.get(vo.getNaturalId()).getComplexity()));
+                vo.setComplexityLevel(String.valueOf(complexityPOMap.get(vo.getNaturalId()).getComplexityLevel()));
+            }
+            if (riskPOMap.get(vo.getNaturalId()) != null) {
+                vo.setRisk(String.valueOf(riskPOMap.get(vo.getNaturalId()).getRisk()));
+                vo.setRiskLevel(String.valueOf(riskPOMap.get(vo.getNaturalId()).getRiskLevel()));
+            }
             list1.add(vo);
         }
         PageInfo<SceneNaturalVO> pageInfo = new PageInfo<>(list1);

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

@@ -4,7 +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.po.scene.SceneReferenceLibPO;
+import api.common.pojo.po.scene.*;
 import api.common.pojo.po.system.SceneImportPO;
 import api.common.pojo.vo.scene.SceneReferenceLibVO;
 import api.common.util.CollectionUtil;
@@ -13,6 +13,7 @@ import com.css.simulation.resource.server.app.service.SceneImportService;
 import com.css.simulation.resource.server.app.service.SceneReferenceLibService;
 import com.css.simulation.resource.server.infra.util.AuthUtil;
 import com.css.simulation.resource.server.infra.util.PageUtil;
+import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import org.springframework.beans.BeanUtils;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -23,6 +24,8 @@ import org.springframework.web.bind.annotation.RestController;
 import javax.annotation.Resource;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
 
 /**
  * 基准场景库
@@ -64,9 +67,22 @@ public class SceneReferenceLibController {
         PageUtil.setPageInfo(params);
         List<SceneReferenceLibPO> list = sceneReferenceLibService.querySceneReferenceLibList(params);
         PageInfo<SceneReferenceLibPO> objectPageInfo = new PageInfo<>(list);
+        PageHelper.clearPage();
+        SceneEvaluationOperatePO sceneEvaluationOperatePO = sceneReferenceLibService.getSceneEvaluationFirst(params, list.stream().map(SceneReferenceLibPO::getSceneId).collect(Collectors.toList()));
+        Map<String, SceneComplexityPO> complexityPOMap = sceneEvaluationOperatePO.getSceneComplexityPOMap();
+        Map<String, SceneRiskPO> riskPOMap = sceneEvaluationOperatePO.getSceneRiskPOMap();
         List<SceneReferenceLibVO> list1 = new ArrayList<>();
         for (SceneReferenceLibPO po : list) {
             SceneReferenceLibVO vo = new SceneReferenceLibVO();
+            // 赋值复杂度
+            if (complexityPOMap.get(po.getSceneId()) != null) {
+                po.setComplexity(String.valueOf(complexityPOMap.get(po.getSceneId()).getComplexity()));
+                po.setComplexityLevel(String.valueOf(complexityPOMap.get(po.getSceneId()).getComplexityLevel()));
+            }
+            if (riskPOMap.get(po.getSceneId()) != null) {
+                po.setRisk(String.valueOf(riskPOMap.get(po.getSceneId()).getRisk()));
+                po.setRiskLevel(String.valueOf(riskPOMap.get(po.getSceneId()).getRiskLevel()));
+            }
             BeanUtils.copyProperties(po, vo);
             list1.add(vo);
         }

+ 17 - 1
simulation-resource-server/src/main/java/com/css/simulation/resource/server/adapter/controller/scene_library/standard/SceneStandardsController.java

@@ -4,13 +4,14 @@ 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.StandardsRegulationsParam;
-import api.common.pojo.po.scene.StandardsRegulationsPO;
+import api.common.pojo.po.scene.*;
 import api.common.pojo.po.system.SceneImportPO;
 import api.common.pojo.vo.scene.StandardsRegulationsVO;
 import api.common.util.CollectionUtil;
 import com.css.simulation.resource.server.infra.util.PageUtil;
 import com.css.simulation.resource.server.app.service.SceneStandardsService;
 import com.css.simulation.resource.server.app.service.SceneImportService;
+import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import org.springframework.beans.BeanUtils;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -21,6 +22,8 @@ import org.springframework.web.bind.annotation.RestController;
 import javax.annotation.Resource;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
 
 //标准法规
 @RestController
@@ -63,9 +66,22 @@ public class SceneStandardsController {
         PageUtil.setPageInfo(params);
         List<StandardsRegulationsPO> list = sceneStandardsService.queryStandardsRegulationsList(params);
         PageInfo<StandardsRegulationsPO> objectPageInfo = new PageInfo<>(list);
+        PageHelper.clearPage();
+        SceneEvaluationOperatePO sceneEvaluationOperatePO = sceneStandardsService.getSceneEvaluationFirst(params, list.stream().map(StandardsRegulationsPO::getRegulationsId).collect(Collectors.toList()));
+        Map<String, SceneComplexityPO> complexityPOMap = sceneEvaluationOperatePO.getSceneComplexityPOMap();
+        Map<String, SceneRiskPO> riskPOMap = sceneEvaluationOperatePO.getSceneRiskPOMap();
         List<StandardsRegulationsVO> list1 = new ArrayList<>();
         for (StandardsRegulationsPO po : list) {
             StandardsRegulationsVO vo = new StandardsRegulationsVO();
+            // 赋值复杂度
+            if (complexityPOMap.get(po.getRegulationsId()) != null) {
+                po.setComplexity(String.valueOf(complexityPOMap.get(po.getRegulationsId()).getComplexity()));
+                po.setComplexityLevel(String.valueOf(complexityPOMap.get(po.getRegulationsId()).getComplexityLevel()));
+            }
+            if (riskPOMap.get(po.getRegulationsId()) != null) {
+                po.setRisk(String.valueOf(riskPOMap.get(po.getRegulationsId()).getRisk()));
+                po.setRiskLevel(String.valueOf(riskPOMap.get(po.getRegulationsId()).getRiskLevel()));
+            }
             BeanUtils.copyProperties(po, vo);
             list1.add(vo);
         }

+ 18 - 26
simulation-resource-server/src/main/java/com/css/simulation/resource/server/app/service/SceneAccidentService.java

@@ -195,8 +195,24 @@ public class SceneAccidentService {
         }
     }
 */
+
+    public SceneEvaluationOperatePO getSceneEvaluationFirst(SceneAccidentParam params, List<String> sceneIdList) {
+        // 添加复杂度 危险度数据
+        SceneEvaluationForListParam sceneEvaluationForListParam = new SceneEvaluationForListParam();
+        BeanUtils.copyProperties(params, sceneEvaluationForListParam);
+        sceneEvaluationForListParam.setSceneIdList(sceneIdList);
+        return sceneEvaluationRuleService.getSceneEvaluationFirst(sceneEvaluationForListParam);
+    }
+
     public List<SceneAccidentPO> querySceneAccidentList(SceneAccidentParam params) {
 
+        if (StringUtil.isNotEmpty(params.getComplexityLevel()) || StringUtil.isNotEmpty(params.getMinComplexity()) || StringUtil.isNotEmpty(params.getMaxComplexity())) {
+            params.setNeedComplexity("1");
+        }
+        if (StringUtil.isNotEmpty(params.getRiskLevel()) || StringUtil.isNotEmpty(params.getMinRisk()) || StringUtil.isNotEmpty(params.getMaxRisk())) {
+            params.setNeedRisk("1");
+        }
+
         List<SceneAccidentPO> list = new ArrayList<>();
         String roleCode = AuthUtil.getCurrentUserRoleCode();
         log.info("交通事故查询------" + roleCode);
@@ -224,20 +240,6 @@ public class SceneAccidentService {
 
         }
 
-
-        // 添加复杂度 危险度数据
-        SceneEvaluationForListParam sceneEvaluationForListParam = new SceneEvaluationForListParam();
-        BeanUtils.copyProperties(params, sceneEvaluationForListParam);
-        sceneEvaluationForListParam.setSceneIdList(list.stream().map(SceneAccidentPO::getAccidentId).collect(Collectors.toList()));
-        SceneEvaluationOperatePO sceneEvaluationOperatePO = sceneEvaluationRuleService.getSceneEvaluationFirst(sceneEvaluationForListParam);
-        Map<String, SceneComplexityPO> complexityPOMap = sceneEvaluationOperatePO.getSceneComplexityPOMap();
-        Map<String, SceneRiskPO> riskPOMap = sceneEvaluationOperatePO.getSceneRiskPOMap();
-        // 筛选
-        List<SceneAccidentPO> sceneAccidentPOS = list.stream()
-                .filter(sn -> sceneEvaluationRuleService.checkSelectReferenceComplexity(sn.getAccidentId(), sceneEvaluationForListParam, complexityPOMap) &&
-                        sceneEvaluationRuleService.checkSelectReferenceRisk(sn.getAccidentId(), sceneEvaluationForListParam, riskPOMap))
-                .collect(Collectors.toList());
-
      /*   if ((params.getXlk().equals("1") && params.getBq().equals(1)) || (params.getXlk().equals("0") && params.getBq().equals(0)) || (params.getXlk().equals("1") && params.getBq().equals(0))) {
             list = sceneAccidentMapper.querySceneAccidentList(params);
         }*//*else if(params.getXlk().equals("1")&&params.getBq().equals("0")){
@@ -302,17 +304,7 @@ public class SceneAccidentService {
             params.setAllIds(listA);
         }*/
 
-        for (SceneAccidentPO po : sceneAccidentPOS) {
-            // 赋值复杂度
-            // 赋值复杂度
-            if (complexityPOMap.get(po.getAccidentId()) != null) {
-                po.setComplexity(String.valueOf(complexityPOMap.get(po.getAccidentId()).getComplexity()));
-                po.setComplexityLevel(String.valueOf(complexityPOMap.get(po.getAccidentId()).getComplexityLevel()));
-            }
-            if (riskPOMap.get(po.getAccidentId()) != null) {
-                po.setRisk(String.valueOf(riskPOMap.get(po.getAccidentId()).getRisk()));
-                po.setRiskLevel(String.valueOf(riskPOMap.get(po.getAccidentId()).getRiskLevel()));
-            }
+        for (SceneAccidentPO po : list) {
             if (po.getConflictBehavior().contains("追尾")) {
                 po.setLabel("追尾");
             }
@@ -341,7 +333,7 @@ public class SceneAccidentService {
             }
         }
 
-        return sceneAccidentPOS;
+        return list;
     }
 
 

+ 26 - 25
simulation-resource-server/src/main/java/com/css/simulation/resource/server/app/service/SceneNaturalService.java

@@ -213,8 +213,32 @@ public class SceneNaturalService {
             return s;
     }
 
+    private void copyEvaluationParams(SceneNaturalNewParam params, SceneNaturalParam 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");
+        }
+    }
+
+    public SceneEvaluationOperatePO getSceneEvaluationFirst(SceneNaturalNewParam params, List<String> sceneIdList) {
+        // 添加复杂度 危险度数据
+        SceneEvaluationForListParam sceneEvaluationForListParam = new SceneEvaluationForListParam();
+        BeanUtils.copyProperties(params, sceneEvaluationForListParam);
+        sceneEvaluationForListParam.setSceneIdList(sceneIdList);
+        return sceneEvaluationRuleService.getSceneEvaluationFirst(sceneEvaluationForListParam);
+    }
+
     public List<SceneNaturalPO> querySceneNaturalList(SceneNaturalNewParam params) {
         SceneNaturalParam po = new SceneNaturalParam();
+        copyEvaluationParams(params, po);
         po.setShare(params.getShare());
         String naturalName = params.getNaturalName();      // 场景编号
         String[][] naturalEnvironment = params.getNaturalEnvironment(); //自然环境
@@ -258,7 +282,6 @@ public class SceneNaturalService {
                         List<String> newList = new ArrayList<>();
                         newList.add(arr[0]);
                         po.setSelfBehavior(newList);
-                        ;
                     } else {
                         list.add(arr[0]);
                         po.setSelfBehavior(list);
@@ -303,31 +326,9 @@ public class SceneNaturalService {
             }
         }
 
-        // 添加复杂度 危险度数据
-        SceneEvaluationForListParam sceneEvaluationForListParam = new SceneEvaluationForListParam();
-        BeanUtils.copyProperties(params, sceneEvaluationForListParam);
-        sceneEvaluationForListParam.setSceneIdList(list.stream().map(SceneNaturalPO::getNaturalId).collect(Collectors.toList()));
-        SceneEvaluationOperatePO sceneEvaluationOperatePO = sceneEvaluationRuleService.getSceneEvaluationFirst(sceneEvaluationForListParam);
-        Map<String, SceneComplexityPO> complexityPOMap = sceneEvaluationOperatePO.getSceneComplexityPOMap();
-        Map<String, SceneRiskPO> riskPOMap = sceneEvaluationOperatePO.getSceneRiskPOMap();
-        // 筛选
-        List<SceneNaturalPO> finalSceneNaturalList = list.stream()
-                .filter(sn -> sceneEvaluationRuleService.checkSelectReferenceComplexity(sn.getNaturalId(), sceneEvaluationForListParam, complexityPOMap) &&
-                        sceneEvaluationRuleService.checkSelectReferenceRisk(sn.getNaturalId(), sceneEvaluationForListParam, riskPOMap))
-                .collect(Collectors.toList());
-
-
-        for (SceneNaturalPO vo : finalSceneNaturalList) {
+        for (SceneNaturalPO vo : list) {
             // 赋值复杂度
             // 赋值复杂度
-            if (complexityPOMap.get(vo.getNaturalId()) != null) {
-                vo.setComplexity(String.valueOf(complexityPOMap.get(vo.getNaturalId()).getComplexity()));
-                vo.setComplexityLevel(String.valueOf(complexityPOMap.get(vo.getNaturalId()).getComplexityLevel()));
-            }
-            if (riskPOMap.get(vo.getNaturalId()) != null) {
-                vo.setRisk(String.valueOf(riskPOMap.get(vo.getNaturalId()).getRisk()));
-                vo.setRiskLevel(String.valueOf(riskPOMap.get(vo.getNaturalId()).getRiskLevel()));
-            }
             if (vo.getRoadType().equals("高速")) {
                 if (ObjectUtil.isNull(vo.getLabel())) {
                     vo.setLabel("高速");
@@ -378,7 +379,7 @@ public class SceneNaturalService {
                 }
             }
         }
-        return finalSceneNaturalList;
+        return list;
     }
 
 

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

@@ -52,6 +52,29 @@ public class SceneReferenceLibService {
     private SystemScenePackageSublistMapper systemScenePackageSublistMapper;
 
 
+    public SceneEvaluationOperatePO getSceneEvaluationFirst(SceneReferenceLibParam params, List<String> sceneIdList) {
+        // 添加复杂度 危险度数据
+        SceneEvaluationForListParam sceneEvaluationForListParam = new SceneEvaluationForListParam();
+        BeanUtils.copyProperties(params, sceneEvaluationForListParam);
+        sceneEvaluationForListParam.setSceneIdList(sceneIdList);
+        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");
+        }
+    }
+
     /**
      * 获取基准场景库列表
      *
@@ -61,6 +84,7 @@ public class SceneReferenceLibService {
     public List<SceneReferenceLibPO> querySceneReferenceLibList(SceneReferenceLibParam params) {
 
         SceneReferenceLibSelectParam srl = new SceneReferenceLibSelectParam();
+        copyEvaluationParams(params, srl);
         // 场景名称
         String sceneName = params.getSceneName();
         // 主车行为
@@ -123,30 +147,7 @@ public class SceneReferenceLibService {
 
         // 查询
         List<SceneReferenceLibPO> sceneReferenceLibPOS = sceneReferenceLibMapper.querySceneReferenceLibList(srl);
-
-
-        SceneEvaluationForListParam sceneEvaluationForListParam = new SceneEvaluationForListParam();
-        BeanUtils.copyProperties(params, sceneEvaluationForListParam);
-        sceneEvaluationForListParam.setSceneIdList(sceneReferenceLibPOS.stream().map(SceneReferenceLibPO::getSceneId).collect(Collectors.toList()));
-        SceneEvaluationOperatePO sceneEvaluationOperatePO = sceneEvaluationRuleService.getSceneEvaluationFirst(sceneEvaluationForListParam);
-        Map<String, SceneComplexityPO> complexityPOMap = sceneEvaluationOperatePO.getSceneComplexityPOMap();
-        Map<String, SceneRiskPO> riskPOMap = sceneEvaluationOperatePO.getSceneRiskPOMap();
-        // 筛选
-        List<SceneReferenceLibPO> finalSceneReferenceLibPOList = sceneReferenceLibPOS.stream()
-                .filter(srf -> sceneEvaluationRuleService.checkSelectReferenceComplexity(srf.getSceneId(), sceneEvaluationForListParam, complexityPOMap) &&
-                        sceneEvaluationRuleService.checkSelectReferenceRisk(srf.getSceneId(), sceneEvaluationForListParam, riskPOMap))
-                .collect(Collectors.toList());
-
-        for (SceneReferenceLibPO po : finalSceneReferenceLibPOList) {
-            // 赋值复杂度
-            if (complexityPOMap.get(po.getSceneId()) != null) {
-                po.setComplexity(String.valueOf(complexityPOMap.get(po.getSceneId()).getComplexity()));
-                po.setComplexityLevel(String.valueOf(complexityPOMap.get(po.getSceneId()).getComplexityLevel()));
-            }
-            if (riskPOMap.get(po.getSceneId()) != null) {
-                po.setRisk(String.valueOf(riskPOMap.get(po.getSceneId()).getRisk()));
-                po.setRiskLevel(String.valueOf(riskPOMap.get(po.getSceneId()).getRiskLevel()));
-            }
+        for (SceneReferenceLibPO po : sceneReferenceLibPOS) {
             if (po.getRoadType().equals("高速")) {
                 if (ObjectUtil.isNull(po.getLabel())) {
                     po.setLabel("高速");
@@ -184,7 +185,7 @@ public class SceneReferenceLibService {
             }
         }
 
-        return finalSceneReferenceLibPOList;
+        return sceneReferenceLibPOS;
     }
 
 

+ 15 - 29
simulation-resource-server/src/main/java/com/css/simulation/resource/server/app/service/SceneStandardsService.java

@@ -114,8 +114,22 @@ public class SceneStandardsService {
         return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS);
     }
 
+    public SceneEvaluationOperatePO getSceneEvaluationFirst(StandardsRegulationsParam params, List<String> sceneIdList) {
+        // 添加复杂度 危险度数据
+        SceneEvaluationForListParam sceneEvaluationForListParam = new SceneEvaluationForListParam();
+        BeanUtils.copyProperties(params, sceneEvaluationForListParam);
+        sceneEvaluationForListParam.setSceneIdList(sceneIdList);
+        return sceneEvaluationRuleService.getSceneEvaluationFirst(sceneEvaluationForListParam);
+    }
+
     //查看列表
     public List<StandardsRegulationsPO> queryStandardsRegulationsList(StandardsRegulationsParam params) {
+        if (StringUtil.isNotEmpty(params.getComplexityLevel()) || StringUtil.isNotEmpty(params.getMinComplexity()) || StringUtil.isNotEmpty(params.getMaxComplexity())) {
+            params.setNeedComplexity("1");
+        }
+        if (StringUtil.isNotEmpty(params.getRiskLevel()) || StringUtil.isNotEmpty(params.getMinRisk()) || StringUtil.isNotEmpty(params.getMaxRisk())) {
+            params.setNeedRisk("1");
+        }
 
         List<StandardsRegulationsPO> list = new ArrayList<>();
 
@@ -144,34 +158,6 @@ public class SceneStandardsService {
                 list = sceneStandardsRegulationsMapper.queryStandardsRegulationsListByQx(params);
             }
         }
-
-        // 添加复杂度 危险度数据
-        SceneEvaluationForListParam sceneEvaluationForListParam = new SceneEvaluationForListParam();
-        BeanUtils.copyProperties(params, sceneEvaluationForListParam);
-        sceneEvaluationForListParam.setSceneIdList(list.stream().map(StandardsRegulationsPO::getRegulationsId).collect(Collectors.toList()));
-        SceneEvaluationOperatePO sceneEvaluationOperatePO = sceneEvaluationRuleService.getSceneEvaluationFirst(sceneEvaluationForListParam);
-        Map<String, SceneComplexityPO> complexityPOMap = sceneEvaluationOperatePO.getSceneComplexityPOMap();
-        Map<String, SceneRiskPO> riskPOMap = sceneEvaluationOperatePO.getSceneRiskPOMap();
-        // 筛选
-        List<StandardsRegulationsPO> standardsRegulationsPOS = list.stream()
-                .filter(sn -> sceneEvaluationRuleService.checkSelectReferenceComplexity(sn.getRegulationsId(), sceneEvaluationForListParam, complexityPOMap) &&
-                        sceneEvaluationRuleService.checkSelectReferenceRisk(sn.getRegulationsId(), sceneEvaluationForListParam, riskPOMap))
-                .collect(Collectors.toList());
-
-
-        standardsRegulationsPOS.forEach(po -> {            // 赋值复杂度
-
-            // 赋值复杂度
-            if (complexityPOMap.get(po.getRegulationsId()) != null) {
-                po.setComplexity(String.valueOf(complexityPOMap.get(po.getRegulationsId()).getComplexity()));
-                po.setComplexityLevel(String.valueOf(complexityPOMap.get(po.getRegulationsId()).getComplexityLevel()));
-            }
-            if (riskPOMap.get(po.getRegulationsId()) != null) {
-                po.setRisk(String.valueOf(riskPOMap.get(po.getRegulationsId()).getRisk()));
-                po.setRiskLevel(String.valueOf(riskPOMap.get(po.getRegulationsId()).getRiskLevel()));
-            }
-        });
-
        /* if(params.getLabel()!=null&&params.getLabel().size()>0){
             if(params.getRegulationType()!=null&&params.getRegulationType().size()>0){
                 List<String> regulationType= params.getRegulationType();
@@ -193,7 +179,7 @@ public class SceneStandardsService {
             listA.add("没有权限");
             params.setAllIds(listA);
         }*/
-        return standardsRegulationsPOS;
+        return list;
     }
 
     @Transactional

+ 78 - 0
simulation-resource-server/src/main/resources/mysql/mapper/SceneAccidentMapper.xml

@@ -129,6 +129,32 @@
                     #{item}
                 </foreach>
             </if>
+            <if test="needComplexity != null and needComplexity != ''">
+                and accident_id in (select scene_id from scene_complexity where is_deleted = '0'
+                <if test="minComplexity != null and minComplexity != ''">
+                    AND  complexity+0 >= #{minComplexity}
+                </if>
+                <if test="maxComplexity != null and maxComplexity != ''">
+                    AND  complexity+0 &lt;=  #{maxComplexity}
+                </if>
+                <if test="complexityLevel != null and complexityLevel != ''">
+                    AND complexity_level+0 >=  #{complexityLevel}
+                </if>
+                )
+            </if>
+            <if test="needRisk != null and needRisk != ''">
+                and accident_id in (select scene_id from scene_complexity where is_deleted = '0'
+                <if test="minRisk != null and minRisk != ''">
+                    AND risk+0 >= #{minRisk}
+                </if>
+                <if test="maxRisk != null and maxRisk != ''">
+                    AND risk+0 &lt;=  #{maxRisk}
+                </if>
+                <if test="riskLevel != null and riskLevel != ''">
+                    AND risk_level+0 >=  #{riskLevel}
+                </if>
+                )
+            </if>
         </where>
         order by create_time, scene_name desc
     </select>
@@ -248,6 +274,32 @@
             <if test="share != null and share != ''">
                 and share =#{share}
             </if>
+            <if test="needComplexity != null and needComplexity != ''">
+                and accident_id in (select scene_id from scene_complexity where is_deleted = '0'
+                <if test="minComplexity != null and minComplexity != ''">
+                    AND  complexity+0 >= #{minComplexity}
+                </if>
+                <if test="maxComplexity != null and maxComplexity != ''">
+                    AND  complexity+0 &lt;=  #{maxComplexity}
+                </if>
+                <if test="complexityLevel != null and complexityLevel != ''">
+                    AND complexity_level+0 >=  #{complexityLevel}
+                </if>
+                )
+            </if>
+            <if test="needRisk != null and needRisk != ''">
+                and accident_id in (select scene_id from scene_complexity where is_deleted = '0'
+                <if test="minRisk != null and minRisk != ''">
+                    AND risk+0 >= #{minRisk}
+                </if>
+                <if test="maxRisk != null and maxRisk != ''">
+                    AND risk+0 &lt;=  #{maxRisk}
+                </if>
+                <if test="riskLevel != null and riskLevel != ''">
+                    AND risk_level+0 >=  #{riskLevel}
+                </if>
+                )
+            </if>
         </where>
 
         order by modify_time desc
@@ -440,6 +492,32 @@
                     #{item}
                 </foreach>
             </if>
+            <if test="needComplexity != null and needComplexity != ''">
+                and cc.accident_id in (select scene_id from scene_complexity where is_deleted = '0'
+                <if test="minComplexity != null and minComplexity != ''">
+                    AND  complexity+0 >= #{minComplexity}
+                </if>
+                <if test="maxComplexity != null and maxComplexity != ''">
+                    AND  complexity+0 &lt;=  #{maxComplexity}
+                </if>
+                <if test="complexityLevel != null and complexityLevel != ''">
+                    AND complexity_level+0 >=  #{complexityLevel}
+                </if>
+                )
+            </if>
+            <if test="needRisk != null and needRisk != ''">
+                and cc.accident_id in (select scene_id from scene_complexity where is_deleted = '0'
+                <if test="minRisk != null and minRisk != ''">
+                    AND risk+0 >= #{minRisk}
+                </if>
+                <if test="maxRisk != null and maxRisk != ''">
+                    AND risk+0 &lt;=  #{maxRisk}
+                </if>
+                <if test="riskLevel != null and riskLevel != ''">
+                    AND risk_level+0 >=  #{riskLevel}
+                </if>
+                )
+            </if>
         </where>
         order by cc.create_time,cc.scene_name desc
     </select>

+ 52 - 0
simulation-resource-server/src/main/resources/mysql/mapper/SceneNaturalMapper.xml

@@ -400,6 +400,32 @@
             <if test="userId != null and userId != ''">
                 and create_user_id =#{userId}
             </if>
+            <if test="needComplexity != null and needComplexity != ''">
+                and natural_id in (select scene_id from scene_complexity where is_deleted = '0'
+                <if test="minComplexity != null and minComplexity != ''">
+                    AND  complexity+0 >= #{minComplexity}
+                </if>
+                <if test="maxComplexity != null and maxComplexity != ''">
+                    AND  complexity+0 &lt;=  #{maxComplexity}
+                </if>
+                <if test="complexityLevel != null and complexityLevel != ''">
+                    AND complexity_level+0 >=  #{complexityLevel}
+                </if>
+                )
+            </if>
+            <if test="needRisk != null and needRisk != ''">
+                and natural_id in (select scene_id from scene_complexity where is_deleted = '0'
+                <if test="minRisk != null and minRisk != ''">
+                    AND risk+0 >= #{minRisk}
+                </if>
+                <if test="maxRisk != null and maxRisk != ''">
+                    AND risk+0 &lt;=  #{maxRisk}
+                </if>
+                <if test="riskLevel != null and riskLevel != ''">
+                    AND risk_level+0 >=  #{riskLevel}
+                </if>
+                )
+            </if>
             order by create_time,natural_name desc
         </where>
     </select>
@@ -1796,6 +1822,32 @@
             <if test="share != null and share!= '' and share!=0">
                 and share !='0'
             </if>
+            <if test="needComplexity != null and needComplexity != ''">
+                and dd.natural_id in (select scene_id from scene_complexity where is_deleted = '0'
+                <if test="minComplexity != null and minComplexity != ''">
+                    AND  complexity+0 >= #{minComplexity}
+                </if>
+                <if test="maxComplexity != null and maxComplexity != ''">
+                    AND  complexity+0 &lt;=  #{maxComplexity}
+                </if>
+                <if test="complexityLevel != null and complexityLevel != ''">
+                    AND complexity_level+0 >=  #{complexityLevel}
+                </if>
+                )
+            </if>
+            <if test="needRisk != null and needRisk != ''">
+                and dd.natural_id in (select scene_id from scene_complexity where is_deleted = '0'
+                <if test="minRisk != null and minRisk != ''">
+                    AND risk+0 >= #{minRisk}
+                </if>
+                <if test="maxRisk != null and maxRisk != ''">
+                    AND risk+0 &lt;=  #{maxRisk}
+                </if>
+                <if test="riskLevel != null and riskLevel != ''">
+                    AND risk_level+0 >=  #{riskLevel}
+                </if>
+                )
+            </if>
             order by create_time,natural_name desc
         </where>
     </select>

+ 26 - 0
simulation-resource-server/src/main/resources/mysql/mapper/SceneReferenceLibMapper.xml

@@ -168,6 +168,32 @@
                     #{item}
                 </foreach>
             </if>
+            <if test="needComplexity != null and needComplexity != ''">
+                and scene_id in (select scene_id from scene_complexity where is_deleted = '0'
+                <if test="minComplexity != null and minComplexity != ''">
+                    AND  complexity+0 >= #{minComplexity}
+                </if>
+                <if test="maxComplexity != null and maxComplexity != ''">
+                    AND  complexity+0 &lt;=  #{maxComplexity}
+                </if>
+                <if test="complexityLevel != null and complexityLevel != ''">
+                    AND complexity_level+0 >=  #{complexityLevel}
+                </if>
+                )
+            </if>
+            <if test="needRisk != null and needRisk != ''">
+                and scene_id in (select scene_id from scene_complexity where is_deleted = '0'
+                <if test="minRisk != null and minRisk != ''">
+                    AND risk+0 >= #{minRisk}
+                </if>
+                <if test="maxRisk != null and maxRisk != ''">
+                    AND risk+0 &lt;=  #{maxRisk}
+                </if>
+                <if test="riskLevel != null and riskLevel != ''">
+                    AND risk_level+0 >=  #{riskLevel}
+                </if>
+                )
+            </if>
         </where>
         ORDER BY create_time,scene_name DESC
 

+ 52 - 0
simulation-resource-server/src/main/resources/mysql/mapper/SceneStandardsRegulationsMapper.xml

@@ -101,6 +101,32 @@
             <if test="userId != null and userId != ''">
                 and create_user_id =#{userId}
             </if>
+            <if test="needComplexity != null and needComplexity != ''">
+                and regulations_id in (select scene_id from scene_complexity where is_deleted = '0'
+                <if test="minComplexity != null and minComplexity != ''">
+                    AND  complexity+0 >= #{minComplexity}
+                </if>
+                <if test="maxComplexity != null and maxComplexity != ''">
+                    AND  complexity+0 &lt;=  #{maxComplexity}
+                </if>
+                <if test="complexityLevel != null and complexityLevel != ''">
+                    AND complexity_level+0 >=  #{complexityLevel}
+                </if>
+                )
+            </if>
+            <if test="needRisk != null and needRisk != ''">
+                and regulations_id in (select scene_id from scene_complexity where is_deleted = '0'
+                <if test="minRisk != null and minRisk != ''">
+                    AND risk+0 >= #{minRisk}
+                </if>
+                <if test="maxRisk != null and maxRisk != ''">
+                    AND risk+0 &lt;=  #{maxRisk}
+                </if>
+                <if test="riskLevel != null and riskLevel != ''">
+                    AND risk_level+0 >=  #{riskLevel}
+                </if>
+                )
+            </if>
         </where>
         order by create_time,scene_name desc
 
@@ -276,6 +302,32 @@
             <if test="share != null and share!= '' and share!=0">
                 and share !='0'
             </if>
+            <if test="needComplexity != null and needComplexity != ''">
+                and dd.regulations_id in (select scene_id from scene_complexity where is_deleted = '0'
+                <if test="minComplexity != null and minComplexity != ''">
+                    AND  complexity+0 >= #{minComplexity}
+                </if>
+                <if test="maxComplexity != null and maxComplexity != ''">
+                    AND  complexity+0 &lt;=  #{maxComplexity}
+                </if>
+                <if test="complexityLevel != null and complexityLevel != ''">
+                    AND complexity_level+0 >=  #{complexityLevel}
+                </if>
+                )
+            </if>
+            <if test="needRisk != null and needRisk != ''">
+                and dd.regulations_id in (select scene_id from scene_complexity where is_deleted = '0'
+                <if test="minRisk != null and minRisk != ''">
+                    AND risk+0 >= #{minRisk}
+                </if>
+                <if test="maxRisk != null and maxRisk != ''">
+                    AND risk+0 &lt;=  #{maxRisk}
+                </if>
+                <if test="riskLevel != null and riskLevel != ''">
+                    AND risk_level+0 >=  #{riskLevel}
+                </if>
+                )
+            </if>
         </where>
         order by create_time,scene_name desc