Quellcode durchsuchen

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

wangyaodong vor 3 Jahren
Ursprung
Commit
a61238a077

+ 3 - 0
api-common/src/main/java/api/common/pojo/po/project/SimulationMptLastTargetScorePo.java

@@ -23,5 +23,8 @@ public class SimulationMptLastTargetScorePo extends BasePo {
     //未达标场景个数
     private Integer notStandardSceneNum;
 
+    //得分说明
+    private String scoreExplain;
+
 
 }

+ 24 - 2
api-common/src/main/java/api/common/pojo/vo/project/ManualProjectTaskVo.java

@@ -3,6 +3,8 @@ package api.common.pojo.vo.project;
 import lombok.Getter;
 import lombok.Setter;
 
+import java.util.Date;
+
 
 @Getter
 @Setter
@@ -14,6 +16,9 @@ public class ManualProjectTaskVo {
     //项目主表id
     private String pId;
 
+    //最后一级指标id
+    private String lastTargerId;
+
     //场景id
     private String sceneId;
 
@@ -27,14 +32,31 @@ public class ManualProjectTaskVo {
     private String sceneType;
 
     //运行开始时间
-    private String runStartTime;
+    private Date runStartTime;
 
     //运行结束时间
-    private String runEndTime;
+    private Date runEndTime;
+
+    //运行开始时间fmt
+    private String runStartTimeFmt;
+
+    //运行结束时间fmt
+    private String runEndTimeFmt;
 
     //运行状态
     private String runState;
 
     //运行结果
     private String runResult;
+
+    //得分
+    private String score;
+
+    //指标评价
+    private String targetEvaluate;
+
+    //返回的场景id
+    private String returnSceneId;
+
+
 }

+ 4 - 0
api-common/src/main/java/api/common/pojo/vo/project/ProjectReportVo.java

@@ -41,6 +41,10 @@ public class ProjectReportVo {
     //算法测试评分细则、详细得分情况
     private List<ScenePackageSubListVO> sceneScoreList;
 
+    private List<SubScListVo> subListScoreLi;
+
+    private List<List<String>> sceneScoreLi;
+
 
 }
 

+ 3 - 0
api-common/src/main/java/api/common/pojo/vo/project/ScenePackageSubListVO.java

@@ -57,5 +57,8 @@ public class ScenePackageSubListVO {
     //指标评价
     private String targetEvaluate;
 
+    //得分说明
+    private String scoreExplain;
+
 
 }

+ 30 - 0
api-common/src/main/java/api/common/pojo/vo/project/SubScListVo.java

@@ -0,0 +1,30 @@
+package api.common.pojo.vo.project;
+
+import lombok.Getter;
+import lombok.Setter;
+
+@Getter
+@Setter
+public class SubScListVo {
+
+    private String sublistName1;
+
+    private String sublistName2;
+
+    private String sublistName3;
+
+    private String sublistName4;
+
+    private String sublistName5;
+
+    private String sublistName6;
+
+    private String sceneNum;
+
+    private String notStandardSceneNum;
+
+    private String lastScore;
+
+    private String firstScore;
+
+}

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

@@ -0,0 +1,27 @@
+package api.common.pojo.vo.project;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 指标得分
+ */
+@Getter
+@Setter
+public class SublistScoreVo {
+
+    private String id;
+    private String parentId;
+    private String sublistName;
+    private String sceneNum;
+    private String firScore;
+    private String lasScore;
+    private String packageAndRules;
+    private String notStandardSceneNum;
+    private String scoreExplain;
+    private String sceneScore;
+    private String targetEvaluate;
+    private String sceneType;
+    private String returnSceneId;
+
+}

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

@@ -9,6 +9,10 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
 /**
  * 工作台模块--项目运行
  */
@@ -152,5 +156,18 @@ public class SimulationProjectCtrl {
     }
 
 
+    /**
+     * 查询工作任务列表
+     * @param param
+     * @return
+     */
+    @RequestMapping("selectProjectTaskList")
+    @ResponseBody
+    public ResponseBodyVO selectProjectTaskList(@RequestBody SimulationManualProjectParam param){
+        return service.selectProjectTaskList(param);
+    }
+
+
+
 
 }

+ 322 - 20
simulation-resource-server/src/main/java/com/css/simulation/resource/project/impl/SimulationProjectServiceImpl.java

@@ -10,9 +10,12 @@ import api.common.pojo.param.project.SimulationManualProjectKafkaParam;
 import api.common.pojo.param.project.SimulationManualProjectParam;
 import api.common.pojo.param.system.DictParam;
 import api.common.pojo.po.project.*;
+import api.common.pojo.po.scene.ScenePackageSublistPO;
 import api.common.pojo.vo.project.*;
 import api.common.util.JsonUtil;
+import api.common.util.ObjectUtil;
 import api.common.util.TimeUtil;
+import com.alibaba.druid.support.spring.stat.SpringStatUtils;
 import com.css.simulation.resource.common.utils.AuthUtil;
 import com.css.simulation.resource.common.utils.PageUtil;
 import com.css.simulation.resource.project.constants.ProjectConstants;
@@ -25,6 +28,7 @@ import com.css.simulation.resource.system.service.DictService;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.github.pagehelper.PageInfo;
 import lombok.SneakyThrows;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -65,8 +69,6 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
                 return new ResponseBodyVO(ResponseBodyVO.Response.CLIENT_FAILURE,"工作名称已经存在,请修改后再保存");
             }
 
-            //添加
-//            ResponseBodyVO vo = new ResponseBodyVO();
 
             po.createPo(AuthUtil.getCurrentUserId());
             //生成id
@@ -312,19 +314,19 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
         //任务信息
         ProjectTaskParam projectTaskParam = new ProjectTaskParam();
         projectTaskParam.setPId(po.getId());
-        List<ManualProjectTaskPo> manualProjectTaskPos = simulationProjectMapper.selectprojectTaskByQuery(projectTaskParam);
-        List<ManualProjectTaskVo> ManualProjectTaskVoList = new ArrayList<>();
+//        List<ManualProjectTaskPo> manualProjectTaskPos = simulationProjectMapper.selectprojectTaskByQuery(projectTaskParam);
+//        List<ManualProjectTaskVo> ManualProjectTaskVoList = new ArrayList<>();
         List<ProjectRunStateNumVo> projectRunStateNumVoList = new ArrayList<>();
         List<ProjectRunResultRatioNumVo> projectRunResultRatioNumVoList = new ArrayList<>();
-        if(manualProjectTaskPos != null){
-            for(ManualProjectTaskPo task : manualProjectTaskPos){
-                ManualProjectTaskVo manualProjectTaskVo = convertManualProjectTaskPoToVo(task);
-                setUpSceneInfo(manualProjectTaskVo);
-                ManualProjectTaskVoList.add(manualProjectTaskVo);
-            }
+//        if(manualProjectTaskPos != null){
+//            for(ManualProjectTaskPo task : manualProjectTaskPos){
+//                ManualProjectTaskVo manualProjectTaskVo = convertManualProjectTaskPoToVo(task);
+//                setUpSceneInfo(manualProjectTaskVo);
+//                ManualProjectTaskVoList.add(manualProjectTaskVo);
+//            }
 
             //任务运行状态统计
-            int size = manualProjectTaskPos.size();
+            Integer size = simulationProjectMapper.selectProjectTaskNumByProjectId(projectTaskParam);
 //            List<ProjectRunStateNumVo> projectRunStateNumVos = simulationProjectMapper.selectRunStateCount(po.getId());
             projectRunStateNumVoList = simulationProjectMapper.selectRunStateCount(po.getId());
 
@@ -347,7 +349,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
                 projectRunResultRatioNumVoList.add(rv);
             }
 
-        }
+//        }
 
 
 
@@ -373,7 +375,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
         projectDetailsVo.setSensorLidarList(sensorLidarList);
         projectDetailsVo.setSensorRadarList(sensorRadarList);
         projectDetailsVo.setSensorGpsList(sensorGpsList);
-        projectDetailsVo.setTaskList(ManualProjectTaskVoList);
+//        projectDetailsVo.setTaskList(ManualProjectTaskVoList);
         projectDetailsVo.setStateList(projectRunStateNumVoList);
         projectDetailsVo.setResultList(projectRunResultRatioNumVoList);
 
@@ -485,13 +487,24 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
         projectReportVo.setEvaluationGrade(evaluationLevelReport);
 
         //算法测试评分细则、详细得分情况
-        List<ScenePackageSubListVO> scenePackageSubListVOS1 = selectScenePackageSubListTreeAndSetScore(null, true, po.getScene(), po.getId(), 2);
-        projectReportVo.setSceneScoreList(scenePackageSubListVOS1);
+        /*List<ScenePackageSubListVO> scenePackageSubListVOS1 = selectScenePackageSubListTreeAndSetScore(null, true, po.getScene(), po.getId(), 2);
+        projectReportVo.setSceneScoreList(scenePackageSubListVOS1);*/
+
+        //查询场景包所有数据
+        List<SublistScoreVo> pos = simulationProjectMapper.selectSubScore(po.getScene());
+
+        //指标得分列表
+        /*projectReportVo.setSubListScoreLi(selectScenePackageSubListAndSetScore(pos,po.getScene()));
+
+        //场景得分列表
+        projectReportVo.setSceneScoreLi(selectSceneScore(pos,po.getId()));*/
 
         return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS, projectReportVo);
     }
 
 
+
+
     @Override
     public ResponseBodyVO selectDropDownByType(SimulationManualProjectParam param) {
         List<DropDownTypeVo> result = new ArrayList<>();
@@ -594,6 +607,30 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
 
     }
 
+    @Override
+    public ResponseBodyVO selectProjectTaskList(SimulationManualProjectParam param) {
+        if(isEmpty(param.getId())){
+            return new ResponseBodyVO(ResponseBodyVO.Response.CLIENT_FAILURE);
+        }
+        //查询任务信息
+        ProjectTaskParam projectTaskParam = new ProjectTaskParam();
+        projectTaskParam.setPId(param.getId());
+        setPage(param.getCurrentPage()==null?1:param.getCurrentPage(), param.getPageSize()==null?10:param.getPageSize());
+        List<ManualProjectTaskVo> manualProjectTaskVos = simulationProjectMapper.selectProjectTaskByProjectId(projectTaskParam);
+
+        PageInfo<ManualProjectTaskVo> pageInfo = new PageInfo(manualProjectTaskVos);
+
+        if(pageInfo.getList() != null){
+            for(ManualProjectTaskVo task : pageInfo.getList()){
+                task.setRunStartTimeFmt(getRqStr(task.getRunStartTime(), 2));
+                task.setRunEndTimeFmt(getRqStr(task.getRunEndTime(), 2));
+                setUpSceneInfo(task);
+
+            }
+        }
+        return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS,pageInfo);
+    }
+
     private void analysisCsvFile(String filePath, int[] analysisFields) throws Exception {
 
         File file = new File(filePath);
@@ -845,20 +882,20 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
 
     private ManualProjectTaskVo convertManualProjectTaskPoToVo(ManualProjectTaskPo po){
         ManualProjectTaskVo manualProjectTaskVo = new ManualProjectTaskVo();
-        manualProjectTaskVo.setId(po.getPId());
+        manualProjectTaskVo.setId(po.getId());
         manualProjectTaskVo.setPId(po.getPId());
         manualProjectTaskVo.setSceneId(po.getSceneId());
 //        manualProjectTaskVo.setSceneName(po.getSceneName());
         manualProjectTaskVo.setSceneType(po.getSceneType());
-        manualProjectTaskVo.setRunStartTime(getRqStr(po.getRunStartTime(), 2));
-        manualProjectTaskVo.setRunEndTime(getRqStr(po.getRunEndTime(), 2));
+        manualProjectTaskVo.setRunStartTimeFmt(getRqStr(po.getRunStartTime(), 2));
+        manualProjectTaskVo.setRunEndTimeFmt(getRqStr(po.getRunEndTime(), 2));
         manualProjectTaskVo.setRunState(po.getRunState());
         manualProjectTaskVo.setRunResult(po.getRunResult());
         return manualProjectTaskVo;
     }
 
     /**
-     * 生成项目场景信息和最后一级指标信息
+     * 生成项目场景信息和最后一级指标信息 TODO 暂不使用
      */
     private void createProjectSceneAndTarget(String id){
         //1.查询场景包下最后一级指标和指标下所有场景
@@ -963,7 +1000,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
                     selectScenePackageSubListTreeAndSetScore(cvoList,false, null, pId, level+1);
                 }else{
 
-                    //没有子节点;最后一级,获取指标得分和指标下场景得分
+                    //没有子节点;最后一级,获取指标得分,指标得分说明,和指标下场景得分
                     setScore(pvo,pId);
                 }
 
@@ -974,6 +1011,267 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
         return parentVoList;
     }
 
+
+    private List<List<String>> selectSceneScore(List<SublistScoreVo> pos, String projectId) {
+
+        //1.获取项目下所有场景得分
+        ProjectTaskParam param = new ProjectTaskParam();
+        param.setPId(projectId);
+        List<ManualProjectTaskVo> manualProjectTaskVos = simulationProjectMapper.selectProjectTaskByProjectId(param);
+
+        List<SublistScoreVo> lastSubList = new ArrayList<>();
+        //2.拼接场景得分信息
+        for(SublistScoreVo po : pos){
+            if(ObjectUtil.isNotNull(po.getPackageAndRules())){
+
+                //获取场景得分信息
+                for(ManualProjectTaskVo sc : manualProjectTaskVos)
+                    if (sc.getLastTargerId().equals(po.getId())) {
+                        SublistScoreVo sublistScoreVo = new SublistScoreVo();
+                        BeanUtils.copyProperties(po, sublistScoreVo);
+
+                        sublistScoreVo.setSceneScore(sc.getScore()); //得分
+                        sublistScoreVo.setTargetEvaluate(sc.getTargetEvaluate());//指标评价
+                        sublistScoreVo.setReturnSceneId(sc.getReturnSceneId());//显示的场景id
+                        String sceneType = sc.getSceneType();
+                        if(DictConstants.SCENE_NATURAL.equals(sceneType)){
+                            //自然驾驶
+                            sublistScoreVo.setSceneType("自然驾驶");
+                        }else if(DictConstants.SCENE_STANDARD.equals(sceneType)){
+                            //标准法规
+                            sublistScoreVo.setSceneType("标准法规");
+                        }else if(DictConstants.SCENE_ACCIDENT.equals(sceneType)){
+                            //交通事故
+                            sublistScoreVo.setSceneType("交通事故");
+                        }else if(DictConstants.SCENE_GENERAL.equals(sceneType)){
+                            /// TODO 泛化场景暂不支持
+
+                        }
+
+                        lastSubList.add(sublistScoreVo);
+                    }
+
+            }
+        }
+
+        int size = 0;
+        List<List<String>> result = new ArrayList<>();
+        //末级指标
+        for(SublistScoreVo sp : lastSubList){
+            setParentSub(sp,pos);
+            String sublistName = sp.getSublistName();
+            sublistName += ","+sp.getReturnSceneId()+","+sp.getSceneType()+","+sp.getSceneScore()+","+sp.getTargetEvaluate()+","+sp.getScoreExplain();
+
+            String[] split = sublistName.split(",");
+
+            List<String> strings = new LinkedList<>();
+            strings.addAll(Arrays.asList(split));
+            if(size<strings.size()){
+                size = strings.size();
+            }
+            result.add(strings);
+
+        }
+
+        //结果补全
+        for(List<String> list : result){
+            int offset = size - list.size();
+            int start = list.size() - 3;
+            for(int i=0;i<offset;i++){
+                list.add(start+i,"");
+            }
+
+        }
+
+        return result;
+
+
+    }
+
+    private void setParentSub(SublistScoreVo po, List<SublistScoreVo> pos) {
+        for(SublistScoreVo p : pos){
+            if(po.getParentId().equals(p.getId())){
+                po.setSublistName(p.getSublistName()+","+po.getSublistName());
+                setParentSub(p, pos);
+            }
+
+        }
+    }
+
+
+    private List<SubScListVo> selectScenePackageSubListAndSetScore(List<SublistScoreVo> pos, String scenePackageId){
+
+        int size = 0;
+        List<List<String>> result = new ArrayList<>();
+        //递归指标名称得分
+        for(SublistScoreVo po : pos){
+            if(ObjectUtil.isNotNull(po.getPackageAndRules())){
+                //末级指标
+                setParent(po,pos,scenePackageId);
+
+
+
+
+                String sublistName = po.getSublistName();
+                String firstScore = po.getFirScore();//first得分
+                String LastScore = po.getLasScore();//last得分
+                String sceneNum = po.getSceneNum();//场景数量
+                String notStandardSceneNum = po.getNotStandardSceneNum();//未达标场景数量
+
+                if(ObjectUtil.isNotNull(sublistName)){
+                    sublistName += ","+sceneNum+","+notStandardSceneNum+","+LastScore+","+firstScore;
+                    String[] split = sublistName.split(",");
+
+
+                    List<String> strings = new LinkedList<>();
+                    strings.addAll(Arrays.asList(split));
+                    if(size<strings.size()){
+                        size = strings.size();
+                    }
+                    result.add(strings);
+                }
+
+            }
+
+        }
+
+
+        List<SubScListVo> objects = new ArrayList<>();
+        //结果补全
+        for(List<String> list : result){
+            int offset = size - list.size();
+            int start = list.size() - 4;
+            /*for(int i=0;i<offset;i++){
+                list.add(start+i,"");
+            }*/
+            SubScListVo subScListVo = new SubScListVo();
+            for(int i=0;i<start;i++){
+                if(0 == i){
+                    subScListVo.setSublistName1(list.get(i));
+                }else if(1 == i){
+                    subScListVo.setSublistName2(list.get(i));
+                }else if(2 == i){
+                    subScListVo.setSublistName3(list.get(i));
+                }else if(3 == i){
+                    subScListVo.setSublistName4(list.get(i));
+                }else if(4 == i){
+                    subScListVo.setSublistName5(list.get(i));
+                }else if(5 == i){
+                    subScListVo.setSublistName6(list.get(i));
+                }
+
+            }
+            subScListVo.setSceneNum(list.get(start));
+            subScListVo.setNotStandardSceneNum(list.get(start+1));
+            subScListVo.setLastScore(list.get(start+2));
+            subScListVo.setFirstScore(list.get(start+3));
+
+            objects.add(subScListVo);
+
+
+        }
+
+        List<Map<String, String>> cloums = new ArrayList<>();
+        for(int i=0; i<size-4;i++){
+            if(0 == i){
+                Map<String, String> map = new HashMap<>();
+//                map.put("");
+            }else if(1 == i){
+            }else if(2 == i){
+            }else if(3 == i){
+            }else if(4 == i){
+            }else if(5 == i){
+            }
+        }
+
+
+
+        return objects;
+
+
+    }
+
+    private void setParent(SublistScoreVo po, List<SublistScoreVo> pos, String rootId) {
+        for(SublistScoreVo p : pos){
+
+            if(po.getParentId().equals(p.getId())){
+                //给一级指标添加末级指标得分,给末级指标添加一级指标得分
+                if(p.getParentId().equals(rootId)){
+                    p.setLasScore(po.getLasScore());
+                    po.setFirScore(p.getFirScore());
+                }
+                po.setSublistName(p.getSublistName()+","+po.getSublistName());
+                setParent(p, pos, rootId);
+            }
+
+        }
+    }
+
+/*
+    *//**
+     * 查询所有指标和得分
+     * @param scenePackageId
+     *//*
+    private void selectScenePackageSubListAndSetScore(String pId, String scenePackageId, List<List<String>> resultArr, List<ScenePackageSubListVO>  single){
+
+        //首次,初始化数据以及赋值
+        if(isEmpty(single)){
+            //单个级联,按最后一级到第一级指标顺序添加
+            single= new ArrayList<>();
+            //查询所有指标最后一级
+            List<ScenePackageSubListVO> vos = simulationProjectMapper.selectSubListByPid(scenePackageId);
+            for(ScenePackageSubListVO vo : vos){
+                selectSceneSubList(vo, pId, single, resultArr);
+            }
+        }
+        //继续添加数据
+        else{
+            //查询父级节点,只有一个
+            ScenePackageSubListVO vo = simulationProjectMapper.selectsublistBySublistId(scenePackageId);
+            //如果是根节点,不再查询,组装返回数据
+            if(vo.getSublistId().equals(scenePackageId)){
+                if(isEmpty(resultArr)){
+                    //初始化返回数据
+                    resultArr = new ArrayList<>();
+                    List<String> singleList = new ArrayList<>();
+                    //反转list,正序添加(从一级开始)
+                    Collections.reverse(single);
+
+                    for(int i=0;i<single.size();i--){
+                        if(i == single.size()-1){
+                            singleList.add(String.valueOf(single.get(i).getSceneNum()));
+                            singleList.add(String.valueOf(single.get(i).getNotStandardSceneNum()));
+                            singleList.add(String.valueOf(single.get(i).getScore()));
+
+                            singleList.add(String.valueOf(single.get(i).getScore()));
+
+                        }
+                        singleList.add(single.get(i).getSublistName());
+                    }
+
+
+
+
+
+
+                }
+
+            }else{
+                selectSceneSubList(vo, pId, single, resultArr);
+            }
+        }
+
+    };*/
+
+/*    private void selectSceneSubList(ScenePackageSubListVO vo, String pId, List<ScenePackageSubListVO>  single, List<List<String>> resultArr){
+        //获取未达标个数,得分,总分
+        setScore(vo,pId);
+        //放入集合
+        single.add(vo);
+        //递归查询上级指标
+        selectScenePackageSubListAndSetScore(pId, vo.getParentId(), resultArr, single);
+    }*/
+
     private void setScore(ScenePackageSubListVO vo, String pId){
         setLastTargetScore(vo,pId);
         setSceneScore(vo,pId);
@@ -1009,6 +1307,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
         if(po != null){
             vo.setNotStandardSceneNum(po.getNotStandardSceneNum());
             vo.setScore(po.getScore());
+            vo.setScoreExplain(po.getScoreExplain());
         }
 
     }
@@ -1171,6 +1470,9 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
                 simulationMptFirstTargetScorePo.setTarget(v.getSublistId());
                 //单个二级指标得分
                 SimulationMptFirstTargetScorePo simulationMptFirstTargetScorePo1 = simulationProjectMapper.selectFirstTargetScore(simulationMptFirstTargetScorePo);
+                if(simulationMptFirstTargetScorePo1 == null){
+                    return evaluationLevelReport;
+                }
                 Double score = simulationMptFirstTargetScorePo1.getScore();
                 totalScore += score*(weightDouble/100);
             }

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

@@ -4,6 +4,7 @@ import api.common.pojo.param.project.ProjectTaskParam;
 import api.common.pojo.param.project.SceneScoreParam;
 import api.common.pojo.param.project.SimulationManualProjectParam;
 import api.common.pojo.po.project.*;
+import api.common.pojo.po.scene.ScenePackageSublistPO;
 import api.common.pojo.vo.project.*;
 import org.apache.ibatis.annotations.Mapper;
 import org.springframework.stereotype.Repository;
@@ -60,6 +61,10 @@ public interface SimulationProjectMapper {
 
     List<ManualProjectTaskPo> selectprojectTaskByQuery(ProjectTaskParam vo);
 
+    List<ManualProjectTaskVo>  selectProjectTaskByProjectId(ProjectTaskParam vo);
+
+    Integer selectProjectTaskNumByProjectId(ProjectTaskParam vo);
+
     List<ProjectRunStateNumVo> selectRunStateCount(String id);
 
     List<ProjectRunResultRatioNumVo> selectRunResultCount(String id);
@@ -80,7 +85,7 @@ public interface SimulationProjectMapper {
 
     SimulationMptFirstTargetScorePo selectFirstTargetScore(SimulationMptFirstTargetScorePo po);
 
-    SimulationMptSceneScorePo selectSceneScore(SimulationMptSceneScorePo po);
+    List<SimulationMptSceneScorePo> selectSceneScore(SimulationMptSceneScorePo po);
 
     List<SceneScoreVo> selectSceneScoreByIds(SceneScoreParam param);
 
@@ -94,4 +99,6 @@ public interface SimulationProjectMapper {
 
     List<SimulationManualProjectPo> selectProjectNowRunState(String[] ids);
 
+    List<SublistScoreVo> selectSubScore(String id);
+
 }

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

@@ -30,4 +30,6 @@ public interface SimulationProjectService {
 
     ResponseBodyVO analysisVehicleCoord() throws Exception;
 
+    ResponseBodyVO selectProjectTaskList(SimulationManualProjectParam param);
+
 }

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

@@ -218,11 +218,11 @@
         where id = #{id,jdbcType=VARCHAR} and is_deleted = '0'
     </update>
 
-    <!--获取算法基本信息-->
+    <!--获取算法基本信息 /*where a.share = '0' and a.is_deleted = '0'*/-->
     <select id="selectAlgorithmBaseInfoById" parameterType="string" resultType="api.common.pojo.vo.project.AlgorithmBaseInfoVo">
         select a.id, a.algorithm_name, a.description
         from algorithm a
-        where is_deleted = '0'
+        where a.is_deleted = '0'
         <if test="id != null and id != ''">
             and a.id = #{id,jdbcType=VARCHAR}
         </if>
@@ -242,7 +242,7 @@
     <select id="selectConfigVehicle" parameterType="string" resultType="api.common.pojo.vo.project.ConfigVehicleVO">
         select id, config_name, vehicle_id
         from model_config
-        where is_deleted = '0'
+        where share = '0' and is_deleted = '0'
         <if test="id != null and id != ''">
             and id = #{id,jdbcType=VARCHAR}
         </if>
@@ -263,9 +263,9 @@
     <select id="selectScenePackageBaseById" parameterType="string" resultType="api.common.pojo.vo.project.ScenePackageBaseVo">
         select a.package_id,a.package_name, a.scene_num
         from scene_package a
-        where is_deleted = '0'
+        where a.share = '0' and a.is_deleted = '0'
         <if test="id != null and id != ''">
-            and a.id = #{id,jdbcType=VARCHAR}
+            and a.package_id = #{id,jdbcType=VARCHAR}
         </if>
     </select>
 
@@ -280,33 +280,33 @@
     <select id="selectSensorCamera" parameterType="string" resultType="api.common.pojo.vo.project.SensorBaseInfoVo">
         select a.sensor_name
         from model_sensor_camera a
-        where a.id = #{id,jdbcType=VARCHAR} and a.is_deleted = '0'
+        where a.id = #{id,jdbcType=VARCHAR}
     </select>
 
     <!--完美传感器基本信息-->
     <select id="selectSensorOgt" parameterType="string" resultType="api.common.pojo.vo.project.SensorBaseInfoVo">
         select a.sensor_name
         from model_sensor_ogt a
-        where a.id = #{id,jdbcType=VARCHAR} and a.is_deleted = '0'
+        where a.id = #{id,jdbcType=VARCHAR}
     </select>
 
     <!--激光雷达基本信息-->
     <select id="selectSensorLidar" parameterType="string" resultType="api.common.pojo.vo.project.SensorBaseInfoVo">
         select a.sensor_name
         from model_sensor_lidar a
-        where a.id = #{id,jdbcType=VARCHAR} and is_deleted = '0'
+        where a.id = #{id,jdbcType=VARCHAR}
     </select>
     <!--毫米波雷达基本信息-->
     <select id="selectSensorRadar" parameterType="string" resultType="api.common.pojo.vo.project.SensorBaseInfoVo">
         select a.name as sensor_name
         from model_sensor_radar a
-        where a.id = #{id,jdbcType=VARCHAR} and is_deleted = '0'
+        where a.id = #{id,jdbcType=VARCHAR}
     </select>
     <!--gps基本信息-->
     <select id="selectSensorGps" parameterType="string" resultType="api.common.pojo.vo.project.SensorBaseInfoVo">
         select a.sensor_name
         from model_sensor_gps a
-        where a.id = #{id,jdbcType=VARCHAR} and is_deleted = '0'
+        where a.id = #{id,jdbcType=VARCHAR}
     </select>
 
     <!--查询交通事故场景信息-->
@@ -346,6 +346,20 @@
         </where>
     </select>
 
+    <!--根据项目id查询任务列表-->
+    <select id="selectProjectTaskByProjectId" parameterType="api.common.pojo.param.project.ProjectTaskParam" resultType="api.common.pojo.vo.project.ManualProjectTaskVo">
+        select *
+        from simulation_manual_project_task
+        where is_deleted = '0' and p_id = #{pId,jdbcType=VARCHAR}
+    </select>
+
+    <!--根据项目id查询任务列表总数-->
+    <select id="selectProjectTaskNumByProjectId" parameterType="api.common.pojo.param.project.ProjectTaskParam" resultType="int">
+        select count(*) as num
+        from simulation_manual_project_task
+        where is_deleted = '0' and p_id = #{pId,jdbcType=VARCHAR}
+    </select>
+
     <!--根据任务运行状态分组查询统计数量-->
     <select id="selectRunStateCount" parameterType="string" resultType="api.common.pojo.vo.project.ProjectRunStateNumVo">
         select run_state as stateName, count(*) as num
@@ -382,6 +396,7 @@
     <select id="selectSubListByPid" parameterType="string" resultType="api.common.pojo.vo.project.ScenePackageSubListVO">
         select
         sublist_id,
+        parent_id,
         sublist_name,
         scene_num,
         scene_natural_ids,
@@ -479,7 +494,7 @@
 
     <!--查询最后一级指标得分-->
     <select id="selectLastTargetScore" parameterType="api.common.pojo.po.project.SimulationMptLastTargetScorePo" resultType="api.common.pojo.po.project.SimulationMptLastTargetScorePo">
-        select not_standard_scene_num, score
+        select not_standard_scene_num, score, score_explain
         from simulation_mpt_last_target_score
         where p_id = #{pId,jdbcType=VARCHAR} and target = #{target,jdbcType=VARCHAR} and is_deleted = '0'
     </select>
@@ -495,7 +510,10 @@
     <select id="selectSceneScore" parameterType="api.common.pojo.po.project.SimulationMptSceneScorePo" resultType="api.common.pojo.po.project.SimulationMptSceneScorePo">
         select score, target_evaluate
         from simulation_mpt_scene_score
-        where p_id = #{pId,jdbcType=VARCHAR} and scene_id = #{sceneId,jdbcType=VARCHAR} and is_deleted = '0'
+        where p_id = #{pId,jdbcType=VARCHAR} and is_deleted = '0'
+        <if test="sceneId != null and sceneId != ''">
+            and scene_id = #{sceneId,jdbcType=VARCHAR}
+        </if>
     </select>
 
     <!--查询场景不等于0的得分的数量-->
@@ -525,4 +543,16 @@
         where id = #{id,jdbcType=VARCHAR}
     </select>
 
+    <!--查询所有指标得分-->
+    <select id="selectSubScore" parameterType="string" 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 root_id = '596e66b5aee845a892911ab8d24d9697'
+				order by seq
+    </select>
+
+
 </mapper>