|
@@ -20,6 +20,7 @@ import api.common.pojo.po.scene.ScenePackagePO;
|
|
|
import api.common.pojo.vo.project.*;
|
|
|
import api.common.pojo.vo.scene.RunProjectVO;
|
|
|
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;
|
|
|
import com.css.simulation.resource.common.utils.PageUtil;
|
|
@@ -45,20 +46,17 @@ import lombok.SneakyThrows;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.http.server.ServletServerHttpRequest;
|
|
|
import org.springframework.scheduling.support.CronExpression;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.web.context.request.RequestContextHolder;
|
|
|
import org.springframework.web.context.request.ServletRequestAttributes;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
-import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.io.*;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.math.RoundingMode;
|
|
|
import java.net.URLEncoder;
|
|
|
-import java.nio.file.Files;
|
|
|
import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
@@ -88,6 +86,9 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
@Autowired
|
|
|
private SimulationMptLastTargetScoreMapper simulationMptLastTargetScoreMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private AlgorithmMapper algorithmMapper;
|
|
|
+
|
|
|
@Resource
|
|
|
private KafkaService kafkaService;
|
|
|
|
|
@@ -392,7 +393,10 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ //获取场景包信息
|
|
|
+ ScenePackagePO scenePackagePO = simulationProjectMapper.selectScenePackageInfoById(poParam.getScene());
|
|
|
|
|
|
+ projectDetailsVo.setPackageName(scenePackagePO.getPackageName());
|
|
|
|
|
|
//评测等级
|
|
|
String s = getEvaluationLevel(poParam);
|
|
@@ -400,6 +404,11 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
//算法配置
|
|
|
AlgorithmPO algorithmBaseInfoVo = getAlgorithmInfo(poParam);
|
|
|
|
|
|
+
|
|
|
+ //获取测试得分列表
|
|
|
+ List<AlgorithmScoreVo> firstTargetScore = getFirstTargetScore(param.getId());
|
|
|
+ projectDetailsVo.setAlgorithmScoreList(firstTargetScore);
|
|
|
+
|
|
|
//车辆配置
|
|
|
VehiclePO vehicleBaseInfoVo = null;
|
|
|
String vehicleConfigId = poParam.getVehicle();
|
|
@@ -465,15 +474,21 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
|
|
|
//任务运行状态统计
|
|
|
List<ProjectRunStateNumVo> projectRunStateNumVos = null;
|
|
|
+
|
|
|
+ //任务运行结果统计
|
|
|
+ List<ProjectRunResultRatioNumVo> resultScoreList = null;
|
|
|
+
|
|
|
Integer size = simulationProjectTaskMapper.selectProjectTaskNumByProjectId(projectTaskParam);
|
|
|
if(size > 0){
|
|
|
projectRunStateNumVos = simulationProjectTaskMapper.selectRunStateCount(poParam.getId());
|
|
|
taskRunState(projectRunStateNumVos, size);
|
|
|
|
|
|
-
|
|
|
projectRunResultRatioNumVos = simulationProjectTaskMapper.selectRunResultCount(poParam.getId());
|
|
|
taskResultState(projectRunResultRatioNumVos, size);
|
|
|
|
|
|
+ resultScoreList = simulationProjectTaskMapper.selectScoreCount(poParam.getId());
|
|
|
+ taskScore(resultScoreList,size);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
projectDetailsVo.setProjectId(poParam.getProjectId());
|
|
@@ -502,6 +517,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
projectDetailsVo.setSensorGpsList(sensorGpsList);
|
|
|
projectDetailsVo.setStateList(projectRunStateNumVos);
|
|
|
projectDetailsVo.setResultList(projectRunResultRatioNumVos);
|
|
|
+ projectDetailsVo.setResultScoreList(resultScoreList);
|
|
|
|
|
|
projectDetailsVo.setParallelism(poParam.getParallelism());
|
|
|
projectDetailsVo.setMaxSimulationTime(poParam.getMaxSimulationTime());
|
|
@@ -592,6 +608,18 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 得分统计
|
|
|
+ */
|
|
|
+ private void taskScore(List<ProjectRunResultRatioNumVo> vos,Integer size){
|
|
|
+ for(ProjectRunResultRatioNumVo rv : vos){
|
|
|
+ Integer num = rv.getNum();
|
|
|
+ Double d = (double)num/size;
|
|
|
+ d = saveTwoDecimalPlaces(d);
|
|
|
+ rv.setRatio(d);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private void setVehicleConfig(SensorBaseInfoVo vo, ConfigSensorPO vs){
|
|
|
vo.setConfigId(vs.getConfigId());
|
|
|
vo.setSensorId(vs.getSensorId());
|
|
@@ -750,7 +778,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
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)){
|
|
@@ -758,7 +786,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
d +=a.getScoreRatio();
|
|
|
}
|
|
|
totalScoreRatio = saveTwoDecimalPlaces(d/algorithmScoreVoList.size());*/
|
|
|
- totalScoreRatio = saveTwoDecimalPlaces(totalScoreRatio/algorithmScoreVoList.size());
|
|
|
+// totalScoreRatio = saveTwoDecimalPlaces(totalScoreRatio/algorithmScoreVoList.size());
|
|
|
}
|
|
|
|
|
|
algorithmScoreVo.setScoreRatio(saveTwoDecimalPlaces(totalScoreRatio));
|
|
@@ -767,7 +795,8 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
projectReportVo.setScoreRatio(saveTwoDecimalPlaces(totalScoreRatio));
|
|
|
|
|
|
projectReportVo.setAlgorithmScore(saveTwoDecimalPlaces(totalScore));
|
|
|
- evaluationLevelReport = getEvaluationLevelReport(saveTwoDecimalPlaces(totalScore));
|
|
|
+// evaluationLevelReport = getEvaluationLevelReport(saveTwoDecimalPlaces(totalScore));
|
|
|
+ evaluationLevelReport = poParam.getEvaluationLevel();
|
|
|
projectReportVo.setEvaluationLevel(evaluationLevelReport);
|
|
|
|
|
|
sceneNames = stringBuffer.substring(0,stringBuffer.lastIndexOf("、"));
|
|
@@ -795,7 +824,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
|
|
|
//场景得分列表
|
|
|
// Map<String, Object> maps = selectSceneScore(pos, po.getId());
|
|
|
- Map<String, Object> maps = selectSceneScore(poParam.getScene(), poParam.getId());
|
|
|
+ Map<String, Object> maps = selectSceneScore(poParam.getScene(), poParam.getId(), null);
|
|
|
projectReportVo.setSceneScoreLiTitle((List<Map>) maps.get("cloums"));
|
|
|
projectReportVo.setSceneScoreLi((List<SceneScListVo>) maps.get("result"));
|
|
|
|
|
@@ -878,6 +907,40 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
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, "没有获取到数据");
|
|
|
+ }
|
|
|
+ poParam = spo;
|
|
|
+ }else if("2".equals(param.getProjectType())){
|
|
|
+ SimulationManualProjectVo spo = simulationAutomaticSubProjectMapper.selectProjectInfo(param);
|
|
|
+ if(spo == null){
|
|
|
+ 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.setSceneScoreLi((List<SceneScListVo>) stringObjectMap.get("result"));
|
|
|
+
|
|
|
|
|
|
//1.获取仿真结果文件
|
|
|
InputStream fileInputStream = null;
|
|
@@ -1089,7 +1152,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
Double aDouble = lateral_velocity_list.get(i);
|
|
|
Double aDouble1 = longitudinal_velocity_list.get(i);
|
|
|
Double d = Math.pow(aDouble,2)+Math.pow(aDouble1,2);
|
|
|
- velocity_list.add(Math.sqrt(d));
|
|
|
+ velocity_list.add(Math.sqrt(d)*3.6);
|
|
|
}
|
|
|
|
|
|
//获取视频预览路径
|
|
@@ -1112,7 +1175,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
|
|
|
//任务详情信息
|
|
|
resultVo.setMileage(lc.toString());
|
|
|
- resultVo.setAverageVelocity(pjsd.toString());
|
|
|
+ resultVo.setAverageVelocity(saveTwoDecimalPlaces(pjsd*3.6, 4).toString());
|
|
|
resultVo.setMaximunSpeed(zdsd.toString());
|
|
|
resultVo.setMinimunVelocity(zxsd.toString());
|
|
|
resultVo.setMaximumAcceleration(zdjiasd.toString());
|
|
@@ -1133,7 +1196,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
CurveData.put("steeting",steeting_wheel_list);
|
|
|
CurveData.put("throttle",throttle_list);
|
|
|
CurveData.put("yaw_rate",yawrate_list);
|
|
|
- CurveData.put("velocity",velocity_list);
|
|
|
+ CurveData.put("velocity",velocity_list); //速度变化曲线
|
|
|
resultVo.setCurveData(CurveData);
|
|
|
|
|
|
|
|
@@ -1280,7 +1343,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
|
|
|
List<DropDownVo> algorithmList = new ArrayList<>();
|
|
|
|
|
|
- if(ProjectConstants.SY_ALGORITHM_TYPE.equals(algorithmType)){
|
|
|
+ if(DictConstants.PLATFORM.equals(algorithmType)){
|
|
|
//第三方算法平台获取(索为)
|
|
|
String sort = "algorithmId-desc";
|
|
|
Integer page = 1;
|
|
@@ -1635,7 +1698,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
}
|
|
|
|
|
|
|
|
|
- private Map<String, Object> selectSceneScore(String scenePackageId, String projectId) {
|
|
|
+ private Map<String, Object> selectSceneScore(String scenePackageId, String projectId, String taskId) {
|
|
|
|
|
|
//查询场景包所有数据(包括得分信息)
|
|
|
SimulationManualProjectParam query = new SimulationManualProjectParam();
|
|
@@ -1649,6 +1712,9 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
//1.获取项目下所有场景得分
|
|
|
ProjectTaskParam param = new ProjectTaskParam();
|
|
|
param.setPId(projectId);
|
|
|
+ if(!isEmpty(taskId)){
|
|
|
+ param.setTaskId(taskId);
|
|
|
+ }
|
|
|
List<ManualProjectTaskVo> manualProjectTaskVos = simulationProjectTaskMapper.selectProjectTaskByProjectId(param);
|
|
|
|
|
|
List<SublistScoreVo> lastSubList = new ArrayList<>();
|
|
@@ -3788,51 +3854,32 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
int i = simulationAutomaticProjectMapper.updateAutomaticRunState(param);
|
|
|
if(i > 0){
|
|
|
SimulationAutomaticProjectPo po = simulationAutomaticProjectMapper.selectById(id);
|
|
|
- String algorithm = po.getAlgorithm();
|
|
|
+ String algorithmId = po.getAlgorithm();
|
|
|
if("0".equals(param.getAutomaticRunState())){
|
|
|
//启动
|
|
|
//检查算法版本
|
|
|
- AlgorithmPO algorithmParam = new AlgorithmPO();
|
|
|
- algorithmParam.setId(algorithm);
|
|
|
- AlgorithmPO aPo = simulationAutomaticProjectMapper.getAlgorithmGitVersion(algorithmParam);
|
|
|
+ //获取数据库中的算法版本
|
|
|
+ AlgorithmPO aPo = algorithmMapper.selectDetailsById(algorithmId);
|
|
|
String gitVersion = aPo.getGitVersion();
|
|
|
+ //获取当前算法版本
|
|
|
+ String currentGitVersion = algorithmService.getGitVersion(algorithmId);
|
|
|
|
|
|
- AlgorithmParameter algorithmParameter = new AlgorithmParameter();
|
|
|
- algorithmParameter.setId(algorithm);
|
|
|
+ boolean isRun = false; //判断是否启动运行
|
|
|
//首次获取版本
|
|
|
if(StringUtil.isEmpty(gitVersion)){
|
|
|
-
|
|
|
- //更新版本
|
|
|
- updateAlgorithm(algorithmParameter,algorithmParam);
|
|
|
-
|
|
|
- //添加一条子工作信息并推送消息到kafka ,执行项目
|
|
|
- createAutomaticSubProject(param);
|
|
|
-
|
|
|
- //推送定时请求,启动运行周期
|
|
|
- projectTaskStart(po);
|
|
|
-
|
|
|
+ isRun = true;
|
|
|
}else{
|
|
|
//非首次,比对版本,校验是否执行任务
|
|
|
- String algorithmGitVersion = getAlgorithmGitVersion(algorithmParameter);
|
|
|
- if(algorithmGitVersion == null){
|
|
|
- throw new RuntimeException("------- 获取git算法版本信息失败");
|
|
|
- }
|
|
|
-
|
|
|
- if(!gitVersion.equals(algorithmGitVersion)){
|
|
|
-
|
|
|
- updateAlgorithmVersion(algorithmGitVersion, algorithmParam);
|
|
|
-
|
|
|
- //添加一条子工作信息并推送消息到kafka ,执行项目
|
|
|
- createAutomaticSubProject(param);
|
|
|
-
|
|
|
- //推送定时请求,启动运行周期
|
|
|
- projectTaskStart(po);
|
|
|
-
|
|
|
+ if(!gitVersion.equals(currentGitVersion)){
|
|
|
+ isRun = true;
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+ if(isRun){ //启动运行
|
|
|
+ AlgorithmParameter algorithmParam = new AlgorithmParameter();
|
|
|
+ algorithmParam.setId(algorithmId);
|
|
|
+ algorithmParam.setGitVersion(currentGitVersion);
|
|
|
+ runProject(algorithmParam, param, po);
|
|
|
+ }
|
|
|
}else if("1".equals(param.getAutomaticRunState())){
|
|
|
//停止
|
|
|
//推送定时请求
|
|
@@ -3857,41 +3904,20 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS);*/
|
|
|
}
|
|
|
|
|
|
- private void updateAlgorithm(AlgorithmParameter algorithmParameter, AlgorithmPO algorithmParam){
|
|
|
-
|
|
|
- String gitVersion = getAlgorithmGitVersion(algorithmParameter);
|
|
|
- if(gitVersion == null){
|
|
|
- throw new RuntimeException("------- 获取git算法版本信息失败");
|
|
|
- }
|
|
|
|
|
|
- updateAlgorithmVersion(gitVersion, algorithmParam);
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- private void updateAlgorithmVersion(String gitVersion, AlgorithmPO algorithmParam){
|
|
|
+ private void runProject(AlgorithmParameter algorithmParam, SimulationManualProjectParam simulationManualProjectParam, SimulationAutomaticProjectPo simulationAutomaticProjectPo){
|
|
|
|
|
|
//更新算法版本
|
|
|
- algorithmParam.setGitVersion(gitVersion);
|
|
|
simulationAutomaticProjectMapper.updateAlgorithmGitVersion(algorithmParam);
|
|
|
|
|
|
- }
|
|
|
+ //添加一条子工作信息并推送消息到kafka ,执行项目
|
|
|
+ createAutomaticSubProject(simulationManualProjectParam);
|
|
|
|
|
|
- private String getAlgorithmGitVersion(AlgorithmParameter algorithmParameter){
|
|
|
- try {
|
|
|
- ResponseBodyVO gitVersion = algorithmService.getGitVersion(algorithmParameter);
|
|
|
- if(200 == gitVersion.getCode()){
|
|
|
- return gitVersion.getInfo().toString();
|
|
|
- }else{
|
|
|
- return null;
|
|
|
- }
|
|
|
- }catch (Exception e){
|
|
|
- throw new RuntimeException("------- 请求错误:" + e.toString());
|
|
|
- }
|
|
|
+ //推送定时请求,启动运行周期
|
|
|
+ projectTaskStart(simulationAutomaticProjectPo);
|
|
|
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
@Override
|
|
|
public ResponseBodyVO selectAutomaticProject(SimulationManualProjectParam param) {
|
|
|
|
|
@@ -4221,11 +4247,11 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
|
|
|
|
|
|
private void insertOtherAlgorithm(SimulationManualProjectParam param){
|
|
|
- if(ProjectConstants.SY_ALGORITHM_TYPE.equals(param.getAlgorithmType())){
|
|
|
+ if(DictConstants.PLATFORM.equals(param.getAlgorithmType())){
|
|
|
AlgorithmPO po = new AlgorithmPO();
|
|
|
po.setId(param.getAlgorithm());
|
|
|
po.setAlgorithmName(param.getAlgorithmName());
|
|
|
- po.setUploadMode(ProjectConstants.SY_ALGORITHM_TYPE);
|
|
|
+ po.setUploadMode(DictConstants.PLATFORM);
|
|
|
po.setIsDeleted("0");
|
|
|
AlgorithmPO po1 = simulationProjectMapper.selectalgorithmByQuery(po);
|
|
|
if(po1 == null){
|
|
@@ -4266,4 +4292,75 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
throw new RuntimeException("自动运行项目停止失败:"+po.getId());
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取一级指标得分列表
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private List<AlgorithmScoreVo> getFirstTargetScore(String id){
|
|
|
+ //算法测试得分表
|
|
|
+ /*
|
|
|
+ 汇总测试得分计算方法:(每一项一级指标的测试得分*测试权重)累加
|
|
|
+ 得分率计算方法:每一项一级指标的所有场景得分不为0的数量/每一项一级指标的场景数量
|
|
|
+ 汇总得分率计算方法:(每一项一级指标的所有场景得分不为0的数量_累加/每一项一级指标的场景数量_累加)换成(得分累加取平均值)
|
|
|
+ */
|
|
|
+ //获取得分表一级指标信息
|
|
|
+ SimulationMptFirstTargetScorePo par = new SimulationMptFirstTargetScorePo();
|
|
|
+ par.setPId(id);
|
|
|
+ List<SimulationMptFirstTargetScorePo> pos = simulationMptFirstTargetScoreMapper.selectFirstTargetByPid(par);
|
|
|
+
|
|
|
+ List<AlgorithmScoreVo> algorithmScoreVoList = new ArrayList();
|
|
|
+ String evaluationLevelReport = "";
|
|
|
+ if(!isEmpty(pos)){
|
|
|
+ StringBuffer stringBuffer = new StringBuffer("");
|
|
|
+
|
|
|
+ //汇总数据初始化
|
|
|
+ Integer totalSceneNum = 0;
|
|
|
+ Double totalScore = 0D;
|
|
|
+ Double totalScoreRatio=0D;
|
|
|
+ Integer totalSceneScoreNum = 0;
|
|
|
+
|
|
|
+ for(SimulationMptFirstTargetScorePo v : pos){
|
|
|
+
|
|
|
+
|
|
|
+ stringBuffer.append(v.getSublistName()+"、");
|
|
|
+ AlgorithmScoreVo algorithmScoreVo = new AlgorithmScoreVo();
|
|
|
+ algorithmScoreVo.setProjectName(v.getSublistName());
|
|
|
+ Integer sceneNum = v.getSceneNum();
|
|
|
+ totalSceneNum += sceneNum;
|
|
|
+ algorithmScoreVo.setSceneNum(sceneNum);
|
|
|
+ String weight = v.getWeight();
|
|
|
+ Double weightDouble = Double.valueOf(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(),id);
|
|
|
+ totalSceneScoreNum += scoreNum;
|
|
|
+ algorithmScoreVo.setScoreRatio(saveTwoDecimalPlaces(Double.valueOf(scoreNum)/Double.valueOf(sceneNum)*100));
|
|
|
+ algorithmScoreVoList.add(algorithmScoreVo);
|
|
|
+
|
|
|
+ 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);
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ return algorithmScoreVoList;
|
|
|
+
|
|
|
+ }
|
|
|
}
|