|
@@ -433,14 +433,16 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
if (DictConstants.PROJECT_TYPE_MANUAL.equals(param.getProjectType())) { // 手动运行任务
|
|
|
SimulationManualProjectPo po = simulationProjectMapper.selectProjectById(param);
|
|
|
projectDetailsVo = JsonUtil.jsonToBean(po.getDetails(), ProjectDetailsVo.class);
|
|
|
- projectDetailsVo.setEvaluationLevel(po.getEvaluationLevel());
|
|
|
+ projectDetailsVo.setEvaluationLevel(getDictName(DictConstants.EVALUATION_LEVEL, po.getEvaluationLevel()));
|
|
|
+ projectDetailsVo.setStartTime(getRqStr(po.getStartTime(), 1));
|
|
|
projectDetailsVo.setFinishTime(getRqStr(po.getFinishTime(), 1));
|
|
|
projectDetailsVo.setNowRunState(po.getNowRunState());
|
|
|
projectDetailsVo.setNowRunStateName(getDictName(DictConstants.PROJECT_RUN_STATE, po.getNowRunState()));
|
|
|
} else if (DictConstants.PROJECT_TYPE_AUTO_SUB.equals(param.getProjectType())) {
|
|
|
SimulationManualProjectVo po = simulationAutomaticSubProjectMapper.selectProjectInfo(param);
|
|
|
projectDetailsVo = JsonUtil.jsonToBean(po.getDetails(), ProjectDetailsVo.class);
|
|
|
- projectDetailsVo.setEvaluationLevel(po.getEvaluationLevel());
|
|
|
+ projectDetailsVo.setEvaluationLevel(getDictName(DictConstants.EVALUATION_LEVEL, po.getEvaluationLevel()));
|
|
|
+ projectDetailsVo.setStartTime(getRqStr(po.getStartTime(), 1));
|
|
|
projectDetailsVo.setFinishTime(getRqStr(po.getFinishTime(), 1));
|
|
|
projectDetailsVo.setNowRunState(po.getNowRunState());
|
|
|
projectDetailsVo.setNowRunStateName(getDictName(DictConstants.PROJECT_RUN_STATE, po.getNowRunState()));
|
|
@@ -478,7 +480,6 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
projectDetailsVo.setResultList(projectRunResultRatioNumVos);
|
|
|
projectDetailsVo.setResultScoreList(resultScoreList);
|
|
|
projectDetailsVo.setStateList(projectRunStateNumVos);
|
|
|
- projectDetailsVo.setEvaluationLevel(getDictName(DictConstants.EVALUATION_LEVEL, evaluationLevel));
|
|
|
|
|
|
return new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS, projectDetailsVo);
|
|
|
}
|
|
@@ -977,7 +978,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
public ResponseBodyVO<ProjectReportVo> selectProjectReportById(SimulationManualProjectParam param) {
|
|
|
String id = param.getId();
|
|
|
String projectType = param.getProjectType();
|
|
|
- //封装要使用到的数据
|
|
|
+ // 封装要使用到的数据
|
|
|
SimulationManualProjectPo poParam = new SimulationManualProjectPo();
|
|
|
|
|
|
if (DictConstants.PROJECT_TYPE_MANUAL.equals(projectType)) {
|
|
@@ -989,7 +990,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
}
|
|
|
|
|
|
|
|
|
- //算法配置
|
|
|
+ // 算法配置
|
|
|
AlgorithmPO algorithmBaseInfoVo = getAlgorithmInfo(poParam);
|
|
|
ProjectReportVo projectReportVo = new ProjectReportVo();
|
|
|
projectReportVo.setProjectId(poParam.getProjectId());
|
|
@@ -998,7 +999,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
projectReportVo.setAlgorithmDescribe(algorithmBaseInfoVo.getDescription());
|
|
|
String sceneNames;
|
|
|
|
|
|
- //算法测试得分表
|
|
|
+ // 算法测试得分表
|
|
|
/*
|
|
|
汇总测试得分计算方法:(每一项一级指标的测试得分*测试权重)累加
|
|
|
得分率计算方法:每一项一级指标的所有场景得分不为0的数量/每一项一级指标的场景数量
|
|
@@ -1079,7 +1080,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
}
|
|
|
|
|
|
sceneNames = stringBuilder.substring(0, stringBuilder.lastIndexOf("、"));
|
|
|
- projectReportVo.setAlgorithmEvaluation(algorithmBaseInfoVo.getAlgorithmName() + "经测试获得" + evaluationLevelReport + "级评价," + "(" + sceneNames + ")得分率达到了" + projectReportVo.getScoreRatio() + "%。");
|
|
|
+ projectReportVo.setAlgorithmEvaluation(algorithmBaseInfoVo.getAlgorithmName() + "经测试获得" + projectReportVo.getEvaluationLevel() + "级评价," + "(" + sceneNames + ")得分率达到了" + projectReportVo.getScoreRatio() + "%。");
|
|
|
projectReportVo.setAlgorithmScoreList(algorithmScoreVoList);
|
|
|
//指标得分列表
|
|
|
Map<String, Object> stringObjectMap = selectScenePackageSubListAndSetScore(poParam.getScene(), poParam.getId());
|
|
@@ -1087,7 +1088,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
projectReportVo.setSubListScoreLi((List<SubScListVo>) stringObjectMap.get("result"));
|
|
|
|
|
|
//场景得分列表
|
|
|
- Map<String, Object> maps = selectSceneScore(poParam.getScene(), poParam.getId(), null);
|
|
|
+ Map<String, Object> maps = selectSceneScore2(poParam.getScene(), poParam.getId(), null,projectReportVo);
|
|
|
projectReportVo.setSceneScoreLiTitle((List<Map>) maps.get("headerList"));
|
|
|
projectReportVo.setSceneScoreLi((List<SceneScListVo>) maps.get("result"));
|
|
|
|
|
@@ -2095,7 +2096,150 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
r++;
|
|
|
}
|
|
|
List<Map<Object, Object>> headerList = new ArrayList<>();
|
|
|
- for (int i = 0; i < size - 5; i++) {
|
|
|
+ int maxIndex = size - 5;
|
|
|
+ for (int i = 0; i < maxIndex; i++) {
|
|
|
+ addHeaders(i, headerList);
|
|
|
+ }
|
|
|
+ headerList.add(ImmutableMap.builder().put("label", "场景名称").put("prop", "sceneId").build());
|
|
|
+ headerList.add(ImmutableMap.builder().put("label", "场景类型").put("prop", "sceneIdType").build());
|
|
|
+ headerList.add(ImmutableMap.builder().put("label", "测试得分").put("prop", "sceneScore").build());
|
|
|
+ headerList.add(ImmutableMap.builder().put("label", "指标评价").put("prop", "targetEvaluate").build());
|
|
|
+ headerList.add(ImmutableMap.builder().put("label", "得分说明").put("prop", "scoreExplain").build());
|
|
|
+ HashMap<String, Object> hashMap = new HashMap<>();
|
|
|
+ hashMap.put("headerList", headerList);
|
|
|
+ hashMap.put("result", objects);
|
|
|
+ return hashMap;
|
|
|
+ }
|
|
|
+
|
|
|
+ private Map<String, Object> selectSceneScore2(String scenePackageId, String projectId, String taskId, ProjectReportVo projectReportVo) {
|
|
|
+
|
|
|
+ //1 查询指定项目的所有指标得分结果
|
|
|
+ SimulationManualProjectParam query = new SimulationManualProjectParam();
|
|
|
+ query.setId(projectId);
|
|
|
+ query.setPackageId(scenePackageId);
|
|
|
+ List<SublistScoreVo> pos = simulationProjectMapper.selectSubScore2(query);
|
|
|
+ //2 查询指定项目的所有任务得分结果
|
|
|
+ ProjectTaskParam param = new ProjectTaskParam();
|
|
|
+ param.setPId(projectId);
|
|
|
+ if (!isEmpty(taskId)) {
|
|
|
+ param.setTaskId(taskId);
|
|
|
+ }
|
|
|
+ List<ManualProjectTaskVo> taskList = simulationProjectTaskMapper.selectProjectTaskByProjectId(param); // 手动运行项目和自动运行项目使用同一个任务表
|
|
|
+
|
|
|
+ //2 拼接场景得分信息
|
|
|
+ List<SublistScoreVo> lastSubList = new ArrayList<>();
|
|
|
+ for (SublistScoreVo po : pos) {
|
|
|
+ if (ObjectUtil.isNotNull(po.getPackageAndRules())) {
|
|
|
+ //获取场景得分信息
|
|
|
+ for (ManualProjectTaskVo task : taskList)
|
|
|
+ if (task.getLastTargerId().equals(po.getId())) {
|
|
|
+ SublistScoreVo sublistScoreVo = new SublistScoreVo();
|
|
|
+ BeanUtils.copyProperties(po, sublistScoreVo);
|
|
|
+ sublistScoreVo.setRunResult(task.getRunResult());
|
|
|
+ sublistScoreVo.setSceneScore(saveTwoDecimalPlaces(task.getScore())); //得分
|
|
|
+ sublistScoreVo.setTargetEvaluate(task.getTargetEvaluate());//指标评价
|
|
|
+ String sceneType = task.getSceneType();
|
|
|
+ String sceneId = task.getSceneId();
|
|
|
+ String sceneName = "";
|
|
|
+ if (DictConstants.SCENE_NATURAL.equals(sceneType)) {
|
|
|
+ sublistScoreVo.setSceneType("自然驾驶");
|
|
|
+ SceneBaseInfoVo sceneBaseInfoVo = simulationProjectMapper.selectSceneNatural(sceneId);
|
|
|
+ sceneName = sceneBaseInfoVo.getNaturalName();
|
|
|
+ } else if (DictConstants.SCENE_STANDARD.equals(sceneType)) {
|
|
|
+ sublistScoreVo.setSceneType("标准法规");
|
|
|
+ SceneBaseInfoVo sceneBaseInfoVo = simulationProjectMapper.selectSceneStandardsRegulations(sceneId);
|
|
|
+ sceneName = sceneBaseInfoVo.getSceneName();
|
|
|
+ } else if (DictConstants.SCENE_ACCIDENT.equals(sceneType)) {
|
|
|
+ sublistScoreVo.setSceneType("交通事故");
|
|
|
+ SceneBaseInfoVo sceneBaseInfoVo = simulationProjectMapper.selectSceneAccidentById(sceneId);
|
|
|
+ sceneName = sceneBaseInfoVo.getSceneName();
|
|
|
+ } else if (DictConstants.SCENE_GENERAL.equals(sceneType)) {
|
|
|
+ sublistScoreVo.setSceneType("泛化");
|
|
|
+ SceneBaseInfoVo sceneBaseInfoVo = simulationProjectMapper.selectSceneGeneralDataById(sceneId);
|
|
|
+ sceneName = sceneBaseInfoVo.getSceneName();
|
|
|
+ }
|
|
|
+ sublistScoreVo.setReturnSceneId(sceneName); //显示场景名称
|
|
|
+ lastSubList.add(sublistScoreVo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ int size = 0;
|
|
|
+ List<List<String>> result = new ArrayList<>();
|
|
|
+ //新增返回状态
|
|
|
+ ArrayList<String> runStateList = new ArrayList<>();
|
|
|
+ //末级指标
|
|
|
+ for (SublistScoreVo sp : lastSubList) {
|
|
|
+ setParentSub(sp, null, pos);
|
|
|
+ String sublistName = sp.getSublistName();
|
|
|
+ //失败的任务没有数据,需要校验
|
|
|
+ Double sceneScore = sp.getSceneScore();
|
|
|
+ if (sceneScore == null) {
|
|
|
+ sceneScore = 0D;
|
|
|
+ }
|
|
|
+ String targetEvaluate = sp.getTargetEvaluate();
|
|
|
+ if (targetEvaluate == null) {
|
|
|
+ targetEvaluate = "";
|
|
|
+ }
|
|
|
+ /*sublistName += ProjectConstants.SEPARATOR+sp.getReturnSceneId()+ProjectConstants.SEPARATOR+sp.getSceneType()+ProjectConstants.SEPARATOR+
|
|
|
+ sp.getSceneScore()+ProjectConstants.SEPARATOR+sp.getTargetEvaluate()+ProjectConstants.SEPARATOR+sp.getScoreExplain();*/
|
|
|
+ //测试得分,指标评价,得分说明 --处理
|
|
|
+ if (isEmpty(targetEvaluate) || isEmpty(sp.getScoreExplain())) {
|
|
|
+ sublistName += ProjectConstants.SEPARATOR
|
|
|
+ + sp.getReturnSceneId() + ProjectConstants.SEPARATOR
|
|
|
+ + sp.getSceneType() + ProjectConstants.SEPARATOR
|
|
|
+ + "--" + ProjectConstants.SEPARATOR
|
|
|
+ + "--" + ProjectConstants.SEPARATOR
|
|
|
+ + "--";
|
|
|
+ } else {
|
|
|
+ sublistName += ProjectConstants.SEPARATOR
|
|
|
+ + sp.getReturnSceneId() + ProjectConstants.SEPARATOR
|
|
|
+ + sp.getSceneType() + ProjectConstants.SEPARATOR
|
|
|
+ + sceneScore + ProjectConstants.SEPARATOR
|
|
|
+ + targetEvaluate + ProjectConstants.SEPARATOR
|
|
|
+ + sp.getScoreExplain();
|
|
|
+ }
|
|
|
+ String[] split = sublistName.split(ProjectConstants.SEPARATOR);
|
|
|
+ List<String> strings = new LinkedList<>(Arrays.asList(split));
|
|
|
+ if (size < strings.size()) {
|
|
|
+ size = strings.size();
|
|
|
+ }
|
|
|
+ result.add(strings);
|
|
|
+ runStateList.add(sp.getRunResult());
|
|
|
+ }
|
|
|
+ List<SceneScListVo> objects = new ArrayList<>();
|
|
|
+ //结果补全
|
|
|
+ int r = 0;
|
|
|
+ for (List<String> list : result) {
|
|
|
+ int start = list.size() - 5;
|
|
|
+ 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));
|
|
|
+ sceneScListVo.setRunState(runStateList.get(r));
|
|
|
+ objects.add(sceneScListVo);
|
|
|
+ r++;
|
|
|
+ }
|
|
|
+ List<Map<Object, Object>> headerList = new ArrayList<>();
|
|
|
+ int maxIndex = size - 5;
|
|
|
+ projectReportVo.setMaxIndex(maxIndex);
|
|
|
+ for (int i = 0; i < maxIndex; i++) {
|
|
|
addHeaders(i, headerList);
|
|
|
}
|
|
|
headerList.add(ImmutableMap.builder().put("label", "场景名称").put("prop", "sceneId").build());
|
|
@@ -2109,6 +2253,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
return hashMap;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
* @param po 末级指标
|
|
|
* @param parentPo 上级指标
|