|
@@ -5,6 +5,7 @@ import api.common.pojo.constants.DictConstants;
|
|
import api.common.pojo.dto.ProjectMessageDTO;
|
|
import api.common.pojo.dto.ProjectMessageDTO;
|
|
import api.common.util.*;
|
|
import api.common.util.*;
|
|
import com.css.simulation.resource.scheduler.manager.ProjectManager;
|
|
import com.css.simulation.resource.scheduler.manager.ProjectManager;
|
|
|
|
+import com.css.simulation.resource.scheduler.manager.TaskManager;
|
|
import com.css.simulation.resource.scheduler.mapper.*;
|
|
import com.css.simulation.resource.scheduler.mapper.*;
|
|
import com.css.simulation.resource.scheduler.pojo.po.*;
|
|
import com.css.simulation.resource.scheduler.pojo.po.*;
|
|
import com.css.simulation.resource.scheduler.pojo.to.*;
|
|
import com.css.simulation.resource.scheduler.pojo.to.*;
|
|
@@ -74,7 +75,7 @@ public class ProjectConsumer {
|
|
@Resource
|
|
@Resource
|
|
IndexMapper indexMapper;
|
|
IndexMapper indexMapper;
|
|
@Resource
|
|
@Resource
|
|
- TaskMapper taskMapper;
|
|
|
|
|
|
+ TaskManager taskManager;
|
|
@Resource
|
|
@Resource
|
|
ProjectManager projectManager;
|
|
ProjectManager projectManager;
|
|
@Resource
|
|
@Resource
|
|
@@ -99,7 +100,6 @@ public class ProjectConsumer {
|
|
String packageId = projectMessageDTO.getScenePackageId(); // 场景测试包 id
|
|
String packageId = projectMessageDTO.getScenePackageId(); // 场景测试包 id
|
|
String vehicleConfigId = projectMessageDTO.getVehicleConfigId();// 模型配置 id
|
|
String vehicleConfigId = projectMessageDTO.getVehicleConfigId();// 模型配置 id
|
|
long videoTime = projectMessageDTO.getMaxSimulationTime(); // 结果视频的时长
|
|
long videoTime = projectMessageDTO.getMaxSimulationTime(); // 结果视频的时长
|
|
- long parallelism = projectMessageDTO.getParallelism(); // 项目并行度
|
|
|
|
String projectType = projectMessageDTO.getType(); // 项目类型
|
|
String projectType = projectMessageDTO.getType(); // 项目类型
|
|
String userId = ""; // 用户 id
|
|
String userId = ""; // 用户 id
|
|
if (DictConstants.PROJECT_TYPE_MANUAL.equals(projectType)) {
|
|
if (DictConstants.PROJECT_TYPE_MANUAL.equals(projectType)) {
|
|
@@ -123,7 +123,7 @@ public class ProjectConsumer {
|
|
List<CameraPO> cameraPOList = sensorCameraMapper.selectCameraByVehicleConfigId(vehicleConfigId); // 摄像头
|
|
List<CameraPO> cameraPOList = sensorCameraMapper.selectCameraByVehicleConfigId(vehicleConfigId); // 摄像头
|
|
List<OgtPO> ogtPOList = sensorOgtMapper.selectOgtByVehicleId(vehicleConfigId); // 完美传感器
|
|
List<OgtPO> ogtPOList = sensorOgtMapper.selectOgtByVehicleId(vehicleConfigId); // 完美传感器
|
|
// -------------------------------- 3 保存任务消息 --------------------------------
|
|
// -------------------------------- 3 保存任务消息 --------------------------------
|
|
- log.info("ProjectService--sendTaskMessage 项目 " + projectId + " 获得的包括的场景信息为:" + scenePOSet);
|
|
|
|
|
|
+ List<TaskPO> taskList = new ArrayList<>();
|
|
for (ScenePO scenePO : scenePOSet) {
|
|
for (ScenePO scenePO : scenePOSet) {
|
|
String sceneId = scenePO.getId();
|
|
String sceneId = scenePO.getId();
|
|
//3-1 可能会存在多个指标下有同样的场景,所以会查出多个指标,多个指标的场景需要发送多次
|
|
//3-1 可能会存在多个指标下有同样的场景,所以会查出多个指标,多个指标的场景需要发送多次
|
|
@@ -155,7 +155,7 @@ public class ProjectConsumer {
|
|
taskPO.setModifyUserId(userId);
|
|
taskPO.setModifyUserId(userId);
|
|
taskPO.setModifyTime(TimeUtil.getNowForMysql());
|
|
taskPO.setModifyTime(TimeUtil.getNowForMysql());
|
|
taskPO.setIsDeleted("0");
|
|
taskPO.setIsDeleted("0");
|
|
- taskMapper.insert(taskPO);
|
|
|
|
|
|
+ taskList.add(taskPO);
|
|
// 将 xosc、xodr、osgb 全部上传到仿真结果路径
|
|
// 将 xosc、xodr、osgb 全部上传到仿真结果路径
|
|
String scenarioOsc = scenePO.getScenarioOsc();
|
|
String scenarioOsc = scenePO.getScenarioOsc();
|
|
String[] splitXosc = scenarioOsc.split("/");
|
|
String[] splitXosc = scenarioOsc.split("/");
|
|
@@ -237,7 +237,8 @@ public class ProjectConsumer {
|
|
FileUtil.writeStringToLocalFile(JsonUtil.beanToJson(taskTO), projectPath + taskId + ".json");
|
|
FileUtil.writeStringToLocalFile(JsonUtil.beanToJson(taskTO), projectPath + taskId + ".json");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ taskManager.batchInsertTask(taskList);
|
|
|
|
+ log.info("ProjectConsumer.createTaskAndFixData() 项目 " + projectId + " 创建任务:" + taskList);
|
|
//* -------------------------------- 4 开始排队 --------------------------------
|
|
//* -------------------------------- 4 开始排队 --------------------------------
|
|
cacheProject(projectRecord);
|
|
cacheProject(projectRecord);
|
|
|
|
|