|
@@ -18,10 +18,7 @@ import api.common.pojo.po.model.VehiclePO;
|
|
|
import api.common.pojo.po.project.*;
|
|
|
import api.common.pojo.po.scene.ScenePackagePO;
|
|
|
import api.common.pojo.vo.project.*;
|
|
|
-import api.common.util.JsonUtil;
|
|
|
-import api.common.util.ObjectUtil;
|
|
|
-import api.common.util.StringUtil;
|
|
|
-import api.common.util.TimeUtil;
|
|
|
+import api.common.util.*;
|
|
|
import com.css.simulation.resource.algorithm.mapper.AlgorithmMapper;
|
|
|
import com.css.simulation.resource.algorithm.service.AlgorithmService;
|
|
|
import com.css.simulation.resource.common.utils.AuthUtil;
|
|
@@ -38,6 +35,7 @@ import com.css.simulation.resource.project.service.SimulationProjectService;
|
|
|
import com.css.simulation.resource.system.service.DictService;
|
|
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
+import com.google.common.collect.ImmutableMap;
|
|
|
import com.itextpdf.text.*;
|
|
|
import com.itextpdf.text.pdf.BaseFont;
|
|
|
import com.itextpdf.text.pdf.PdfPCell;
|
|
@@ -58,6 +56,7 @@ import java.io.*;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.math.RoundingMode;
|
|
|
import java.net.URLEncoder;
|
|
|
+import java.nio.charset.StandardCharsets;
|
|
|
import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.List;
|
|
@@ -339,7 +338,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
kafkaParam.setProjectId(po.getId());
|
|
|
kafkaParam.setType(DictConstants.PROJECT_TYPE_MANUAL);
|
|
|
KafkaParameter kafkaParameter = new KafkaParameter();
|
|
|
- kafkaParameter.setTopic(ProjectConstants.STOP_TASK_TOPPIC);
|
|
|
+ kafkaParameter.setTopic(ProjectConstants.STOP_TASK_TOPIC);
|
|
|
String data = JsonUtil.beanToJson(kafkaParam);
|
|
|
kafkaParameter.setData(data);
|
|
|
log.info("推送项目中止消息到kafka:" + data);
|
|
@@ -352,7 +351,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
kafkaParam.setProjectId(po.getId());
|
|
|
kafkaParam.setType(DictConstants.PROJECT_TYPE_AUTO_SUB);
|
|
|
KafkaParameter kafkaParameter = new KafkaParameter();
|
|
|
- kafkaParameter.setTopic(ProjectConstants.STOP_TASK_TOPPIC);
|
|
|
+ kafkaParameter.setTopic(ProjectConstants.STOP_TASK_TOPIC);
|
|
|
String data = JsonUtil.beanToJson(kafkaParam);
|
|
|
kafkaParameter.setData(data);
|
|
|
log.info("推送自动项目中止消息到kafka:" + data);
|
|
@@ -883,22 +882,20 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public ResponseBodyVO selectProjectTaskById(SimulationManualProjectParam param) {
|
|
|
+ public ResponseBodyVO<ProjectTaskDetailsVo> selectProjectTaskById(SimulationManualProjectParam param) {
|
|
|
String id = param.getId();
|
|
|
String taskId = param.getTaskId();
|
|
|
if (isEmpty(id) || isEmpty(taskId)) {
|
|
|
- return new ResponseBodyVO(ResponseBodyVO.Response.CLIENT_FAILURE);
|
|
|
+ return new ResponseBodyVO<>(ResponseBodyVO.Response.CLIENT_FAILURE);
|
|
|
}
|
|
|
-
|
|
|
ProjectTaskDetailsVo resultVo = new ProjectTaskDetailsVo();
|
|
|
-
|
|
|
//基本信息
|
|
|
ProjectTaskParam projectTaskParam = new ProjectTaskParam();
|
|
|
projectTaskParam.setPId(id);
|
|
|
projectTaskParam.setId(taskId);
|
|
|
List<ManualProjectTaskPo> pos = simulationProjectTaskMapper.selectprojectTaskByQuery(projectTaskParam);
|
|
|
if (isEmpty(pos)) {
|
|
|
- return new ResponseBodyVO(ResponseBodyVO.Response.SERVER_FAILURE, "没有获取到任务信息");
|
|
|
+ return new ResponseBodyVO<>(ResponseBodyVO.Response.SERVER_FAILURE, "没有获取到任务信息");
|
|
|
}
|
|
|
ManualProjectTaskPo po = pos.get(0);
|
|
|
resultVo.setTaskId(po.getId());
|
|
@@ -911,42 +908,30 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
resultVo.setRunState(po.getRunState());
|
|
|
resultVo.setFinishState(po.getRunResult());
|
|
|
resultVo.setSceneDescribe("");
|
|
|
-
|
|
|
- /*
|
|
|
- 获取任务得分详情
|
|
|
- */
|
|
|
-
|
|
|
-
|
|
|
+ // -------------------------------- 获取任务得分详情 --------------------------------
|
|
|
if (isEmpty(param.getProjectType())) {
|
|
|
param.setProjectType("1");//默认
|
|
|
}
|
|
|
-
|
|
|
//获取项目基本信息
|
|
|
//封装要使用到的数据
|
|
|
SimulationManualProjectPo poParam = new SimulationManualProjectPo();
|
|
|
-
|
|
|
if ("1".equals(param.getProjectType())) {
|
|
|
//项目基本信息
|
|
|
SimulationManualProjectPo spo = simulationProjectMapper.selectProjectBaseById(param);
|
|
|
if (spo == null) {
|
|
|
- return new ResponseBodyVO(ResponseBodyVO.Response.SERVER_FAILURE, "没有获取到数据");
|
|
|
+ return new ResponseBodyVO<>(ResponseBodyVO.Response.SERVER_FAILURE, "没有获取到数据");
|
|
|
}
|
|
|
poParam = spo;
|
|
|
} else if ("2".equals(param.getProjectType())) {
|
|
|
SimulationManualProjectVo spo = simulationAutomaticSubProjectMapper.selectProjectInfo(param);
|
|
|
if (spo == null) {
|
|
|
- return new ResponseBodyVO(ResponseBodyVO.Response.SERVER_FAILURE, "没有获取到数据");
|
|
|
+ return new ResponseBodyVO<>(ResponseBodyVO.Response.SERVER_FAILURE, "没有获取到数据");
|
|
|
}
|
|
|
-
|
|
|
BeanUtils.copyProperties(po, poParam);
|
|
|
-
|
|
|
}
|
|
|
-
|
|
|
Map<String, Object> stringObjectMap = selectSceneScore(poParam.getScene(), poParam.getId(), taskId);
|
|
|
- resultVo.setSceneScoreLiTitle((List<Map>) stringObjectMap.get("cloums"));
|
|
|
+ resultVo.setSceneScoreLiTitle((List<Map>) stringObjectMap.get("headerList"));
|
|
|
resultVo.setSceneScoreLi((List<SceneScListVo>) stringObjectMap.get("result"));
|
|
|
-
|
|
|
-
|
|
|
//1.获取仿真结果文件
|
|
|
InputStream fileInputStream = null;
|
|
|
InputStreamReader inputStreamReader = null;
|
|
@@ -992,7 +977,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
file = new File(path);
|
|
|
fileInputStream = new FileInputStream(file);*/
|
|
|
|
|
|
- inputStreamReader = new InputStreamReader(fileInputStream, "utf-8");
|
|
|
+ inputStreamReader = new InputStreamReader(fileInputStream, StandardCharsets.UTF_8);
|
|
|
|
|
|
bufferedReader = new BufferedReader(inputStreamReader);
|
|
|
String line;
|
|
@@ -1006,8 +991,8 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
|
|
|
////添加异常捕获,非正常数据默认为0
|
|
|
try {
|
|
|
- Double aDouble = Double.valueOf(split[1]);
|
|
|
- if (aDouble.isNaN()) {
|
|
|
+ double aDouble = Double.parseDouble(split[1]);
|
|
|
+ if (Double.isNaN(aDouble)) {
|
|
|
time_list.add(0D);
|
|
|
} else {
|
|
|
time_list.add(Double.valueOf(split[1]));
|
|
@@ -1018,8 +1003,8 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
|
|
|
|
|
|
try {
|
|
|
- Double aDouble = Double.valueOf(split[6]);
|
|
|
- if (aDouble.isNaN()) {
|
|
|
+ double aDouble = Double.parseDouble(split[6]);
|
|
|
+ if (Double.isNaN(aDouble)) {
|
|
|
lateral_velocity_list.add(0D);
|
|
|
} else {
|
|
|
lateral_velocity_list.add(Double.valueOf(split[6]));
|
|
@@ -1030,8 +1015,8 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
}
|
|
|
|
|
|
try {
|
|
|
- Double aDouble = Double.valueOf(split[7]);
|
|
|
- if (aDouble.isNaN()) {
|
|
|
+ double aDouble = Double.parseDouble(split[7]);
|
|
|
+ if (Double.isNaN(aDouble)) {
|
|
|
longitudinal_velocity_list.add(0D);
|
|
|
} else {
|
|
|
longitudinal_velocity_list.add(Double.valueOf(split[7]));
|
|
@@ -1042,8 +1027,8 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
|
|
|
|
|
|
try {
|
|
|
- Double aDouble = Double.valueOf(split[8]);
|
|
|
- if (aDouble.isNaN()) {
|
|
|
+ double aDouble = Double.parseDouble(split[8]);
|
|
|
+ if (Double.isNaN(aDouble)) {
|
|
|
lateral_acceleration.add(0D);
|
|
|
} else {
|
|
|
lateral_acceleration.add(Double.valueOf(split[8]));
|
|
@@ -1053,8 +1038,8 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
}
|
|
|
|
|
|
try {
|
|
|
- Double aDouble = Double.valueOf(split[9]);
|
|
|
- if (aDouble.isNaN()) {
|
|
|
+ double aDouble = Double.parseDouble(split[9]);
|
|
|
+ if (Double.isNaN(aDouble)) {
|
|
|
longitudinal_acceleration_list.add(0D);
|
|
|
} else {
|
|
|
longitudinal_acceleration_list.add(Double.valueOf(split[9]));
|
|
@@ -1064,8 +1049,8 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
}
|
|
|
|
|
|
try {
|
|
|
- Double aDouble = Double.valueOf(split[12]);
|
|
|
- if (aDouble.isNaN()) {
|
|
|
+ double aDouble = Double.parseDouble(split[12]);
|
|
|
+ if (Double.isNaN(aDouble)) {
|
|
|
steeting_wheel_list.add(0D);
|
|
|
} else {
|
|
|
steeting_wheel_list.add(Double.valueOf(split[12]));//steering_angle
|
|
@@ -1075,8 +1060,8 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
}
|
|
|
|
|
|
try {
|
|
|
- Double aDouble = Double.valueOf(split[13]);
|
|
|
- if (aDouble.isNaN()) {
|
|
|
+ double aDouble = Double.parseDouble(split[13]);
|
|
|
+ if (Double.isNaN(aDouble)) {
|
|
|
yawrate_list.add(0D);
|
|
|
} else {
|
|
|
yawrate_list.add(Double.valueOf(split[13]));
|
|
@@ -1101,7 +1086,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
|
|
|
}
|
|
|
//里程
|
|
|
- Double lc = 0D;
|
|
|
+ double lc = 0.0;
|
|
|
for (int i = 0; i < time_list.size(); i++) {
|
|
|
if (i == 0) {
|
|
|
continue;
|
|
@@ -1149,14 +1134,14 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
for (int i = 0; i < lateral_acceleration.size(); i++) {
|
|
|
Double aDouble = lateral_acceleration.get(i);
|
|
|
Double aDouble1 = longitudinal_acceleration_list.get(i);
|
|
|
- Double d = Math.pow(aDouble, 2) + Math.pow(aDouble1, 2);
|
|
|
+ double d = Math.pow(aDouble, 2) + Math.pow(aDouble1, 2);
|
|
|
acceleration_list.add(Math.sqrt(d));
|
|
|
}
|
|
|
|
|
|
for (int i = 0; i < lateral_velocity_list.size(); i++) {
|
|
|
Double aDouble = lateral_velocity_list.get(i);
|
|
|
Double aDouble1 = longitudinal_velocity_list.get(i);
|
|
|
- Double d = Math.pow(aDouble, 2) + Math.pow(aDouble1, 2);
|
|
|
+ double d = Math.pow(aDouble, 2) + Math.pow(aDouble1, 2);
|
|
|
velocity_list.add(Math.sqrt(d) * 3.6);
|
|
|
}
|
|
|
|
|
@@ -1179,7 +1164,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
}
|
|
|
|
|
|
//任务详情信息
|
|
|
- resultVo.setMileage(lc.toString());
|
|
|
+ resultVo.setMileage(Double.toString(lc));
|
|
|
resultVo.setAverageVelocity(saveTwoDecimalPlaces(pjsd * 3.6, 4).toString());
|
|
|
resultVo.setMaximunSpeed(zdsd.toString());
|
|
|
resultVo.setMinimunVelocity(zxsd.toString());
|
|
@@ -1224,12 +1209,8 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
}*/
|
|
|
} catch (IOException e) {
|
|
|
e.printStackTrace();
|
|
|
-
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS, resultVo);
|
|
|
}
|
|
|
|
|
@@ -1728,86 +1709,57 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
|
|
|
HashMap<String, Object> hashMap = new HashMap<>();
|
|
|
|
|
|
- //1.获取项目下所有场景得分
|
|
|
+ //1 获取项目下所有场景得分
|
|
|
ProjectTaskParam param = new ProjectTaskParam();
|
|
|
param.setPId(projectId);
|
|
|
if (!isEmpty(taskId)) {
|
|
|
param.setTaskId(taskId);
|
|
|
}
|
|
|
- List<ManualProjectTaskVo> manualProjectTaskVos = simulationProjectTaskMapper.selectProjectTaskByProjectId(param);
|
|
|
+ List<ManualProjectTaskVo> taskList = simulationProjectTaskMapper.selectProjectTaskByProjectId(param); // 手动运行项目和自动运行项目使用同一个任务表
|
|
|
|
|
|
+ //2 拼接场景得分信息
|
|
|
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())) {
|
|
|
+ for (ManualProjectTaskVo task : taskList)
|
|
|
+ if (task.getLastTargerId().equals(po.getId())) {
|
|
|
SublistScoreVo sublistScoreVo = new SublistScoreVo();
|
|
|
BeanUtils.copyProperties(po, sublistScoreVo);
|
|
|
- sublistScoreVo.setRunResult(sc.getRunResult());
|
|
|
-
|
|
|
- sublistScoreVo.setSceneScore(saveTwoDecimalPlaces(sc.getScore())); //得分
|
|
|
- sublistScoreVo.setTargetEvaluate(sc.getTargetEvaluate());//指标评价
|
|
|
-// sublistScoreVo.setReturnSceneId(sc.getReturnSceneId());//显示的场景id
|
|
|
- String sceneType = sc.getSceneType();
|
|
|
+ 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(sc.getSceneId());
|
|
|
- if (sceneBaseInfoVo != null) {
|
|
|
- sceneName = sceneBaseInfoVo.getNaturalName();
|
|
|
- }
|
|
|
-
|
|
|
+ SceneBaseInfoVo sceneBaseInfoVo = simulationProjectMapper.selectSceneNatural(sceneId);
|
|
|
+ sceneName = sceneBaseInfoVo.getNaturalName();
|
|
|
} else if (DictConstants.SCENE_STANDARD.equals(sceneType)) {
|
|
|
- //标准法规
|
|
|
sublistScoreVo.setSceneType("标准法规");
|
|
|
- //获取场景名称
|
|
|
- SceneBaseInfoVo sceneBaseInfoVo = simulationProjectMapper.selectSceneStandardsRegulations(sc.getSceneId());
|
|
|
- if (sceneBaseInfoVo != null) {
|
|
|
- sceneName = sceneBaseInfoVo.getSceneName();
|
|
|
- }
|
|
|
-
|
|
|
+ SceneBaseInfoVo sceneBaseInfoVo = simulationProjectMapper.selectSceneStandardsRegulations(sceneId);
|
|
|
+ sceneName = sceneBaseInfoVo.getSceneName();
|
|
|
} else if (DictConstants.SCENE_ACCIDENT.equals(sceneType)) {
|
|
|
- //交通事故
|
|
|
sublistScoreVo.setSceneType("交通事故");
|
|
|
- //获取场景名称
|
|
|
- SceneBaseInfoVo sceneBaseInfoVo = simulationProjectMapper.selectSceneAccidentById(sc.getSceneId());
|
|
|
- if (sceneBaseInfoVo != null) {
|
|
|
- sceneName = sceneBaseInfoVo.getSceneName();
|
|
|
- }
|
|
|
-
|
|
|
+ SceneBaseInfoVo sceneBaseInfoVo = simulationProjectMapper.selectSceneAccidentById(sceneId);
|
|
|
+ sceneName = sceneBaseInfoVo.getSceneName();
|
|
|
} else if (DictConstants.SCENE_GENERAL.equals(sceneType)) {
|
|
|
- /// TODO 泛化场景暂不支持
|
|
|
- //泛化
|
|
|
sublistScoreVo.setSceneType("泛化");
|
|
|
- //获取场景名称
|
|
|
- SceneBaseInfoVo sceneBaseInfoVo = simulationProjectMapper.selectSceneGeneralDataById(sc.getSceneId());
|
|
|
- if (sceneBaseInfoVo != null) {
|
|
|
- sceneName = sceneBaseInfoVo.getSceneName();
|
|
|
- }
|
|
|
-
|
|
|
+ SceneBaseInfoVo sceneBaseInfoVo = simulationProjectMapper.selectSceneGeneralDataById(sceneId);
|
|
|
+ sceneName = sceneBaseInfoVo.getSceneName();
|
|
|
}
|
|
|
- sublistScoreVo.setReturnSceneId(sceneName);//显示场景名称
|
|
|
-
|
|
|
+ sublistScoreVo.setReturnSceneId(sceneName); //显示场景名称
|
|
|
lastSubList.add(sublistScoreVo);
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
int size = 0;
|
|
|
List<List<String>> result = new ArrayList<>();
|
|
|
-
|
|
|
//获取所有指标信息
|
|
|
/* SimulationManualProjectParam q = new SimulationManualProjectParam();
|
|
|
q.setPackageId(scenePackageId);
|
|
|
List<SublistScoreVo> sbs = simulationProjectMapper.selectsublistByRootId(q);*/
|
|
|
-
|
|
|
-
|
|
|
//新增返回状态
|
|
|
ArrayList<String> runStateList = new ArrayList<>();
|
|
|
//末级指标
|
|
@@ -1815,7 +1767,6 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
setParentSub(sp, null, pos);
|
|
|
// setParentSub(sp, null, sbs);
|
|
|
String sublistName = sp.getSublistName();
|
|
|
-
|
|
|
//失败的任务没有数据,需要校验
|
|
|
Double sceneScore = sp.getSceneScore();
|
|
|
if (sceneScore == null) {
|
|
@@ -1825,31 +1776,32 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
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 + "--";
|
|
|
+ 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();
|
|
|
+ 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<>();
|
|
|
- strings.addAll(Arrays.asList(split));
|
|
|
+ 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;
|
|
@@ -1870,57 +1822,28 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
} 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<String, String>> cloums = new ArrayList<>();
|
|
|
+ List<Map<Object, Object>> headerList = new ArrayList<>();
|
|
|
for (int i = 0; i < size - 5; i++) {
|
|
|
- setCloums(i, cloums);
|
|
|
- }
|
|
|
-
|
|
|
- Map<String, String> map1 = new HashMap<>();
|
|
|
- map1.put("label", "场景名称");
|
|
|
- map1.put("prop", "sceneId");
|
|
|
- cloums.add(map1);
|
|
|
-
|
|
|
- Map<String, String> map2 = new HashMap<>();
|
|
|
- map2.put("label", "场景类型");
|
|
|
- map2.put("prop", "sceneIdType");
|
|
|
- cloums.add(map2);
|
|
|
-
|
|
|
- Map<String, String> map3 = new HashMap<>();
|
|
|
- map3.put("label", "测试得分");
|
|
|
- map3.put("prop", "sceneScore");
|
|
|
- cloums.add(map3);
|
|
|
-
|
|
|
- Map<String, String> map4 = new HashMap<>();
|
|
|
- map4.put("label", "指标评价");
|
|
|
- map4.put("prop", "targetEvaluate");
|
|
|
- cloums.add(map4);
|
|
|
-
|
|
|
- Map<String, String> map5 = new HashMap<>();
|
|
|
- map5.put("label", "得分说明");
|
|
|
- map5.put("prop", "scoreExplain");
|
|
|
- cloums.add(map5);
|
|
|
-
|
|
|
- hashMap.put("cloums", cloums);
|
|
|
+ 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.put("headerList", headerList);
|
|
|
hashMap.put("result", objects);
|
|
|
-
|
|
|
return hashMap;
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -2044,31 +1967,15 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
|
|
|
}
|
|
|
|
|
|
- List<Map<String, String>> cloums = new ArrayList<>();
|
|
|
+ List<Map<Object, Object>> headerList = new ArrayList<>();
|
|
|
for (int i = 0; i < size - 4; i++) {
|
|
|
- setCloums(i, cloums);
|
|
|
+ addHeaders(i, headerList);
|
|
|
}
|
|
|
- Map<String, String> map1 = new HashMap<>();
|
|
|
- map1.put("label", "场景数量");
|
|
|
- map1.put("prop", "sceneNum");
|
|
|
- cloums.add(map1);
|
|
|
-
|
|
|
- Map<String, String> map2 = new HashMap<>();
|
|
|
- map2.put("label", "未达标场景数量");
|
|
|
- map2.put("prop", "notStandardSceneNum");
|
|
|
- cloums.add(map2);
|
|
|
-
|
|
|
- Map<String, String> map3 = new HashMap<>();
|
|
|
- map3.put("label", "得分");
|
|
|
- map3.put("prop", "lastScore");
|
|
|
- cloums.add(map3);
|
|
|
-
|
|
|
- Map<String, String> map4 = new HashMap<>();
|
|
|
- map4.put("label", "总分");
|
|
|
- map4.put("prop", "firstScore");
|
|
|
- cloums.add(map4);
|
|
|
-
|
|
|
- hashMap.put("cloums", cloums);
|
|
|
+ headerList.add(ImmutableMap.builder().put("label", "场景数量").put("prop", "sceneNum").build());
|
|
|
+ headerList.add(ImmutableMap.builder().put("label", "未达标场景数量").put("prop", "notStandardSceneNum").build());
|
|
|
+ headerList.add(ImmutableMap.builder().put("label", "得分").put("prop", "lastScore").build());
|
|
|
+ headerList.add(ImmutableMap.builder().put("label", "总分").put("prop", "firstScore").build());
|
|
|
+ hashMap.put("header", headerList);
|
|
|
hashMap.put("result", objects);
|
|
|
|
|
|
|
|
@@ -2459,37 +2366,19 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
|
|
|
}
|
|
|
|
|
|
- private void setCloums(Integer i, List<Map<String, String>> cloums) {
|
|
|
+ private void addHeaders(Integer i, List<Map<Object, Object>> header) {
|
|
|
if (0 == i) {
|
|
|
- Map<String, String> map = new HashMap<>();
|
|
|
- map.put("label", "一级指标");
|
|
|
- map.put("prop", "sublistName1");
|
|
|
- cloums.add(map);
|
|
|
+ header.add(ImmutableMap.builder().put("label", "一级指标").put("prop", "sublistName1").build());
|
|
|
} else if (1 == i) {
|
|
|
- Map<String, String> map = new HashMap<>();
|
|
|
- map.put("label", "二级指标");
|
|
|
- map.put("prop", "sublistName2");
|
|
|
- cloums.add(map);
|
|
|
+ header.add(ImmutableMap.builder().put("label", "二级指标").put("prop", "sublistName2").build());
|
|
|
} else if (2 == i) {
|
|
|
- Map<String, String> map = new HashMap<>();
|
|
|
- map.put("label", "三级指标");
|
|
|
- map.put("prop", "sublistName3");
|
|
|
- cloums.add(map);
|
|
|
+ header.add(ImmutableMap.builder().put("label", "三级指标").put("prop", "sublistName3").build());
|
|
|
} else if (3 == i) {
|
|
|
- Map<String, String> map = new HashMap<>();
|
|
|
- map.put("label", "四级指标");
|
|
|
- map.put("prop", "sublistName4");
|
|
|
- cloums.add(map);
|
|
|
+ header.add(ImmutableMap.builder().put("label", "四级指标").put("prop", "sublistName4").build());
|
|
|
} else if (4 == i) {
|
|
|
- Map<String, String> map = new HashMap<>();
|
|
|
- map.put("label", "五级指标");
|
|
|
- map.put("prop", "sublistName5");
|
|
|
- cloums.add(map);
|
|
|
+ header.add(ImmutableMap.builder().put("label", "五级指标").put("prop", "sublistName5").build());
|
|
|
} else if (5 == i) {
|
|
|
- Map<String, String> map = new HashMap<>();
|
|
|
- map.put("label", "六级指标");
|
|
|
- map.put("prop", "sublistName6");
|
|
|
- cloums.add(map);
|
|
|
+ header.add(ImmutableMap.builder().put("label", "六级指标").put("prop", "sublistName6").build());
|
|
|
}
|
|
|
}
|
|
|
|