|
@@ -705,53 +705,28 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
|
|
|
|
|
|
@Override
|
|
|
- public ResponseBodyVO selectProjectReportById(SimulationManualProjectParam param) {
|
|
|
- if (isEmpty(param.getId())) {
|
|
|
- return new ResponseBodyVO(ResponseBodyVO.Response.CLIENT_FAILURE);
|
|
|
- }
|
|
|
-
|
|
|
- if (isEmpty(param.getProjectType())) {
|
|
|
- param.setProjectType("1");//默认
|
|
|
- }
|
|
|
-
|
|
|
+ public ResponseBodyVO<ProjectReportVo> selectProjectReportById(SimulationManualProjectParam param) {
|
|
|
+ String id = param.getId();
|
|
|
+ String projectType = param.getProjectType();
|
|
|
//封装要使用到的数据
|
|
|
SimulationManualProjectPo poParam = new SimulationManualProjectPo();
|
|
|
|
|
|
- if ("1".equals(param.getProjectType())) {
|
|
|
+ if (DictConstants.PROJECT_TYPE_MANUAL.equals(projectType)) {
|
|
|
//项目基本信息
|
|
|
- SimulationManualProjectPo po = simulationProjectMapper.selectProjectBaseById(param);
|
|
|
- if (po == null) {
|
|
|
- return new ResponseBodyVO(ResponseBodyVO.Response.SERVER_FAILURE, "没有获取到数据");
|
|
|
- }
|
|
|
- poParam = po;
|
|
|
- } else if ("2".equals(param.getProjectType())) {
|
|
|
+ poParam = simulationProjectMapper.selectProjectBaseById(param);
|
|
|
+ } else if (DictConstants.PROJECT_TYPE_AUTO_SUB.equals(projectType)) {
|
|
|
SimulationManualProjectVo po = simulationAutomaticSubProjectMapper.selectProjectInfo(param);
|
|
|
- if (po == null) {
|
|
|
- return new ResponseBodyVO(ResponseBodyVO.Response.SERVER_FAILURE, "没有获取到数据");
|
|
|
- }
|
|
|
-
|
|
|
BeanUtils.copyProperties(po, poParam);
|
|
|
-
|
|
|
}
|
|
|
|
|
|
|
|
|
//算法配置
|
|
|
AlgorithmPO algorithmBaseInfoVo = getAlgorithmInfo(poParam);
|
|
|
-
|
|
|
ProjectReportVo projectReportVo = new ProjectReportVo();
|
|
|
-
|
|
|
projectReportVo.setProjectId(poParam.getProjectId());
|
|
|
projectReportVo.setProjectName(poParam.getProjectName());
|
|
|
-
|
|
|
projectReportVo.setAlgorithmName(algorithmBaseInfoVo.getAlgorithmName());
|
|
|
-// Double algorithmScore = po.getAlgorithmScore();
|
|
|
-// projectReportVo.setAlgorithmScore(algorithmScore);
|
|
|
projectReportVo.setAlgorithmDescribe(algorithmBaseInfoVo.getDescription());
|
|
|
-
|
|
|
-// String evaluationLevelReport = getEvaluationLevelReport(algorithmScore);
|
|
|
-// projectReportVo.setEvaluationLevel(evaluationLevelReport);
|
|
|
-
|
|
|
-
|
|
|
String sceneNames = "";
|
|
|
|
|
|
//算法测试得分表
|
|
@@ -766,121 +741,84 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
par.setPId(poParam.getId());
|
|
|
List<SimulationMptFirstTargetScorePo> pos = simulationMptFirstTargetScoreMapper.selectFirstTargetByPid(par);
|
|
|
|
|
|
-// List<ScenePackageSubListVO> scenePackageSubListVOS = simulationProjectMapper.selectSubSceneByPid(poParam.getScene());
|
|
|
-
|
|
|
- List<AlgorithmScoreVo> algorithmScoreVoList = new ArrayList();
|
|
|
+ List<AlgorithmScoreVo> algorithmScoreVoList = new ArrayList<>();
|
|
|
String evaluationLevelReport = "";
|
|
|
-// if(!isEmpty(scenePackageSubListVOS)){
|
|
|
- if (!isEmpty(pos)) {
|
|
|
- StringBuffer stringBuffer = new StringBuffer("");
|
|
|
-
|
|
|
- //汇总数据初始化
|
|
|
- Integer totalSceneNum = 0;
|
|
|
-// Double totalWeight = 0D;
|
|
|
- Double totalScore = 0D;
|
|
|
- Double totalScoreRatio = 0D;
|
|
|
- Integer totalSceneScoreNum = 0;
|
|
|
-
|
|
|
-// for(ScenePackageSubListVO v : scenePackageSubListVOS){
|
|
|
- for (SimulationMptFirstTargetScorePo v : pos) {
|
|
|
|
|
|
- //获取指标信息
|
|
|
-// ScenePackageSubListVO svo = simulationProjectMapper.selectsublistBySublistId(v.getTarget());
|
|
|
+ StringBuilder stringBuilder = new StringBuilder();
|
|
|
|
|
|
+ //汇总数据初始化
|
|
|
+ Integer totalSceneNum = 0;
|
|
|
+ double totalScore = 0D;
|
|
|
+ double totalScoreRatio = 0D;
|
|
|
+ Integer totalSceneScoreNum = 0;
|
|
|
|
|
|
- stringBuffer.append(v.getSublistName() + "、");
|
|
|
-// stringBuffer.append(svo.getSublistName()+"、");
|
|
|
- AlgorithmScoreVo algorithmScoreVo = new AlgorithmScoreVo();
|
|
|
- algorithmScoreVo.setProjectName(v.getSublistName());
|
|
|
-// algorithmScoreVo.setProjectName(svo.getSublistName());
|
|
|
- Integer sceneNum = v.getSceneNum();
|
|
|
-// Integer sceneNum = svo.getSceneNum();
|
|
|
- totalSceneNum += sceneNum;
|
|
|
- algorithmScoreVo.setSceneNum(sceneNum);
|
|
|
- String weight = v.getWeight();
|
|
|
-// String weight = svo.getWeight();
|
|
|
- Double weightDouble = Double.valueOf(weight);
|
|
|
- algorithmScoreVo.setWeight(weight);
|
|
|
- /*SimulationMptFirstTargetScorePo simulationMptFirstTargetScorePo = new SimulationMptFirstTargetScorePo();
|
|
|
- simulationMptFirstTargetScorePo.setPId(poParam.getId());
|
|
|
- simulationMptFirstTargetScorePo.setTarget(v.getSublistId());*/
|
|
|
- //单个二级指标得分
|
|
|
-// SimulationMptFirstTargetScorePo simulationMptFirstTargetScorePo1 = simulationMptFirstTargetScoreMapper.selectFirstTargetScore(simulationMptFirstTargetScorePo);
|
|
|
-// Double score = simulationMptFirstTargetScorePo1.getScore();
|
|
|
- Double score = v.getScore();
|
|
|
- totalScore += BigDecimal.valueOf(score).multiply(BigDecimal.valueOf(weightDouble).divide(BigDecimal.valueOf(100))).doubleValue();
|
|
|
-// totalScore += score*(weightDouble/100);
|
|
|
- algorithmScoreVo.setScore(saveTwoDecimalPlaces(score));
|
|
|
-// totalWeight +=aDouble;
|
|
|
-// Integer num = v.getSceneNum();
|
|
|
- //获取得分不为0的场景数量
|
|
|
- Integer scoreNum = getSetScoreNum(v.getSublistId(), poParam.getId());
|
|
|
-// Integer scoreNum = getSetScoreNum(svo.getSublistId(),poParam.getId());
|
|
|
- totalSceneScoreNum += scoreNum;
|
|
|
- algorithmScoreVo.setScoreRatio(saveTwoDecimalPlaces(Double.valueOf(scoreNum) / Double.valueOf(sceneNum) * 100));
|
|
|
- algorithmScoreVoList.add(algorithmScoreVo);
|
|
|
|
|
|
- totalScoreRatio += Double.valueOf(scoreNum) / Double.valueOf(sceneNum) * 100;
|
|
|
- }
|
|
|
- //汇总
|
|
|
+ for (SimulationMptFirstTargetScorePo v : pos) {
|
|
|
+ //获取指标信息
|
|
|
+ stringBuilder.append(v.getSublistName()).append("、");
|
|
|
AlgorithmScoreVo algorithmScoreVo = new AlgorithmScoreVo();
|
|
|
- algorithmScoreVo.setProjectName("汇总");
|
|
|
- algorithmScoreVo.setSceneNum(totalSceneNum);
|
|
|
-// algorithmScoreVo.setWeight(saveTwoDecimalPlaces(totalWeight).toString());
|
|
|
- //指标权重总和默认是100%
|
|
|
- algorithmScoreVo.setWeight("100");
|
|
|
- algorithmScoreVo.setScore(saveTwoDecimalPlaces(totalScore));
|
|
|
-
|
|
|
- totalScoreRatio = Double.valueOf(totalSceneScoreNum) / Double.valueOf(totalSceneNum) * 100;
|
|
|
- //汇总得分率计算方式修改
|
|
|
- Double d = 0D;
|
|
|
- if (!isEmpty(algorithmScoreVoList)) {
|
|
|
- /*for(AlgorithmScoreVo a : algorithmScoreVoList){
|
|
|
- d +=a.getScoreRatio();
|
|
|
- }
|
|
|
- totalScoreRatio = saveTwoDecimalPlaces(d/algorithmScoreVoList.size());*/
|
|
|
-// totalScoreRatio = saveTwoDecimalPlaces(totalScoreRatio/algorithmScoreVoList.size());
|
|
|
- }
|
|
|
-
|
|
|
- algorithmScoreVo.setScoreRatio(saveTwoDecimalPlaces(totalScoreRatio));
|
|
|
+ algorithmScoreVo.setProjectName(v.getSublistName());
|
|
|
+ Integer sceneNum = v.getSceneNum();
|
|
|
+ totalSceneNum += sceneNum;
|
|
|
+ algorithmScoreVo.setSceneNum(sceneNum);
|
|
|
+ String weight = v.getWeight();
|
|
|
+ double weightDouble = Double.parseDouble(weight);
|
|
|
+ algorithmScoreVo.setWeight(weight);
|
|
|
+ //单个二级指标得分
|
|
|
+ Double score = v.getScore();
|
|
|
+ totalScore += BigDecimal.valueOf(score).multiply(BigDecimal.valueOf(weightDouble).divide(BigDecimal.valueOf(100))).doubleValue();
|
|
|
+ algorithmScoreVo.setScore(saveTwoDecimalPlaces(score));
|
|
|
+ //获取得分不为0的场景数量
|
|
|
+ Integer scoreNum = getSetScoreNum(v.getSublistId(), poParam.getId());
|
|
|
+ totalSceneScoreNum += scoreNum;
|
|
|
+ algorithmScoreVo.setScoreRatio(saveTwoDecimalPlaces(Double.valueOf(scoreNum) / Double.valueOf(sceneNum) * 100));
|
|
|
algorithmScoreVoList.add(algorithmScoreVo);
|
|
|
|
|
|
- projectReportVo.setScoreRatio(saveTwoDecimalPlaces(totalScoreRatio));
|
|
|
-
|
|
|
- projectReportVo.setAlgorithmScore(saveTwoDecimalPlaces(totalScore));
|
|
|
-// evaluationLevelReport = getEvaluationLevelReport(saveTwoDecimalPlaces(totalScore));
|
|
|
- evaluationLevelReport = poParam.getEvaluationLevel();
|
|
|
- projectReportVo.setEvaluationLevel(evaluationLevelReport);
|
|
|
-
|
|
|
- sceneNames = stringBuffer.substring(0, stringBuffer.lastIndexOf("、"));
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- projectReportVo.setAlgorithmEvaluation(algorithmBaseInfoVo.getAlgorithmName() + "经测试获得" + evaluationLevelReport + "级评价," +
|
|
|
- "(" + sceneNames + ")得分率达到了" + projectReportVo.getScoreRatio() + "%。");
|
|
|
-
|
|
|
+ totalScoreRatio += Double.valueOf(scoreNum) / Double.valueOf(sceneNum) * 100;
|
|
|
+ }
|
|
|
+ // 汇总
|
|
|
+ AlgorithmScoreVo algorithmScoreVo = new AlgorithmScoreVo();
|
|
|
+ algorithmScoreVo.setProjectName("汇总");
|
|
|
+ algorithmScoreVo.setSceneNum(totalSceneNum);
|
|
|
+ // 指标权重总和默认是100%
|
|
|
+ algorithmScoreVo.setWeight("100");
|
|
|
+ algorithmScoreVo.setScore(saveTwoDecimalPlaces(totalScore));
|
|
|
+
|
|
|
+ totalScoreRatio = Double.valueOf(totalSceneScoreNum) / Double.valueOf(totalSceneNum) * 100;
|
|
|
+ // 汇总得分率计算方式修改
|
|
|
+ algorithmScoreVo.setScoreRatio(saveTwoDecimalPlaces(totalScoreRatio));
|
|
|
+ algorithmScoreVoList.add(algorithmScoreVo);
|
|
|
+ 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);
|
|
|
+ } else if (DictConstants.EVALUATION_LEVEL_A.equals(evaluationLevelReport)) {
|
|
|
+ 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);
|
|
|
+ } else if (DictConstants.EVALUATION_LEVEL_P.equals(evaluationLevelReport)) {
|
|
|
+ projectReportVo.setEvaluationLevel(DictConstants.EVALUATION_LEVEL_P_DESCRIPTION);
|
|
|
+ projectReportVo.setEvaluationGrade(DictConstants.EVALUATION_LEVEL_P_DESCRIPTION);
|
|
|
+ }
|
|
|
+
|
|
|
+ sceneNames = stringBuilder.substring(0, stringBuilder.lastIndexOf("、"));
|
|
|
+ projectReportVo.setAlgorithmEvaluation(algorithmBaseInfoVo.getAlgorithmName() + "经测试获得" + evaluationLevelReport + "级评价," + "(" + sceneNames + ")得分率达到了" + projectReportVo.getScoreRatio() + "%。");
|
|
|
projectReportVo.setAlgorithmScoreList(algorithmScoreVoList);
|
|
|
- projectReportVo.setEvaluationGrade(evaluationLevelReport);
|
|
|
-
|
|
|
- //算法测试评分细则、详细得分情况
|
|
|
- /*List<ScenePackageSubListVO> scenePackageSubListVOS1 = selectScenePackageSubListTreeAndSetScore(null, true, po.getScene(), po.getId(), 2);
|
|
|
- projectReportVo.setSceneScoreList(scenePackageSubListVOS1);*/
|
|
|
-
|
|
|
- //查询场景包所有数据
|
|
|
-// List<SublistScoreVo> pos = simulationProjectMapper.selectSubScore(po.getScene());
|
|
|
-
|
|
|
//指标得分列表
|
|
|
Map<String, Object> stringObjectMap = selectScenePackageSubListAndSetScore(poParam.getScene(), poParam.getId());
|
|
|
projectReportVo.setSubListScoreLiTitle((List<Map>) stringObjectMap.get("headerList"));
|
|
|
projectReportVo.setSubListScoreLi((List<SubScListVo>) stringObjectMap.get("result"));
|
|
|
|
|
|
//场景得分列表
|
|
|
-// Map<String, Object> maps = selectSceneScore(pos, po.getId());
|
|
|
Map<String, Object> maps = selectSceneScore(poParam.getScene(), poParam.getId(), null);
|
|
|
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);
|
|
|
}
|
|
|
|
|
|
private AlgorithmPO getAlgorithmInfo(SimulationManualProjectPo po) {
|