Parcourir la source

评分细则加字段

root il y a 2 ans
Parent
commit
0de3bb8463

+ 7 - 14
api-common/src/main/java/api/common/pojo/vo/project/SubScListVo.java

@@ -7,24 +7,17 @@ import lombok.Setter;
 @Setter
 @Setter
 public class SubScListVo {
 public class SubScListVo {
 
 
-    private String sublistName1;
 
 
+    private String sceneNum;
+    private String notScoredSceneNum;
+    private String notStandardSceneNum;
+    private String standardSceneNum;
+    private String lastScore;
+    private String firstScore;
+    private String sublistName1;
     private String sublistName2;
     private String sublistName2;
-
     private String sublistName3;
     private String sublistName3;
-
     private String sublistName4;
     private String sublistName4;
-
     private String sublistName5;
     private String sublistName5;
-
     private String sublistName6;
     private String sublistName6;
-
-    private String sceneNum;
-
-    private String notStandardSceneNum;
-
-    private String lastScore;
-
-    private String firstScore;
-
 }
 }

+ 2 - 0
api-common/src/main/java/api/common/pojo/vo/project/SublistScoreVo.java

@@ -17,7 +17,9 @@ public class SublistScoreVo {
     private Double firScore;
     private Double firScore;
     private Double lasScore;
     private Double lasScore;
     private String packageAndRules;
     private String packageAndRules;
+    private String notScoredSceneNum;
     private String notStandardSceneNum;
     private String notStandardSceneNum;
+    private String standardSceneNum;
     private String scoreExplain;
     private String scoreExplain;
     private Double sceneScore;
     private Double sceneScore;
     private String targetEvaluate;
     private String targetEvaluate;

+ 1 - 1
simulation-resource-scheduler/src/main/java/com/css/simulation/resource/scheduler/manager/TaskManager.java

@@ -236,7 +236,7 @@ public class TaskManager {
                         // 计算每个任务的得分
                         // 计算每个任务的得分
                         String result1OfMinio = taskOfLeaf.getRunResultFilePath() + "/Ego.csv";
                         String result1OfMinio = taskOfLeaf.getRunResultFilePath() + "/Ego.csv";
                         String result1OfLinux = linuxTempPath + result1OfMinio;
                         String result1OfLinux = linuxTempPath + result1OfMinio;
-                        String result2OfMinio = taskOfLeaf.getRunResultFilePath() + "/combined_ogt.csv";
+                        String result2OfMinio = taskOfLeaf.getRunResultFilePath() + "/evaluation.csv";
                         String result2OfLinux = linuxTempPath + result2OfMinio;
                         String result2OfLinux = linuxTempPath + result2OfMinio;
                         String scoreCommand = "python3 " + pyPath + "main.py "
                         String scoreCommand = "python3 " + pyPath + "main.py "
                                 + result1OfLinux + " "
                                 + result1OfLinux + " "

+ 45 - 34
simulation-resource-server/src/main/java/com/css/simulation/resource/project/impl/SimulationProjectServiceImpl.java

@@ -727,7 +727,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
         projectReportVo.setProjectName(poParam.getProjectName());
         projectReportVo.setProjectName(poParam.getProjectName());
         projectReportVo.setAlgorithmName(algorithmBaseInfoVo.getAlgorithmName());
         projectReportVo.setAlgorithmName(algorithmBaseInfoVo.getAlgorithmName());
         projectReportVo.setAlgorithmDescribe(algorithmBaseInfoVo.getDescription());
         projectReportVo.setAlgorithmDescribe(algorithmBaseInfoVo.getDescription());
-        String sceneNames = "";
+        String sceneNames;
 
 
         //算法测试得分表
         //算法测试得分表
         /*
         /*
@@ -747,34 +747,38 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
         StringBuilder stringBuilder = new StringBuilder();
         StringBuilder stringBuilder = new StringBuilder();
 
 
         //汇总数据初始化
         //汇总数据初始化
-        Integer totalSceneNum = 0;
+        int totalSceneNum = 0;
         double totalScore = 0D;
         double totalScore = 0D;
         double totalScoreRatio = 0D;
         double totalScoreRatio = 0D;
-        Integer totalSceneScoreNum = 0;
+        int totalSceneScoreNum = 0;
 
 
-
-        for (SimulationMptFirstTargetScorePo v : pos) {
+        // 根据一级指标表结果获取平分细则
+        for (SimulationMptFirstTargetScorePo firstTargetScorePo : pos) {
             //获取指标信息
             //获取指标信息
-            stringBuilder.append(v.getSublistName()).append("、");
-            AlgorithmScoreVo algorithmScoreVo = new AlgorithmScoreVo();
-            algorithmScoreVo.setProjectName(v.getSublistName());
-            Integer sceneNum = v.getSceneNum();
-            totalSceneNum += sceneNum;
-            algorithmScoreVo.setSceneNum(sceneNum);
-            String weight = v.getWeight();
+            int sceneNum = firstTargetScorePo.getSceneNum();    // 一级指标包含场景数量
+            String weight = firstTargetScorePo.getWeight();     // 一级指标权重
             double weightDouble = Double.parseDouble(weight);
             double weightDouble = Double.parseDouble(weight);
-            algorithmScoreVo.setWeight(weight);
             //单个二级指标得分
             //单个二级指标得分
-            Double score = v.getScore();
+            Double score = firstTargetScorePo.getScore();
             totalScore += BigDecimal.valueOf(score).multiply(BigDecimal.valueOf(weightDouble).divide(BigDecimal.valueOf(100))).doubleValue();
             totalScore += BigDecimal.valueOf(score).multiply(BigDecimal.valueOf(weightDouble).divide(BigDecimal.valueOf(100))).doubleValue();
-            algorithmScoreVo.setScore(saveTwoDecimalPlaces(score));
-            //获取得分不为0的场景数量
-            Integer scoreNum = getSetScoreNum(v.getSublistId(), poParam.getId());
+            //获取得分不为 0 的场景数量
+            Integer scoreNum = getSetScoreNum(firstTargetScorePo.getSublistId(), poParam.getId());
             totalSceneScoreNum += scoreNum;
             totalSceneScoreNum += scoreNum;
+
+            totalScoreRatio += Double.valueOf(scoreNum) / Double.valueOf(sceneNum) * 100;
+
+            AlgorithmScoreVo algorithmScoreVo = new AlgorithmScoreVo();
+            algorithmScoreVo.setProjectName(firstTargetScorePo.getSublistName());
+            algorithmScoreVo.setSceneNum(sceneNum);
+            algorithmScoreVo.setWeight(weight);
+            algorithmScoreVo.setScore(saveTwoDecimalPlaces(score));
             algorithmScoreVo.setScoreRatio(saveTwoDecimalPlaces(Double.valueOf(scoreNum) / Double.valueOf(sceneNum) * 100));
             algorithmScoreVo.setScoreRatio(saveTwoDecimalPlaces(Double.valueOf(scoreNum) / Double.valueOf(sceneNum) * 100));
+
             algorithmScoreVoList.add(algorithmScoreVo);
             algorithmScoreVoList.add(algorithmScoreVo);
 
 
-            totalScoreRatio += Double.valueOf(scoreNum) / Double.valueOf(sceneNum) * 100;
+            // 其他操作
+            stringBuilder.append(firstTargetScorePo.getSublistName()).append("、");
+            totalSceneNum += sceneNum;
         }
         }
         // 汇总
         // 汇总
         AlgorithmScoreVo algorithmScoreVo = new AlgorithmScoreVo();
         AlgorithmScoreVo algorithmScoreVo = new AlgorithmScoreVo();
@@ -1877,36 +1881,40 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
         SimulationManualProjectParam query = new SimulationManualProjectParam();
         SimulationManualProjectParam query = new SimulationManualProjectParam();
         query.setId(projectId);
         query.setId(projectId);
         query.setPackageId(scenePackageId);
         query.setPackageId(scenePackageId);
-//        List<SublistScoreVo> pos = simulationProjectMapper.selectSubScore(query);
         List<SublistScoreVo> pos = simulationProjectMapper.selectSubScore2(query);
         List<SublistScoreVo> pos = simulationProjectMapper.selectSubScore2(query);
-
         HashMap<String, Object> hashMap = new HashMap<>();
         HashMap<String, Object> hashMap = new HashMap<>();
-
         int size = 0;
         int size = 0;
         List<List<String>> result = new ArrayList<>();
         List<List<String>> result = new ArrayList<>();
         //递归指标名称得分
         //递归指标名称得分
         for (SublistScoreVo po : pos) {
         for (SublistScoreVo po : pos) {
-//            if(ObjectUtil.isNotNull(po.getPackageAndRules())){
             if (ObjectUtil.isNotNull(po.getPackageAndRules()) && (po.getFirTarget() != null || po.getLasTarget() != null)) {
             if (ObjectUtil.isNotNull(po.getPackageAndRules()) && (po.getFirTarget() != null || po.getLasTarget() != null)) {
                 //末级指标
                 //末级指标
                 setParent(po, null, pos, scenePackageId);
                 setParent(po, null, pos, scenePackageId);
 
 
                 String sublistName = po.getSublistName();
                 String sublistName = po.getSublistName();
                 Double firScore = po.getFirScore();
                 Double firScore = po.getFirScore();
-                String firstScore = "";//first得分
+                String firstScore = ""; // first得分
                 if (firScore != null) {
                 if (firScore != null) {
                     firstScore = saveTwoDecimalPlaces(firScore, 1).toString();
                     firstScore = saveTwoDecimalPlaces(firScore, 1).toString();
                 }
                 }
                 Double lasScore = po.getLasScore();
                 Double lasScore = po.getLasScore();
-                String LastScore = "";//last得分
+                String LastScore = "";  // last得分
                 if (lasScore != null) {
                 if (lasScore != null) {
                     LastScore = saveTwoDecimalPlaces(lasScore, 1).toString();
                     LastScore = saveTwoDecimalPlaces(lasScore, 1).toString();
                 }
                 }
                 String sceneNum = po.getSceneNum();//场景数量
                 String sceneNum = po.getSceneNum();//场景数量
-                String notStandardSceneNum = po.getNotStandardSceneNum();//未达标场景数量
+                String notScoredSceneNum = po.getNotScoredSceneNum();       // 未参与评分数量
+                String notStandardSceneNum = po.getNotStandardSceneNum();   // 未达标场景数量
+                String standardSceneNum = po.getStandardSceneNum();         // 达标场景数量
 
 
                 if (ObjectUtil.isNotNull(sublistName)) {
                 if (ObjectUtil.isNotNull(sublistName)) {
-                    sublistName += ProjectConstants.SEPARATOR + sceneNum + ProjectConstants.SEPARATOR + notStandardSceneNum + ProjectConstants.SEPARATOR + LastScore + ProjectConstants.SEPARATOR + firstScore;
+                    sublistName += ProjectConstants.SEPARATOR
+                            + sceneNum + ProjectConstants.SEPARATOR
+                            + notScoredSceneNum + ProjectConstants.SEPARATOR
+                            + notStandardSceneNum + ProjectConstants.SEPARATOR
+                            + standardSceneNum + ProjectConstants.SEPARATOR
+                            + LastScore + ProjectConstants.SEPARATOR
+                            + firstScore;
                     String[] split = sublistName.split(ProjectConstants.SEPARATOR);
                     String[] split = sublistName.split(ProjectConstants.SEPARATOR);
 
 
 
 
@@ -1944,10 +1952,12 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
                 }
                 }
 
 
             }
             }
-            subScListVo.setSceneNum(list.get(start));
-            subScListVo.setNotStandardSceneNum(list.get(start + 1));
-            subScListVo.setLastScore(list.get(start + 2));
-            subScListVo.setFirstScore(list.get(start + 3));
+            subScListVo.setSceneNum(list.get(start + 0));
+            subScListVo.setNotScoredSceneNum(list.get(start + 1));
+            subScListVo.setNotStandardSceneNum(list.get(start + 2));
+            subScListVo.setStandardSceneNum(list.get(start + 3));
+            subScListVo.setLastScore(list.get(start + 4));
+            subScListVo.setFirstScore(list.get(start + 5));
 
 
             objects.add(subScListVo);
             objects.add(subScListVo);
 
 
@@ -1959,7 +1969,9 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
             addHeaders(i, headerList);
             addHeaders(i, headerList);
         }
         }
         headerList.add(ImmutableMap.builder().put("label", "场景数量").put("prop", "sceneNum").build());
         headerList.add(ImmutableMap.builder().put("label", "场景数量").put("prop", "sceneNum").build());
+        headerList.add(ImmutableMap.builder().put("label", "未参与评分场景个数").put("prop", "notScoredSceneNum").build());
         headerList.add(ImmutableMap.builder().put("label", "未达标场景数量").put("prop", "notStandardSceneNum").build());
         headerList.add(ImmutableMap.builder().put("label", "未达标场景数量").put("prop", "notStandardSceneNum").build());
+        headerList.add(ImmutableMap.builder().put("label", "达标场景个数").put("prop", "standardSceneNum").build());
         headerList.add(ImmutableMap.builder().put("label", "得分").put("prop", "lastScore").build());
         headerList.add(ImmutableMap.builder().put("label", "得分").put("prop", "lastScore").build());
         headerList.add(ImmutableMap.builder().put("label", "总分").put("prop", "firstScore").build());
         headerList.add(ImmutableMap.builder().put("label", "总分").put("prop", "firstScore").build());
         hashMap.put("headerList", headerList);
         hashMap.put("headerList", headerList);
@@ -2244,7 +2256,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
     }
     }
 
 
     /**
     /**
-     * 获取二级场景下所有得分不为0的场景数量
+     * 获取二级场景下所有得分不为 0 的场景数量
      *
      *
      * @param sublistId
      * @param sublistId
      * @param pId
      * @param pId
@@ -2257,7 +2269,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
 
 
 
 
     /**
     /**
-     * 获取一级指标下所有得分不为0的场景总数
+     * 获取一级指标下所有得分不为 0 的场景总数
      *
      *
      * @param resultVo     返回值,返回统计数量,首次传null
      * @param resultVo     返回值,返回统计数量,首次传null
      * @param parentVoList 首次传null
      * @param parentVoList 首次传null
@@ -2266,8 +2278,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
      * @param sublistId    指标id(用户查询指标下的所有场景)
      * @param sublistId    指标id(用户查询指标下的所有场景)
      * @return
      * @return
      */
      */
-    private SceneScoreVo selectScoreNum(SceneScoreVo resultVo, List<ScenePackageSubListVO> parentVoList,
-                                        boolean isRoot, String pId, String sublistId) {
+    private SceneScoreVo selectScoreNum(SceneScoreVo resultVo, List<ScenePackageSubListVO> parentVoList, boolean isRoot, String pId, String sublistId) {
         if (isRoot) {
         if (isRoot) {
             //初始化返回值
             //初始化返回值
             resultVo = new SceneScoreVo();
             resultVo = new SceneScoreVo();

+ 2 - 0
simulation-resource-server/src/main/resources/mapper/project/SimulationProjectMapper.xml

@@ -571,7 +571,9 @@
                fir.score      as firScore,
                fir.score      as firScore,
                las.score      as lasScore,
                las.score      as lasScore,
                sub.package_and_rules,
                sub.package_and_rules,
+               las.not_scored_scene_num,
                las.not_standard_scene_num,
                las.not_standard_scene_num,
+               las.standard_scene_num,
                las.score_explain,
                las.score_explain,
                fir.target     as firTarget,
                fir.target     as firTarget,
                las.target     as lasTarget
                las.target     as lasTarget