|
@@ -439,6 +439,17 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
projectDetailsVo.setStateList(projectRunStateNumVos);
|
|
|
projectDetailsVo.setResultList(projectRunResultRatioNumVos);
|
|
|
|
|
|
+ projectDetailsVo.setParallelism(po.getParallelism());
|
|
|
+ projectDetailsVo.setMaxSimulationTime(po.getMaxSimulationTime());
|
|
|
+ String isChoiceGpu = po.getIsChoiceGpu();
|
|
|
+ String g = "";
|
|
|
+ if("0".equals(isChoiceGpu)){
|
|
|
+ g = "是";
|
|
|
+ }else if("1".equals(isChoiceGpu)){
|
|
|
+ g = "否";
|
|
|
+ }
|
|
|
+ projectDetailsVo.setIsChoiceGpu(g);
|
|
|
+
|
|
|
return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS, projectDetailsVo);
|
|
|
}
|
|
|
|
|
@@ -562,7 +573,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
/*
|
|
|
汇总测试得分计算方法:(每一项一级指标的测试得分*测试权重)累加
|
|
|
得分率计算方法:每一项一级指标的所有场景得分不为0的数量/每一项一级指标的场景数量
|
|
|
- 汇总得分率计算方法:每一项一级指标的所有场景得分不为0的数量_累加/每一项一级指标的场景数量_累加
|
|
|
+ 汇总得分率计算方法:(每一项一级指标的所有场景得分不为0的数量_累加/每一项一级指标的场景数量_累加)换成(得分累加取平均值)
|
|
|
*/
|
|
|
List<ScenePackageSubListVO> scenePackageSubListVOS = simulationProjectMapper.selectSubSceneByPid(po.getScene());
|
|
|
|
|
@@ -612,7 +623,17 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
//指标权重总和默认是100%
|
|
|
algorithmScoreVo.setWeight("100");
|
|
|
algorithmScoreVo.setScore(saveTwoDecimalPlaces(totalScore));
|
|
|
- totalScoreRatio = Double.valueOf(totalSceneScoreNum)/Double.valueOf(totalSceneNum)*100;
|
|
|
+
|
|
|
+// 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());
|
|
|
+ }
|
|
|
+
|
|
|
algorithmScoreVo.setScoreRatio(saveTwoDecimalPlaces(totalScoreRatio));
|
|
|
algorithmScoreVoList.add(algorithmScoreVo);
|
|
|
|
|
@@ -1486,6 +1507,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
if (sc.getLastTargerId().equals(po.getId())) {
|
|
|
SublistScoreVo sublistScoreVo = new SublistScoreVo();
|
|
|
BeanUtils.copyProperties(po, sublistScoreVo);
|
|
|
+ sublistScoreVo.setRunResult(sc.getRunResult());
|
|
|
|
|
|
sublistScoreVo.setSceneScore(sc.getScore()); //得分
|
|
|
sublistScoreVo.setTargetEvaluate(sc.getTargetEvaluate());//指标评价
|
|
@@ -1533,6 +1555,9 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
|
|
|
int size = 0;
|
|
|
List<List<String>> result = new ArrayList<>();
|
|
|
+
|
|
|
+ //新增返回状态
|
|
|
+ ArrayList<String> runStateList = new ArrayList<>();
|
|
|
//末级指标
|
|
|
for(SublistScoreVo sp : lastSubList){
|
|
|
setParentSub(sp, null, pos);
|
|
@@ -1548,11 +1573,12 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
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();
|
|
@@ -1579,7 +1605,10 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
sceneScListVo.setTargetEvaluate(list.get(start+3));
|
|
|
sceneScListVo.setScoreExplain(list.get(start+4));
|
|
|
|
|
|
+ sceneScListVo.setRunState(runStateList.get(r));
|
|
|
+
|
|
|
objects.add(sceneScListVo);
|
|
|
+ r ++;
|
|
|
}
|
|
|
|
|
|
List<Map<String, String>> cloums = new ArrayList<>();
|
|
@@ -2317,7 +2346,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
//表头
|
|
|
PdfPTable pdfPTable = new PdfPTable(5);
|
|
|
pdfPTable.setHeaderRows(1);//换页每页显示表头
|
|
|
- addTitleList(pdfPTable, font, new String[]{"测试项目","场景数量","测试权重(%)","测试得分","得分率"});
|
|
|
+ addTitleList(pdfPTable, font, new String[]{"测试项目","场景数量","测试权重(%)","测试得分","得分率(%)"});
|
|
|
|
|
|
//数据
|
|
|
List<AlgorithmScoreVo> algorithmScoreList = vo.getAlgorithmScoreList();
|
|
@@ -3466,9 +3495,39 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
return new ResponseBodyVO(ResponseBodyVO.Response.CLIENT_FAILURE,"工作名称不能为空");
|
|
|
}
|
|
|
|
|
|
+ SimulationAutomaticProjectPo po = convertToSimulationAutomaticProjectPo(param);
|
|
|
+
|
|
|
+ if(isEmpty(param.getId())){
|
|
|
+ //工作名称一样的的不能创建
|
|
|
+ List<SimulationManualProjectPo> simulationManualProjectPos = simulationProjectMapper.selectProjectByName(param);
|
|
|
+ if(!isEmpty(simulationManualProjectPos)){
|
|
|
+ return new ResponseBodyVO(ResponseBodyVO.Response.CLIENT_FAILURE,"工作名称已经存在,请修改后再保存");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
+ private SimulationAutomaticProjectPo convertToSimulationAutomaticProjectPo(SimulationManualProjectParam param){
|
|
|
+ SimulationAutomaticProjectPo po = new SimulationAutomaticProjectPo();
|
|
|
+ po.setId(param.getId());
|
|
|
+ po.setProjectName(param.getProjectName());
|
|
|
+ po.setProjectDescribe(param.getProjectDescribe());
|
|
|
+ po.setAlgorithm(param.getAlgorithm());
|
|
|
+ po.setVehicle(param.getVehicle());
|
|
|
+ po.setScene(param.getScene());
|
|
|
+ po.setOperationCycle(param.getOperationCycle());
|
|
|
+ po.setMaxSimulationTime(param.getMaxSimulationTime());
|
|
|
+ po.setParallelism(param.getParallelism());
|
|
|
+ po.setRuleView(param.getRuleView());
|
|
|
+ po.setIsChoiceGpu(param.getIsChoiceGpu());
|
|
|
+ po.setNowRunState(param.getNowRunState());
|
|
|
+ po.setAlgorithmType(param.getAlgorithmType());
|
|
|
+ return po;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 换行
|
|
|
* @param lineNum 换行数量
|