瀏覽代碼

王耀栋--工作台模块代码提交

wangyaodong 3 年之前
父節點
當前提交
4acc9bdd01

+ 6 - 1
api-common/src/main/java/api/common/pojo/vo/project/ProjectReportVo.java

@@ -4,6 +4,7 @@ import lombok.Getter;
 import lombok.Setter;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * 工作报告
@@ -41,9 +42,13 @@ public class ProjectReportVo {
     //算法测试评分细则、详细得分情况
     private List<ScenePackageSubListVO> sceneScoreList;
 
+    private List<Map> subListScoreLiTitle;
+
     private List<SubScListVo> subListScoreLi;
 
-    private List<List<String>> sceneScoreLi;
+    private List<Map> sceneScoreLiTitle;
+
+    private List<SublistScoreVo> sceneScoreLi;
 
 
 }

+ 34 - 0
api-common/src/main/java/api/common/pojo/vo/project/SceneScListVo.java

@@ -0,0 +1,34 @@
+package api.common.pojo.vo.project;
+
+
+import lombok.Getter;
+import lombok.Setter;
+
+@Getter
+@Setter
+public class SceneScListVo {
+
+    private String sublistName1;
+
+    private String sublistName2;
+
+    private String sublistName3;
+
+    private String sublistName4;
+
+    private String sublistName5;
+
+    private String sublistName6;
+
+    private String sceneId;
+
+    private String sceneIdType;
+
+    private String sceneScore;
+
+    private String targetEvaluate;
+
+    private String scoreExplain;
+
+
+}

+ 149 - 13
simulation-resource-server/src/main/java/com/css/simulation/resource/project/impl/SimulationProjectServiceImpl.java

@@ -76,7 +76,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
 
             int add = simulationProjectMapper.add(po);
             if(add > 0){
-                return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS);
+                return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS,ResponseBodyVO.Response.SUCCESS.getMessage(),po.getId());
             }
             return new ResponseBodyVO(ResponseBodyVO.Response.SERVER_FAILURE,"添加失败");
         }else{
@@ -90,7 +90,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
             po.updatePo(AuthUtil.getCurrentUserId());
             int update = simulationProjectMapper.update(po);
             if(update > 0){
-                return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS);
+                return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS,ResponseBodyVO.Response.SUCCESS.getMessage(),po.getId());
             }
 
             return new ResponseBodyVO(ResponseBodyVO.Response.SERVER_FAILURE,"修改失败");
@@ -494,10 +494,14 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
         List<SublistScoreVo> pos = simulationProjectMapper.selectSubScore(po.getScene());
 
         //指标得分列表
-        /*projectReportVo.setSubListScoreLi(selectScenePackageSubListAndSetScore(pos,po.getScene()));
+        Map<String, Object> stringObjectMap = selectScenePackageSubListAndSetScore(pos, po.getScene());
+        projectReportVo.setSubListScoreLiTitle((List<Map>) stringObjectMap.get("cloums"));
+        projectReportVo.setSubListScoreLi((List<SubScListVo>) stringObjectMap.get("result"));
 
         //场景得分列表
-        projectReportVo.setSceneScoreLi(selectSceneScore(pos,po.getId()));*/
+        Map<String, Object> maps = selectSceneScore(pos, po.getId());
+        projectReportVo.setSceneScoreLiTitle((List<Map>) maps.get("cloums"));
+        projectReportVo.setSceneScoreLi((List<SublistScoreVo>) maps.get("result"));
 
         return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS, projectReportVo);
     }
@@ -1012,7 +1016,9 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
     }
 
 
-    private List<List<String>> selectSceneScore(List<SublistScoreVo> pos, String projectId) {
+    private Map<String, Object> selectSceneScore(List<SublistScoreVo> pos, String projectId) {
+
+        HashMap<String, Object> hashMap = new HashMap<>();
 
         //1.获取项目下所有场景得分
         ProjectTaskParam param = new ProjectTaskParam();
@@ -1073,17 +1079,105 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
 
         }
 
+        List<SceneScListVo> objects = new ArrayList<>();
         //结果补全
         for(List<String> list : result){
             int offset = size - list.size();
-            int start = list.size() - 3;
+            int start = list.size() - 5;
             for(int i=0;i<offset;i++){
                 list.add(start+i,"");
             }
+            SceneScListVo sceneScListVo = new SceneScListVo();
+            for(int i=0;i<start;i++){
+                if(0 == i){
+                    sceneScListVo.setSublistName1(list.get(i));
+                }else if(1 == i){
+                    sceneScListVo.setSublistName2(list.get(i));
+                }else if(2 == i){
+                    sceneScListVo.setSublistName3(list.get(i));
+                }else if(3 == i){
+                    sceneScListVo.setSublistName4(list.get(i));
+                }else if(4 == i){
+                    sceneScListVo.setSublistName5(list.get(i));
+                }else if(5 == i){
+                    sceneScListVo.setSublistName6(list.get(i));
+                }
+
+            }
+
+            sceneScListVo.setSceneId(list.get(start));
+            sceneScListVo.setSceneIdType(list.get(start+1));
+            sceneScListVo.setSceneScore(list.get(start+2));
+            sceneScListVo.setTargetEvaluate(list.get(start+3));
+            sceneScListVo.setScoreExplain(list.get(start+4));
 
+            objects.add(sceneScListVo);
+        }
+
+        List<Map<String, String>> cloums = new ArrayList<>();
+        for(int i=0; i<size-5;i++){
+            if(0 == i){
+                Map<String, String> map = new HashMap<>();
+                map.put("label","一级指标");
+                map.put("prop","sublistName1");
+                cloums.add(map);
+            }else if(1 == i){
+                Map<String, String> map = new HashMap<>();
+                map.put("label","二级指标");
+                map.put("prop","sublistName2");
+                cloums.add(map);
+            }else if(2 == i){
+                Map<String, String> map = new HashMap<>();
+                map.put("label","三级指标");
+                map.put("prop","sublistName3");
+                cloums.add(map);
+            }else if(3 == i){
+                Map<String, String> map = new HashMap<>();
+                map.put("label","四级指标");
+                map.put("prop","sublistName4");
+                cloums.add(map);
+            }else if(4 == i){
+                Map<String, String> map = new HashMap<>();
+                map.put("label","五级指标");
+                map.put("prop","sublistName5");
+                cloums.add(map);
+            }else if(5 == i){
+                Map<String, String> map = new HashMap<>();
+                map.put("label","六级指标");
+                map.put("prop","sublistName6");
+                cloums.add(map);
+            }
         }
 
-        return result;
+        Map<String, String> map1 = new HashMap<>();
+        map1.put("label","场景ID");
+        map1.put("prop","sceneId");
+        cloums.add(map1);
+
+        Map<String, String> map2 = new HashMap<>();
+        map2.put("label","场景类型");
+        map2.put("prop","sceneIdType");
+        cloums.add(map2);
+
+        Map<String, String> map3 = new HashMap<>();
+        map3.put("label","测试得分");
+        map3.put("prop","sceneScore");
+        cloums.add(map3);
+
+        Map<String, String> map4 = new HashMap<>();
+        map4.put("label","指标评价");
+        map4.put("prop","targetEvaluate");
+        cloums.add(map4);
+
+        Map<String, String> map5 = new HashMap<>();
+        map5.put("label","得分说明");
+        map5.put("prop","scoreExplain");
+        cloums.add(map5);
+
+        hashMap.put("cloums",cloums);
+        hashMap.put("result",objects);
+
+        return hashMap;
 
 
     }
@@ -1099,7 +1193,9 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
     }
 
 
-    private List<SubScListVo> selectScenePackageSubListAndSetScore(List<SublistScoreVo> pos, String scenePackageId){
+    private Map<String,Object> selectScenePackageSubListAndSetScore(List<SublistScoreVo> pos, String scenePackageId){
+
+        HashMap<String, Object> hashMap = new HashMap<>();
 
         int size = 0;
         List<List<String>> result = new ArrayList<>();
@@ -1109,9 +1205,6 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
                 //末级指标
                 setParent(po,pos,scenePackageId);
 
-
-
-
                 String sublistName = po.getSublistName();
                 String firstScore = po.getFirScore();//first得分
                 String LastScore = po.getLasScore();//last得分
@@ -1175,18 +1268,61 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
         for(int i=0; i<size-4;i++){
             if(0 == i){
                 Map<String, String> map = new HashMap<>();
-//                map.put("");
+                map.put("label","一级指标");
+                map.put("prop","sublistName1");
+                cloums.add(map);
             }else if(1 == i){
+                Map<String, String> map = new HashMap<>();
+                map.put("label","二级指标");
+                map.put("prop","sublistName2");
+                cloums.add(map);
             }else if(2 == i){
+                Map<String, String> map = new HashMap<>();
+                map.put("label","三级指标");
+                map.put("prop","sublistName3");
+                cloums.add(map);
             }else if(3 == i){
+                Map<String, String> map = new HashMap<>();
+                map.put("label","四级指标");
+                map.put("prop","sublistName4");
+                cloums.add(map);
             }else if(4 == i){
+                Map<String, String> map = new HashMap<>();
+                map.put("label","五级指标");
+                map.put("prop","sublistName5");
+                cloums.add(map);
             }else if(5 == i){
+                Map<String, String> map = new HashMap<>();
+                map.put("label","六级指标");
+                map.put("prop","sublistName6");
+                cloums.add(map);
             }
         }
+        Map<String, String> map1 = new HashMap<>();
+        map1.put("label","场景数量");
+        map1.put("prop","sceneNum");
+        cloums.add(map1);
+
+        Map<String, String> map2 = new HashMap<>();
+        map2.put("label","未达标场景数量");
+        map2.put("prop","notStandardSceneNum");
+        cloums.add(map2);
+
+        Map<String, String> map3 = new HashMap<>();
+        map3.put("label","得分");
+        map3.put("prop","lastScore");
+        cloums.add(map3);
+
+        Map<String, String> map4 = new HashMap<>();
+        map4.put("label","总分");
+        map4.put("prop","firstScore");
+        cloums.add(map4);
 
+        hashMap.put("cloums",cloums);
+        hashMap.put("result",objects);
 
 
-        return objects;
+        return hashMap;
 
 
     }

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

@@ -550,7 +550,7 @@
         from scene_package_sublist sub
 				left JOIN simulation_mpt_first_target_score fir on fir.target=sub.sublist_id
 				left JOIN simulation_mpt_last_target_score las on las.target = sub.sublist_id
-        where root_id = '596e66b5aee845a892911ab8d24d9697'
+        where root_id = #{id,jdbcType=VARCHAR}
 				order by seq
     </select>