|
@@ -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;
|
|
@@ -274,9 +275,11 @@ public class MultiSimulationProjectServiceImpl implements MultiSimulationProject
|
|
|
public ResponseBodyVO<MultiSimulationProjectVO> submitMultiSimulationProjectDetail(MultiSimulationProjectParam param){
|
|
|
String currentUserId = AuthUtil.getCurrentUserId();
|
|
|
param.setProjectUserId(currentUserId);
|
|
|
+ param.setProjectStatus(MultiSimulationStatusEnum.RUN_STATUS.getProjectStatus());
|
|
|
// 先更新
|
|
|
multiSimulationProjectMapper.updateMultiSimulationProject(param);
|
|
|
- Integer status = param.getProjectStatus();
|
|
|
+ MultiSimulationProjectVO projectVO = multiSimulationProjectMapper.selectMultiSimulationProjectById(param.getProjectId());
|
|
|
+ Integer status = projectVO.getProjectStatus();
|
|
|
if (status != MultiSimulationStatusEnum.INIT_STATUS.getProjectStatus()){
|
|
|
return new ResponseBodyVO<>(ResponseBodyVO.Response.CLIENT_FAILURE, "当前任务状态不允许执行此操作");
|
|
|
}
|
|
@@ -748,9 +751,12 @@ public class MultiSimulationProjectServiceImpl implements MultiSimulationProject
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ ResponseBodyVO<String> overUrlRes = fileDownService.getPublicUrl(sceneVO.getProjectResultOverallUrl());
|
|
|
+ ResponseBodyVO<String> simUrlRes = fileDownService.getPublicUrl(sceneVO.getProjectResultSimulationUrl());
|
|
|
+
|
|
|
MultiSimulationSceneResultVO multiSimulationSceneResultVO = new MultiSimulationSceneResultVO();
|
|
|
- multiSimulationSceneResultVO.setId(param.getSceneId()).setProjectId(sceneVO.getProjectId()).setProjectResultSimulationUrl(sceneVO.getProjectResultSimulationUrl())
|
|
|
- .setProjectResultOverallUrl(sceneVO.getProjectResultOverallUrl()).setSceneName(sceneVO.getSceneName())
|
|
|
+ multiSimulationSceneResultVO.setId(param.getSceneId()).setProjectId(sceneVO.getProjectId()).setProjectResultSimulationUrl(simUrlRes.isStatus() ? simUrlRes.getInfo() : "")
|
|
|
+ .setProjectResultOverallUrl(overUrlRes.isStatus() ? overUrlRes.getInfo() : "").setSceneName(sceneVO.getSceneName())
|
|
|
.setPhrases(phrases)
|
|
|
// .setCollisionTimes(collisionDetail.size())
|
|
|
// .setAbnormalParkingTimes(abnormalParkingDetail.size()).setOutOfPavementTimes(outOfPavementDetail.size())
|
|
@@ -822,6 +828,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 +910,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);
|