|
@@ -14,6 +14,7 @@ import api.common.pojo.param.scene.ScenePackageParam;
|
|
|
import api.common.pojo.param.scene.SceneReferenceLibSelectParam;
|
|
|
import api.common.pojo.param.system.DictParam;
|
|
|
import api.common.pojo.po.algorithm.AlgorithmPO;
|
|
|
+import api.common.pojo.po.group.SimulationMageGroupPO;
|
|
|
import api.common.pojo.po.model.ConfigPO;
|
|
|
import api.common.pojo.po.model.ConfigSensorPO;
|
|
|
import api.common.pojo.po.model.VehiclePO;
|
|
@@ -99,6 +100,9 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
private SimulationMptFirstTargetScoreMapper simulationMptFirstTargetScoreMapper;
|
|
|
@Resource
|
|
|
private SimulationMptLastTargetScoreMapper simulationMptLastTargetScoreMapper;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private SimulationMageGroupMapper mageGroupMapper;
|
|
|
@Resource
|
|
|
private AlgorithmMapper algorithmMapper;
|
|
|
@Resource
|
|
@@ -148,6 +152,9 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
if (isEmpty(param.getProjectName())) {
|
|
|
return new ResponseBodyVO<>(ResponseBodyVO.Response.CLIENT_FAILURE, "工作名称不能为空。");
|
|
|
}
|
|
|
+ if (isEmpty(param.getSimulationMageGroupId())){
|
|
|
+ return new ResponseBodyVO<>(ResponseBodyVO.Response.CLIENT_FAILURE, "仿真镜像组不能为空");
|
|
|
+ }
|
|
|
SimulationManualProjectPO po = convertParamToPo(param);
|
|
|
|
|
|
if (isEmpty(param.getId())) {
|
|
@@ -321,6 +328,10 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
projectDetailsVO.setNowRunState(DictConstants.PROJECT_RUNNING);
|
|
|
projectDetailsVO.setNowRunStateName(DictConstants.PROJECT_RUNNING_NAME);
|
|
|
//1 校验项目的信息是否可用
|
|
|
+ SimulationMageGroupPO groupPO = mageGroupMapper.selectSimulationMageGroupById(oldProjectPO.getSimulationMageGroupId());
|
|
|
+ if (Objects.isNull(groupPO)){
|
|
|
+ throw new RuntimeException("仿真镜像组无效");
|
|
|
+ }
|
|
|
projectUtil.checkProject(oldProjectPO.getAlgorithm(), oldProjectPO.getVehicle(), oldProjectPO.getScene(), parallelism);
|
|
|
if (DictConstants.PROJECT_COMPLETED.equals(oldState)) { // 根据已完成的项目创建新项目
|
|
|
SimulationManualProjectPO newProjectPO = new SimulationManualProjectPO();
|
|
@@ -385,6 +396,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
kafkaParam.setAlgorithmId(po.getAlgorithm());
|
|
|
kafkaParam.setVehicleConfigId(po.getVehicle());
|
|
|
kafkaParam.setScenePackageId(po.getScene());
|
|
|
+ kafkaParam.setSimulationMageGroupId(po.getSimulationMageGroupId());
|
|
|
kafkaParam.setMaxSimulationTime(po.getMaxSimulationTime());
|
|
|
kafkaParam.setParallelism(Integer.valueOf(po.getParallelism()));
|
|
|
kafkaParam.setType(DictConstants.PROJECT_TYPE_MANUAL);
|
|
@@ -460,6 +472,8 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
String algorithmId;
|
|
|
String projectId;
|
|
|
String createTime;
|
|
|
+ String simulationMageGroupId = null;// 仿真镜像组id
|
|
|
+ String simulationMageGroupName = null;
|
|
|
if (DictConstants.PROJECT_TYPE_MANUAL.equals(projectType)) { // 手动运行任务
|
|
|
SimulationManualProjectPO simulationManualProjectPO = simulationManualProjectMapper.selectProjectById(param);
|
|
|
details = simulationManualProjectPO.getDetails();
|
|
@@ -467,6 +481,13 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
algorithmId = simulationManualProjectPO.getAlgorithm();
|
|
|
projectId = simulationManualProjectPO.getProjectId();
|
|
|
createTime = String.valueOf(simulationManualProjectPO.getCreateTime());
|
|
|
+ simulationMageGroupId = simulationManualProjectPO.getSimulationMageGroupId();
|
|
|
+ if (com.alibaba.cloud.commons.lang.StringUtils.isNotBlank(simulationMageGroupId)){
|
|
|
+ SimulationMageGroupPO groupPO = mageGroupMapper.selectSimulationMageGroupById(simulationMageGroupId);
|
|
|
+ if (!Objects.isNull(groupPO)){
|
|
|
+ simulationMageGroupName = groupPO.getGroupName();
|
|
|
+ }
|
|
|
+ }
|
|
|
} else if (DictConstants.PROJECT_TYPE_AUTO_SUB.equals(projectType)) {
|
|
|
SimulationManualProjectVO simulationManualProjectVO = simulationAutomaticSubProjectMapper.selectProjectInfo(param);
|
|
|
details = simulationManualProjectVO.getDetails();
|
|
@@ -478,7 +499,8 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
throw new RuntimeException("未知项目类型:" + projectType);
|
|
|
}
|
|
|
projectDetailsVO = JsonUtil.jsonToBean(details, ProjectDetailsVO.class);
|
|
|
-
|
|
|
+ projectDetailsVO.setSimulationMageGroupId(simulationMageGroupId);
|
|
|
+ projectDetailsVO.setSimulationMageGroupName(simulationMageGroupName);
|
|
|
// 修正项目ID、创建时间
|
|
|
{
|
|
|
projectDetailsVO.setProjectId(projectId);
|
|
@@ -592,6 +614,14 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
projectDetailsVO.setNowRunStateName(getDictName(DictConstants.PROJECT_RUN_STATE, po.getNowRunState()));
|
|
|
algorithmType = po.getAlgorithmType();
|
|
|
algorithmId = po.getAlgorithm();
|
|
|
+ String simulationMageGroupId = po.getSimulationMageGroupId();
|
|
|
+ if (com.alibaba.cloud.commons.lang.StringUtils.isNotBlank(simulationMageGroupId)){
|
|
|
+ SimulationMageGroupPO groupPO = mageGroupMapper.selectSimulationMageGroupById(simulationMageGroupId);
|
|
|
+ if (!Objects.isNull(groupPO)){
|
|
|
+ projectDetailsVO.setSimulationMageGroupId(simulationMageGroupId);
|
|
|
+ projectDetailsVO.setSimulationMageGroupName(groupPO.getGroupName());
|
|
|
+ }
|
|
|
+ }
|
|
|
} else if (DictConstants.PROJECT_TYPE_AUTO_SUB.equals(param.getProjectType())) {
|
|
|
SimulationManualProjectVO po = simulationAutomaticSubProjectMapper.selectProjectInfo(param);
|
|
|
projectDetailsVO = JsonUtil.jsonToBean(po.getDetails(), ProjectDetailsVO.class);
|
|
@@ -1795,6 +1825,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
po.setAlgorithm(param.getAlgorithm());
|
|
|
po.setVehicle(param.getVehicle());
|
|
|
po.setScene(param.getScene());
|
|
|
+ po.setSimulationMageGroupId(param.getSimulationMageGroupId());
|
|
|
// po.setOperationCycle(param.getOperationCycle());
|
|
|
po.setMaxSimulationTime(param.getMaxSimulationTime());
|
|
|
po.setParallelism(param.getParallelism());
|
|
@@ -1860,6 +1891,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
vo.setAlgorithmType(po.getAlgorithmType());
|
|
|
vo.setVehicle(po.getVehicle());
|
|
|
vo.setScene(po.getScene());
|
|
|
+ vo.setSimulationMageGroupId(po.getSimulationMageGroupId());
|
|
|
vo.setMaxSimulationTime(po.getMaxSimulationTime());
|
|
|
vo.setParallelism(po.getParallelism());
|
|
|
vo.setIsChoiceGpu(po.getIsChoiceGpu());
|