|
@@ -213,8 +213,32 @@ public class SceneNaturalService {
|
|
return s;
|
|
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) {
|
|
public List<SceneNaturalPO> querySceneNaturalList(SceneNaturalNewParam params) {
|
|
SceneNaturalParam po = new SceneNaturalParam();
|
|
SceneNaturalParam po = new SceneNaturalParam();
|
|
|
|
+ copyEvaluationParams(params, po);
|
|
po.setShare(params.getShare());
|
|
po.setShare(params.getShare());
|
|
String naturalName = params.getNaturalName(); // 场景编号
|
|
String naturalName = params.getNaturalName(); // 场景编号
|
|
String[][] naturalEnvironment = params.getNaturalEnvironment(); //自然环境
|
|
String[][] naturalEnvironment = params.getNaturalEnvironment(); //自然环境
|
|
@@ -258,7 +282,6 @@ public class SceneNaturalService {
|
|
List<String> newList = new ArrayList<>();
|
|
List<String> newList = new ArrayList<>();
|
|
newList.add(arr[0]);
|
|
newList.add(arr[0]);
|
|
po.setSelfBehavior(newList);
|
|
po.setSelfBehavior(newList);
|
|
- ;
|
|
|
|
} else {
|
|
} else {
|
|
list.add(arr[0]);
|
|
list.add(arr[0]);
|
|
po.setSelfBehavior(list);
|
|
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 (vo.getRoadType().equals("高速")) {
|
|
if (ObjectUtil.isNull(vo.getLabel())) {
|
|
if (ObjectUtil.isNull(vo.getLabel())) {
|
|
vo.setLabel("高速");
|
|
vo.setLabel("高速");
|
|
@@ -378,7 +379,7 @@ public class SceneNaturalService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- return finalSceneNaturalList;
|
|
|
|
|
|
+ return list;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|