root 2 лет назад
Родитель
Сommit
22a62d7066

+ 6 - 0
simulation-resource-scheduler/src/main/java/com/css/simulation/resource/scheduler/manager/TaskManager.java

@@ -129,6 +129,12 @@ public class TaskManager {
                     taskMapper.updateFailStateWithStopTime(taskId, state, TimeUtil.getNowForMysql(), DictConstants.TASK_ERROR_REASON_3);
                 } else if ("PendingAnalysis".equals(state)) {
                     taskMapper.updateSuccessStateWithStopTime(taskId, state, TimeUtil.getNowForMysql());
+                    // 创建视频和生成
+                    //1 根据 task 对应的场景的 xodr 文件
+                    String projectRunningKey = redisPrefix.getProjectRunningKey();
+                    //2 输入到工具类中获取到图片
+                    //3 将图片生成视频
+                    //3 将视频上传到 minio
                 }
                 // -------------------------------- 判断项目是否结束 --------------------------------
                 ProjectMessageDTO projectMessageDTO = JsonUtil.jsonToBean(stringRedisTemplate.opsForValue().get(redisPrefix.getProjectRunningKey()), ProjectMessageDTO.class);

+ 0 - 2
simulation-resource-server/src/main/java/com/css/simulation/resource/project/ctrl/SimulationProjectCtrl.java

@@ -223,8 +223,6 @@ public class SimulationProjectCtrl {
 
     /**
      * 导出工作任务文件包
-     *
-     * @return
      */
     @RequestMapping("exportProjectTaskFileById")
     @ResponseBody

+ 5 - 5
simulation-resource-server/src/main/java/com/css/simulation/resource/project/impl/SimulationProjectServiceImpl.java

@@ -3491,7 +3491,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
             response.setHeader("Content-Disposition", "attachment;fileName=" + URLEncoder.encode("运行任务包.zip", "UTF-8"));
             zos = new ZipOutputStream(response.getOutputStream());
             int i = 1;
-            String egoFile = "Ego.csv";
+            ArrayList<String> fileList = CollectionUtil.createArrayList("Ego.csv", "evaluation.csv");
             for (ManualProjectTaskVo v : manualProjectTaskVos) {
                 String runResultFilePath = v.getRunResultFilePath();
                 if (!isEmpty(runResultFilePath)) {
@@ -3536,13 +3536,13 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
                                 zos.write(buffer, 0, len);
                             }
 
-                        } else if (egoFile.equals(fileName)) {
+                        } else if (fileList.contains(fileName)) {
 
                             MinioParameter minioParameter = new MinioParameter();
                             if (s.contains("/")) {
-                                minioParameter.setObjectName(runResultFilePath + "/" + egoFile);
+                                minioParameter.setObjectName(runResultFilePath + "/" + fileName);
                             } else {
-                                minioParameter.setObjectName(runResultFilePath + "\\" + egoFile);
+                                minioParameter.setObjectName(runResultFilePath + "\\" + fileName);
                             }
 
                             Response download = fileDownService.download(minioParameter);
@@ -3551,7 +3551,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
                             in = new BufferedInputStream(inputStream);
 
                             //任务文件路径
-                            String taskFilePath = taskPagePath + File.separator + egoFile;
+                            String taskFilePath = taskPagePath + File.separator + fileName;
 //                          FileUtil.writeInputStreamToLocalFile(inputStream,taskFilePath);
 
                             ZipEntry entry = new ZipEntry(taskFilePath);