|
@@ -389,15 +389,19 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
@Override
|
|
|
@SneakyThrows
|
|
|
public ResponseBodyVO<ProjectDetailsVO> selectProjectDetailsById(SimulationManualProjectParam param) {
|
|
|
-
|
|
|
- ProjectDetailsVO projectDetailsVO = null;
|
|
|
- if (DictConstants.PROJECT_TYPE_MANUAL.equals(param.getProjectType())) { // 手动运行任务
|
|
|
+ ProjectDetailsVO projectDetailsVO;
|
|
|
+ final String projectType = param.getProjectType();
|
|
|
+ String details;
|
|
|
+ if (DictConstants.PROJECT_TYPE_MANUAL.equals(projectType)) { // 手动运行任务
|
|
|
SimulationManualProjectPO simulationManualProjectPO = simulationProjectMapper.selectProjectById(param);
|
|
|
- projectDetailsVO = JsonUtil.jsonToBean(simulationManualProjectPO.getDetails(), ProjectDetailsVO.class);
|
|
|
- } else if (DictConstants.PROJECT_TYPE_AUTO_SUB.equals(param.getProjectType())) {
|
|
|
+ details = simulationManualProjectPO.getDetails();
|
|
|
+ } else if (DictConstants.PROJECT_TYPE_AUTO_SUB.equals(projectType)) {
|
|
|
SimulationManualProjectVO simulationManualProjectVO = simulationAutomaticSubProjectMapper.selectProjectInfo(param);
|
|
|
- projectDetailsVO = JsonUtil.jsonToBean(simulationManualProjectVO.getDetails(), ProjectDetailsVO.class);
|
|
|
+ details = simulationManualProjectVO.getDetails();
|
|
|
+ } else {
|
|
|
+ throw new RuntimeException("未知项目类型:" + projectType);
|
|
|
}
|
|
|
+ projectDetailsVO = JsonUtil.jsonToBean(details, ProjectDetailsVO.class);
|
|
|
return new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS, projectDetailsVO);
|
|
|
}
|
|
|
|
|
@@ -838,16 +842,16 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
|
|
|
// 算法配置
|
|
|
AlgorithmPO algorithmBaseInfoVo = getAlgorithmInfo(poParam);
|
|
|
- ProjectReportVO projectReportVo = new ProjectReportVO();
|
|
|
- projectReportVo.setProjectId(poParam.getProjectId());
|
|
|
- projectReportVo.setProjectName(poParam.getProjectName());
|
|
|
- projectReportVo.setAlgorithmName(algorithmBaseInfoVo.getAlgorithmName());
|
|
|
- projectReportVo.setAlgorithmDescribe(algorithmBaseInfoVo.getDescription());
|
|
|
+ ProjectReportVO projectReportVO = new ProjectReportVO();
|
|
|
+ projectReportVO.setProjectId(poParam.getProjectId());
|
|
|
+ projectReportVO.setProjectName(poParam.getProjectName());
|
|
|
+ projectReportVO.setAlgorithmName(algorithmBaseInfoVo.getAlgorithmName());
|
|
|
+ projectReportVO.setAlgorithmDescribe(algorithmBaseInfoVo.getDescription());
|
|
|
|
|
|
// 添加开始时间
|
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
if (poParam.getStartTime() != null) {
|
|
|
- projectReportVo.setStartTime(dateFormat.format(poParam.getStartTime()));
|
|
|
+ projectReportVO.setStartTime(dateFormat.format(poParam.getStartTime()));
|
|
|
}
|
|
|
|
|
|
String sceneNames;
|
|
@@ -916,37 +920,37 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
// algorithmScoreVo.setScoreRatio(saveTwoDecimalPlaces(totalScoreRatio));
|
|
|
algorithmScoreVo.setScoreRatio(NumberUtil.cut(totalScoreRatio, 2));
|
|
|
algorithmScoreVOList.add(algorithmScoreVo);
|
|
|
- projectReportVo.setScoreRatio(saveTwoDecimalPlaces(totalScoreRatio));
|
|
|
- projectReportVo.setAlgorithmScore(saveTwoDecimalPlaces(totalScore));
|
|
|
+ projectReportVO.setScoreRatio(saveTwoDecimalPlaces(totalScoreRatio));
|
|
|
+ projectReportVO.setAlgorithmScore(saveTwoDecimalPlaces(totalScore));
|
|
|
evaluationLevelReport = poParam.getEvaluationLevel();
|
|
|
if (DictConstants.EVALUATION_LEVEL_G.equals(evaluationLevelReport)) {
|
|
|
- projectReportVo.setEvaluationLevel(DictConstants.EVALUATION_LEVEL_G_DESCRIPTION);
|
|
|
- projectReportVo.setEvaluationGrade(DictConstants.EVALUATION_LEVEL_G_DESCRIPTION);
|
|
|
+ projectReportVO.setEvaluationLevel(DictConstants.EVALUATION_LEVEL_G_DESCRIPTION);
|
|
|
+ projectReportVO.setEvaluationGrade(DictConstants.EVALUATION_LEVEL_G_DESCRIPTION);
|
|
|
} else if (DictConstants.EVALUATION_LEVEL_A.equals(evaluationLevelReport)) {
|
|
|
- projectReportVo.setEvaluationLevel(DictConstants.EVALUATION_LEVEL_A_DESCRIPTION);
|
|
|
- projectReportVo.setEvaluationGrade(DictConstants.EVALUATION_LEVEL_A_DESCRIPTION);
|
|
|
+ projectReportVO.setEvaluationLevel(DictConstants.EVALUATION_LEVEL_A_DESCRIPTION);
|
|
|
+ projectReportVO.setEvaluationGrade(DictConstants.EVALUATION_LEVEL_A_DESCRIPTION);
|
|
|
} else if (DictConstants.EVALUATION_LEVEL_M.equals(evaluationLevelReport)) {
|
|
|
- projectReportVo.setEvaluationLevel(DictConstants.EVALUATION_LEVEL_M_DESCRIPTION);
|
|
|
- projectReportVo.setEvaluationGrade(DictConstants.EVALUATION_LEVEL_M_DESCRIPTION);
|
|
|
+ projectReportVO.setEvaluationLevel(DictConstants.EVALUATION_LEVEL_M_DESCRIPTION);
|
|
|
+ projectReportVO.setEvaluationGrade(DictConstants.EVALUATION_LEVEL_M_DESCRIPTION);
|
|
|
} else if (DictConstants.EVALUATION_LEVEL_P.equals(evaluationLevelReport)) {
|
|
|
- projectReportVo.setEvaluationLevel(DictConstants.EVALUATION_LEVEL_P_DESCRIPTION);
|
|
|
- projectReportVo.setEvaluationGrade(DictConstants.EVALUATION_LEVEL_P_DESCRIPTION);
|
|
|
+ projectReportVO.setEvaluationLevel(DictConstants.EVALUATION_LEVEL_P_DESCRIPTION);
|
|
|
+ projectReportVO.setEvaluationGrade(DictConstants.EVALUATION_LEVEL_P_DESCRIPTION);
|
|
|
}
|
|
|
|
|
|
sceneNames = stringBuilder.substring(0, stringBuilder.lastIndexOf("、"));
|
|
|
- projectReportVo.setAlgorithmEvaluation(algorithmBaseInfoVo.getAlgorithmName() + "经测试获得" + projectReportVo.getEvaluationLevel() + "级评价," + "(" + sceneNames + ")得分率达到了" + projectReportVo.getScoreRatio() + "%。");
|
|
|
- projectReportVo.setAlgorithmScoreList(algorithmScoreVOList);
|
|
|
+ projectReportVO.setAlgorithmEvaluation(algorithmBaseInfoVo.getAlgorithmName() + "经测试获得" + projectReportVO.getEvaluationLevel() + "级评价," + "(" + sceneNames + ")得分率达到了" + projectReportVO.getScoreRatio() + "%。");
|
|
|
+ projectReportVO.setAlgorithmScoreList(algorithmScoreVOList);
|
|
|
// 指标得分列表
|
|
|
Map<String, Object> stringObjectMap = selectScenePackageSubListAndSetScore(poParam.getScene(), poParam.getId());
|
|
|
- projectReportVo.setSubListScoreLiTitle((List<Map>) stringObjectMap.get("headerList"));
|
|
|
- projectReportVo.setSubListScoreLi((List<SubScListVo>) stringObjectMap.get("result"));
|
|
|
+ projectReportVO.setSubListScoreLiTitle((List<Map>) stringObjectMap.get("headerList"));
|
|
|
+ projectReportVO.setSubListScoreLi((List<SubScListVo>) stringObjectMap.get("result"));
|
|
|
|
|
|
// 场景得分列表
|
|
|
- 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"));
|
|
|
+ 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"));
|
|
|
|
|
|
- return new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS, projectReportVo);
|
|
|
+ return new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS, projectReportVO);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -2002,7 +2006,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
return hashMap;
|
|
|
}
|
|
|
|
|
|
- private Map<String, Object> selectSceneScore2(String scenePackageId, String projectId, String taskId, ProjectReportVO projectReportVo) {
|
|
|
+ private Map<String, Object> selectSceneScore2(String scenePackageId, String projectId, String taskId, ProjectReportVO projectReportVO) {
|
|
|
|
|
|
// 1 查询指定项目的所有指标得分结果
|
|
|
SimulationManualProjectParam query = new SimulationManualProjectParam();
|
|
@@ -2102,37 +2106,37 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
if (0 == i) {
|
|
|
String s0 = list.get(i);
|
|
|
if (StringUtil.isNotEmpty(s0)) {
|
|
|
- sceneScListVo.setEachMaxIndex((i + 1) + "");
|
|
|
+ sceneScListVo.setEachMaxIndex(String.valueOf(i + 1));
|
|
|
}
|
|
|
sceneScListVo.setSublistName1(s0);
|
|
|
} else if (1 == i) {
|
|
|
String s1 = list.get(i);
|
|
|
if (StringUtil.isNotEmpty(s1)) {
|
|
|
- sceneScListVo.setEachMaxIndex((i + 1) + "");
|
|
|
+ sceneScListVo.setEachMaxIndex(String.valueOf(i + 1));
|
|
|
}
|
|
|
sceneScListVo.setSublistName2(list.get(i));
|
|
|
} else if (2 == i) {
|
|
|
String s2 = list.get(i);
|
|
|
if (StringUtil.isNotEmpty(s2)) {
|
|
|
- sceneScListVo.setEachMaxIndex((i + 1) + "");
|
|
|
+ sceneScListVo.setEachMaxIndex(String.valueOf(i + 1));
|
|
|
}
|
|
|
sceneScListVo.setSublistName3(list.get(i));
|
|
|
} else if (3 == i) {
|
|
|
String s3 = list.get(i);
|
|
|
if (StringUtil.isNotEmpty(s3)) {
|
|
|
- sceneScListVo.setEachMaxIndex((i + 1) + "");
|
|
|
+ sceneScListVo.setEachMaxIndex(String.valueOf(i + 1));
|
|
|
}
|
|
|
sceneScListVo.setSublistName4(list.get(i));
|
|
|
} else if (4 == i) {
|
|
|
String s4 = list.get(i);
|
|
|
if (StringUtil.isNotEmpty(s4)) {
|
|
|
- sceneScListVo.setEachMaxIndex((i + 1) + "");
|
|
|
+ sceneScListVo.setEachMaxIndex(String.valueOf(i + 1));
|
|
|
}
|
|
|
sceneScListVo.setSublistName5(list.get(i));
|
|
|
} else if (5 == i) {
|
|
|
String s5 = list.get(i);
|
|
|
if (StringUtil.isNotEmpty(s5)) {
|
|
|
- sceneScListVo.setEachMaxIndex((i + 1) + "");
|
|
|
+ sceneScListVo.setEachMaxIndex(String.valueOf(i + 1));
|
|
|
}
|
|
|
sceneScListVo.setSublistName6(list.get(i));
|
|
|
}
|
|
@@ -2148,7 +2152,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
}
|
|
|
List<Map<Object, Object>> headerList = new ArrayList<>();
|
|
|
int maxIndex = size - 5;
|
|
|
- projectReportVo.setMaxIndex(maxIndex);
|
|
|
+ projectReportVO.setMaxIndex(maxIndex);
|
|
|
for (int i = 0; i < maxIndex; i++) {
|
|
|
addHeaders(i, headerList);
|
|
|
}
|
|
@@ -5013,7 +5017,6 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
/**
|
|
|
* 添加数据
|
|
|
*
|
|
|
- * @param pdfPTable
|
|
|
* @param font
|
|
|
* @param dataList
|
|
|
*/
|
|
@@ -5027,7 +5030,6 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
/**
|
|
|
* 添加数据
|
|
|
*
|
|
|
- * @param pdfPTable
|
|
|
* @param font
|
|
|
* @param dataList
|
|
|
*/
|