Browse Source

王耀栋--工作台模块代码,测试报告列表bug修改

wangyaodong 3 years ago
parent
commit
405d3de38a

+ 3 - 0
api-common/src/main/java/api/common/pojo/param/project/SimulationManualProjectParam.java

@@ -118,5 +118,8 @@ public class SimulationManualProjectParam extends PageVO {
     //创建人
     private String createUserId;
 
+    //场景包id
+    private String packageId;
+
 
 }

+ 85 - 0
api-common/src/main/java/api/common/pojo/po/project/SimulationAutomaticProjectPo.java

@@ -0,0 +1,85 @@
+package api.common.pojo.po.project;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+
+/**
+ * 自动运行项目数据
+ */
+@Getter
+@Setter
+public class SimulationAutomaticProjectPo extends BasePo {
+
+    //项目日期
+    private Integer projectDate;
+
+    //项目序号
+    private Integer projectNum;
+
+    //项目id
+    private String projectId;
+
+    //项目名称
+    private String projectName;
+
+    //项目描述
+    private String projectDescribe;
+
+    //算法
+    private String algorithm;
+
+    //车辆
+    private String vehicle;
+
+    //场景(包)
+    private String scene;
+
+    //运行周期
+    private String operationCycle;
+
+    //并行度
+    private String parallelism;
+
+    //规则查看
+    private String ruleView;
+
+    //是否选择gpu(0:是,1:否)
+    private String isChoiceGpu;
+
+    //自动运行次数
+    private Long automaticRunTimes;
+
+    //最近运行时间
+    private Date lastRunTime;
+
+    //自动运行状态(0:开启,1:关闭)
+    private String automaticRunState;
+
+    //当前运行状态
+    private String nowRunState;
+
+    //评测等级
+    private String evaluationLevel;
+
+    //开始时间
+    private Date startTime;
+
+    //完成时间
+    private Date finishTime;
+
+    //最大仿真时间
+    private Long maxSimulationTime;
+
+    //算法得分
+    private Double algorithmScore;
+
+    //算法类型
+    private String algorithmType;
+
+
+
+
+
+}

+ 7 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/project/ctrl/SimulationProjectCtrl.java

@@ -222,6 +222,13 @@ public class SimulationProjectCtrl {
     }
 
 
+    @RequestMapping("addOrUpdateAutomaticProject")
+    @ResponseBody
+    public ResponseBodyVO addOrUpdateAutomaticProject(@RequestBody SimulationManualProjectParam param){
+        return service.addOrUpdateAutomaticProject(param);
+    }
+
+
 
 
 }

+ 25 - 9
simulation-resource-server/src/main/java/com/css/simulation/resource/project/impl/SimulationProjectServiceImpl.java

@@ -641,7 +641,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
 //        List<SublistScoreVo> pos = simulationProjectMapper.selectSubScore(po.getScene());
 
         //指标得分列表
-        Map<String, Object> stringObjectMap = selectScenePackageSubListAndSetScore(po.getScene());
+        Map<String, Object> stringObjectMap = selectScenePackageSubListAndSetScore(po.getScene(),po.getId());
         projectReportVo.setSubListScoreLiTitle((List<Map>) stringObjectMap.get("cloums"));
         projectReportVo.setSubListScoreLi((List<SubScListVo>) stringObjectMap.get("result"));
 
@@ -1464,7 +1464,10 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
     private Map<String, Object> selectSceneScore(String scenePackageId, String projectId) {
 
         //查询场景包所有数据
-        List<SublistScoreVo> pos = simulationProjectMapper.selectSubScore(scenePackageId);
+        SimulationManualProjectParam query = new SimulationManualProjectParam();
+        query.setId(projectId);
+        query.setPackageId(scenePackageId);
+        List<SublistScoreVo> pos = simulationProjectMapper.selectSubScore(query);
 
         HashMap<String, Object> hashMap = new HashMap<>();
 
@@ -1486,7 +1489,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
 
                         sublistScoreVo.setSceneScore(sc.getScore()); //得分
                         sublistScoreVo.setTargetEvaluate(sc.getTargetEvaluate());//指标评价
-//                        sublistScoreVo.setReturnSceneId(sc.getReturnSceneId());//显示的场景id
+                        sublistScoreVo.setReturnSceneId(sc.getReturnSceneId());//显示的场景id
                         String sceneType = sc.getSceneType();
                         String sceneName = "";
                         if(DictConstants.SCENE_NATURAL.equals(sceneType)){
@@ -1494,24 +1497,24 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
                             sublistScoreVo.setSceneType("自然驾驶");
                             //获取场景名称
                             SceneBaseInfoVo sceneBaseInfoVo = simulationProjectMapper.selectSceneNatural(sc.getSceneId());
-                            sceneName = sceneBaseInfoVo.getNaturalName();
+//                            sceneName = sceneBaseInfoVo.getNaturalName();
                         }else if(DictConstants.SCENE_STANDARD.equals(sceneType)){
                             //标准法规
                             sublistScoreVo.setSceneType("标准法规");
                             //获取场景名称
                             SceneBaseInfoVo sceneBaseInfoVo = simulationProjectMapper.selectSceneStandardsRegulations(sc.getSceneId());
-                            sceneName = sceneBaseInfoVo.getSceneName();
+//                            sceneName = sceneBaseInfoVo.getSceneName();
                         }else if(DictConstants.SCENE_ACCIDENT.equals(sceneType)){
                             //交通事故
                             sublistScoreVo.setSceneType("交通事故");
                             //获取场景名称
                             SceneBaseInfoVo sceneBaseInfoVo = simulationProjectMapper.selectSceneAccidentById(sc.getSceneId());
-                            sceneName = sceneBaseInfoVo.getSceneName();
+//                            sceneName = sceneBaseInfoVo.getSceneName();
                         }else if(DictConstants.SCENE_GENERAL.equals(sceneType)){
                             /// TODO 泛化场景暂不支持
 
                         }
-                        sublistScoreVo.setReturnSceneId(sceneName);//显示场景名称
+//                        sublistScoreVo.setReturnSceneId(sceneName);//显示场景名称
 
                         lastSubList.add(sublistScoreVo);
                     }
@@ -1650,10 +1653,13 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
 
 
 
-    private Map<String,Object> selectScenePackageSubListAndSetScore(String scenePackageId){
+    private Map<String,Object> selectScenePackageSubListAndSetScore(String scenePackageId, String projectId){
 
         //查询场景包所有数据
-        List<SublistScoreVo> pos = simulationProjectMapper.selectSubScore(scenePackageId);
+        SimulationManualProjectParam query = new SimulationManualProjectParam();
+        query.setId(projectId);
+        query.setPackageId(scenePackageId);
+        List<SublistScoreVo> pos = simulationProjectMapper.selectSubScore(query);
 
         HashMap<String, Object> hashMap = new HashMap<>();
 
@@ -3444,6 +3450,16 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
 
     }
 
+    @Override
+    public ResponseBodyVO addOrUpdateAutomaticProject(SimulationManualProjectParam param) {
+
+        if(isEmpty(param.getProjectName())){
+            return new ResponseBodyVO(ResponseBodyVO.Response.CLIENT_FAILURE,"工作名称不能为空");
+        }
+
+        return null;
+    }
+
     /**
      * 换行
      * @param lineNum 换行数量

+ 1 - 1
simulation-resource-server/src/main/java/com/css/simulation/resource/project/mapper/SimulationProjectMapper.java

@@ -85,7 +85,7 @@ public interface SimulationProjectMapper {
 
     List<SimulationManualProjectPo> selectProjectNowRunState(String[] ids);
 
-    List<SublistScoreVo> selectSubScore(String id);
+    List<SublistScoreVo> selectSubScore(SimulationManualProjectParam param);
 
     Integer selectRunProjectBySy(Map map);
 

+ 3 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/project/service/SimulationProjectService.java

@@ -61,4 +61,7 @@ public interface SimulationProjectService {
     void exportProjectTaskFileById(SimulationManualProjectParam param);
 
     void exportProjectReportAndTaskFileById(SimulationManualProjectParam param);
+
+    ResponseBodyVO addOrUpdateAutomaticProject(SimulationManualProjectParam param);
+
 }

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

@@ -461,13 +461,14 @@
     </select>
 
     <!--查询所有指标得分-->
-    <select id="selectSubScore" parameterType="string" resultType="api.common.pojo.vo.project.SublistScoreVo">
+    <select id="selectSubScore" parameterType="api.common.pojo.param.project.SimulationManualProjectParam" resultType="api.common.pojo.vo.project.SublistScoreVo">
         select sub.sublist_id as id, sub.parent_id, sub.sublist_name,sub.scene_num,
         fir.score as firScore,las.score as lasScore, sub.package_and_rules, las.not_standard_scene_num, las.score_explain
         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 sub.root_id = #{id,jdbcType=VARCHAR} and sub.is_deleted='0'
+        where sub.root_id = #{packageId,jdbcType=VARCHAR} and sub.is_deleted='0'
+        and (fir.p_id=#{id,jdbcType=VARCHAR} or las.p_id=#{id,jdbcType=VARCHAR})
 				order by seq
     </select>