|
@@ -3282,17 +3282,11 @@ 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";
|
|
|
for(ManualProjectTaskVo v : manualProjectTaskVos){
|
|
|
String runResultFilePath = v.getRunResultFilePath();
|
|
|
if(!isEmpty(runResultFilePath)){
|
|
|
|
|
|
- MinioParameter minioParameter = new MinioParameter();
|
|
|
- minioParameter.setObjectName(runResultFilePath+"/Ego.csv");
|
|
|
- Response download = fileDownService.download(minioParameter);
|
|
|
- Response.Body body = download.body();
|
|
|
- inputStream = body.asInputStream();
|
|
|
- in = new BufferedInputStream(inputStream);
|
|
|
-
|
|
|
//获取场景名
|
|
|
SceneBaseInfoVo sceneBaseInfoVo = getsceneNameAndOther(v.getSceneId(), v.getSceneType());
|
|
|
String sceneName = sceneBaseInfoVo.getCommonSceneName();
|
|
@@ -3301,33 +3295,25 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
String taskPagePath = rootPath+File.separator+sceneName+"("+i+")";
|
|
|
// FileUtil.createDirectory(taskPagePath);
|
|
|
|
|
|
- //任务文件路径
|
|
|
- String taskFilePath = taskPagePath +File.separator+ ".Ego.csv";
|
|
|
-// FileUtil.writeInputStreamToLocalFile(inputStream,taskFilePath);
|
|
|
-
|
|
|
- ZipEntry entry = new ZipEntry(taskFilePath);
|
|
|
- in = new BufferedInputStream(inputStream);
|
|
|
- zos.putNextEntry(entry);
|
|
|
- while ((len = in.read(buffer)) != -1 ) {
|
|
|
- zos.write(buffer, 0, len);
|
|
|
- }
|
|
|
-
|
|
|
//视频文件路径
|
|
|
MinioParameter minioParameter1 = new MinioParameter();
|
|
|
minioParameter1.setObjectName(runResultFilePath);
|
|
|
ResponseBodyVO<List<String>> list = fileDownService.list(minioParameter1);
|
|
|
List<String> info = list.getInfo();
|
|
|
for(String s : info){
|
|
|
- String videoPath = "";
|
|
|
+ String fileName = "";
|
|
|
+ String zipPath = "";
|
|
|
+ //获取文件名
|
|
|
+ if(s.contains("/")){
|
|
|
+ fileName = s.substring(s.lastIndexOf("/")+1);
|
|
|
+ }else{
|
|
|
+ fileName = s.substring(s.lastIndexOf("\\")+1);
|
|
|
+ }
|
|
|
+ zipPath = taskPagePath + File.separator + fileName;
|
|
|
+ //文件后缀
|
|
|
String substring = s.substring(s.lastIndexOf(".") + 1);
|
|
|
if("mp4".equals(substring)){
|
|
|
//mp4视频文件导出
|
|
|
- if(s.contains("/")){
|
|
|
- videoPath = taskPagePath + File.separator + s.substring(s.lastIndexOf("/")+1);
|
|
|
- }else{
|
|
|
- videoPath = taskPagePath + File.separator + s.substring(s.lastIndexOf("\\")+1);
|
|
|
- }
|
|
|
-
|
|
|
MinioParameter minioParameter2 = new MinioParameter();
|
|
|
minioParameter2.setObjectName(s);
|
|
|
Response download2 = fileDownService.download(minioParameter2);
|
|
@@ -3335,12 +3321,36 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
inputStream = body2.asInputStream();
|
|
|
in = new BufferedInputStream(inputStream);
|
|
|
|
|
|
- ZipEntry entry2 = new ZipEntry(videoPath);
|
|
|
+ ZipEntry entry2 = new ZipEntry(zipPath);
|
|
|
zos.putNextEntry(entry2);
|
|
|
while ((len = in.read(buffer)) != -1 ) {
|
|
|
zos.write(buffer, 0, len);
|
|
|
}
|
|
|
|
|
|
+ }else if(egoFile.equals(fileName)){
|
|
|
+
|
|
|
+ MinioParameter minioParameter = new MinioParameter();
|
|
|
+ if(s.contains("/")){
|
|
|
+ minioParameter.setObjectName(runResultFilePath+"/"+egoFile);
|
|
|
+ }else{
|
|
|
+ minioParameter.setObjectName(runResultFilePath+"\\"+egoFile);
|
|
|
+ }
|
|
|
+
|
|
|
+ Response download = fileDownService.download(minioParameter);
|
|
|
+ Response.Body body = download.body();
|
|
|
+ inputStream = body.asInputStream();
|
|
|
+ in = new BufferedInputStream(inputStream);
|
|
|
+
|
|
|
+ //任务文件路径
|
|
|
+ String taskFilePath = taskPagePath +File.separator + egoFile;
|
|
|
+// FileUtil.writeInputStreamToLocalFile(inputStream,taskFilePath);
|
|
|
+
|
|
|
+ ZipEntry entry = new ZipEntry(taskFilePath);
|
|
|
+ in = new BufferedInputStream(inputStream);
|
|
|
+ zos.putNextEntry(entry);
|
|
|
+ while ((len = in.read(buffer)) != -1 ) {
|
|
|
+ zos.write(buffer, 0, len);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
}
|