diff --git a/project/src/main/java/com/sdm/project/service/impl/SimulationRunServiceImpl.java b/project/src/main/java/com/sdm/project/service/impl/SimulationRunServiceImpl.java index 094ff45c..6ba01efe 100644 --- a/project/src/main/java/com/sdm/project/service/impl/SimulationRunServiceImpl.java +++ b/project/src/main/java/com/sdm/project/service/impl/SimulationRunServiceImpl.java @@ -1495,12 +1495,17 @@ public class SimulationRunServiceImpl extends ServiceImpl command = new ArrayList<>(); command.add("python"); command.add("/opt/script/newExportWord.py"); command.add(TEMP_REPORT_PATH + randomId); command.add("/opt/script/template/仿真报告标准模板_v1.0.docx"); + command.add(reportName); String commands = String.join(" ", command); // 调用脚本 @@ -1532,9 +1537,6 @@ public class SimulationRunServiceImpl extends ServiceImpl command = new ArrayList<>(); command.add("python"); @@ -1703,6 +1709,7 @@ public class SimulationRunServiceImpl extends ServiceImpl imageNames = extractPicNames(reportContent); if (CollectionUtils.isNotEmpty(imageNames)) { int sortOrder = 1; for (String imageName : imageNames) { - archiveReportAndImage(req.getTaskId(), req.getRunId(), randomId, FileBizTypeEnum.CLOUD_FILE, imageName, String.valueOf(sortOrder++)); + archiveReportAndImage(null, req.getTaskId(), req.getRunId(), randomId, FileBizTypeEnum.CLOUD_FILE, imageName, String.valueOf(sortOrder++)); } } return SdmResponse.success(); @@ -1761,7 +1768,7 @@ public class SimulationRunServiceImpl extends ServiceImpl command = new ArrayList<>(); command.add("python"); @@ -2027,6 +2036,7 @@ public class SimulationRunServiceImpl extends ServiceImpl imageNames = extractPicNames(reportContent); if (CollectionUtils.isNotEmpty(imageNames)) { int sortOrder = 1; for (String imageName : imageNames) { - archiveReportAndImage(req.getTaskId(), req.getRunId(), randomId, FileBizTypeEnum.CLOUD_FILE, imageName, String.valueOf(sortOrder++)); + archiveReportAndImage(null, req.getTaskId(), req.getRunId(), randomId, FileBizTypeEnum.CLOUD_FILE, imageName, String.valueOf(sortOrder++)); } } - // 获取临时路径中脚本生成的报告 - String reportName = "report_" + - LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss")) + - ".docx"; FileInputStream fileInputStream = new FileInputStream(TEMP_REPORT_PATH + randomId + File.separator + reportName); fileData = fileInputStream.readAllBytes();