夜得朦胧 1 vuosi sitten
vanhempi
commit
c93c237f7f

+ 22 - 1
simulation-resource-server/src/main/java/com/css/simulation/resource/server/app/impl/MultiSimulationProjectServiceImpl.java

@@ -47,6 +47,7 @@ import javax.servlet.http.HttpServletResponse;
 import java.io.BufferedInputStream;
 import java.io.File;
 import java.io.IOException;
+import java.io.InputStream;
 import java.net.URLEncoder;
 import java.util.*;
 import java.util.zip.ZipEntry;
@@ -822,6 +823,24 @@ public class MultiSimulationProjectServiceImpl implements MultiSimulationProject
         return new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS);
     }
 
+//    private void downloadDependFile(String minioPath, String localPath) throws IOException {
+//         FileDownService fileDownService = ApplicationContextAwareImpl.getApplicationContext().getBean(FileDownService.class);
+//         Response download = fileDownService.download(MinioParameter.builder().objectName(minioPath).build());
+//         Response.Body body = download.body();
+//         InputStream inputStream;
+//         inputStream = body.asInputStream();
+//         File file = new File(localPath);
+//         OutputStream outputStream = Files.newOutputStream(file.toPath());
+//         byte[] buffer = new byte[1024];
+//         int bytesRead;
+//         while ((bytesRead = inputStream.read(buffer)) != -1) {
+//         outputStream.write(buffer, 0, bytesRead);
+//         }
+//         inputStream.close();
+//         outputStream.close();
+//         download.close();
+//    }
+
     @SneakyThrows
     public void exportProjectTaskFileById(MultiSimulationProjectParam param){
         String projectId = param.getProjectId();
@@ -886,11 +905,13 @@ public class MultiSimulationProjectServiceImpl implements MultiSimulationProject
                         Response.Body body = down.body();
                         ZipEntry entry2 = new ZipEntry(zipPath);
                         zos.putNextEntry(entry2);
-                        BufferedInputStream in = new BufferedInputStream(body.asInputStream());
+//                        BufferedInputStream in = new BufferedInputStream(body.asInputStream());
+                        InputStream in = body.asInputStream();
                         while ((len = in.read(buffer)) != -1) {
                             zos.write(buffer, 0, len);
                         }
                         in.close();
+
                     }else if ("Ego.csv".equals(fileName) || "evaluation.csv".equals(fileName)) {
                         MinioParameter minioPar = new MinioParameter();
                         minioPar.setObjectName(s);

+ 1 - 1
simulation-resource-server/src/main/java/com/css/simulation/resource/server/infra/db/mysql/mapper/MultiSimulationProjectTaskRecordMapper.java

@@ -8,7 +8,7 @@ import java.util.List;
 @Mapper
 public interface MultiSimulationProjectTaskRecordMapper {
 
-    @Select("select id,project_id,scene_id,status from multi_simulation_project_task_record where project_id = #{projectId} and deleted = 0")
+    @Select("select id,project_id,scene_id,status,task_body from multi_simulation_project_task_record where project_id = #{projectId} and deleted = 0")
     List<MultiSimulationProjectTaskRecordPO> selectMultiSimulationProjectTaskRecordList(@Param("projectId") String projectId);
 
 }