李春阳 hace 1 año
padre
commit
c3b50a92f5

+ 9 - 5
simulation-resource-server/src/main/java/com/css/simulation/resource/server/app/impl/SimulationProjectServiceImpl.java

@@ -3142,9 +3142,13 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
         projectReportForReferenceVO.setOtherBehaviorAndAreaPassNum(otherBehaviorAndAreaPassNum);
         projectReportForReferenceVO.setWeatherAndAreaPassNum(weatherAndAreaPassNum);
         projectReportForReferenceVO.setRoadPlanePassNum(roadPlanePassNum);
+        for (SceneComplexityPO sceneComplexityPO : sceneComplexityPOS) {
+            checkAndSetDataSetValue(compRangeFor10, compLevelForPassNum, sceneComplexityPO.getComplexity(), sceneComplexityPO.getComplexityLevel(), taskMap.get(sceneComplexityPO.getSceneId()).getScore());
+        }
+        for (SceneRiskPO sceneRiskPO : sceneRiskPOS) {
+            checkAndSetDataSetValue(riskRangeFor10, riskLevelForPassNum, sceneRiskPO.getRisk(), sceneRiskPO.getRiskLevel(), taskMap.get(sceneRiskPO.getSceneId()).getScore());
+        }
 
-        sceneComplexityPOS.forEach(sceneComplexityPO -> checkAndSetDataSetValue(compRangeFor10, compLevelForPassNum, sceneComplexityPO.getComplexity(), sceneComplexityPO.getComplexityLevel()));
-        sceneRiskPOS.forEach(sceneRiskPO -> checkAndSetDataSetValue(riskRangeFor10, riskLevelForPassNum, sceneRiskPO.getRisk(), sceneRiskPO.getRiskLevel()));
         for (SceneReferenceLibPO sceneReferenceLibPO : sceneReferenceLibPOS) {
             String sceneId = sceneReferenceLibPO.getSceneId();
             String otherBehavior = sceneReferenceLibPO.getOtherBehavior();
@@ -4177,10 +4181,10 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
     }
 
 
-    private void checkAndSetDataSetValue(Map<String, Integer> desTriMap, Map<String, Map<String, Integer>> levelMap, String value, String valueLevel) {
+    private void checkAndSetDataSetValue(Map<String, Integer> desTriMap, Map<String, Map<String, Integer>> levelMap, String value, String valueLevel, Double score) {
         double valDouble = Double.parseDouble(value);
         Map<String, Integer> tempLevelMap = levelMap.computeIfAbsent(valueLevel, s -> new HashMap<>());
-        if (Double.parseDouble(value) >= 80) {
+        if (score != null && score >= 80) {
             int tempNum = tempLevelMap.computeIfAbsent("passNum", s -> 0);
             tempLevelMap.put("passNum", ++tempNum);
         } else {
@@ -5080,7 +5084,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
             if (param.getIsPagePdf() != null && param.getIsPagePdf()) {
                 // 获取工作信息
                 SimulationManualProjectPO p = simulationManualProjectMapper.selectProjectBaseById(param);
-                final String algorithmName = algorithmMapper.selectAlgorithmNameByAlgorithmId(param.getAlgorithm());
+                final String algorithmName = algorithmMapper.selectAlgorithmNameByAlgorithmId(spo.getAlgorithm());
 
                 pdfFile = new File(param.getLocalPdfFilePath());
                 FileInputStream fileInputStream = new FileInputStream(pdfFile);