diff --git a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/Sample_G_Analysis.java b/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/Sample_G_Analysis.java index fe6a6756..4f0c752d 100644 --- a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/Sample_G_Analysis.java +++ b/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/Sample_G_Analysis.java @@ -152,6 +152,22 @@ public class Sample_G_Analysis { // 生成日志文件 writeLog(middleData.getAnalyses_LogPath(), middleData); // todo 报告文件 + String reportContent = gammaFileUtil.GetReportContent(phdFile, false); + String reportPath = StringUtils.substringBeforeLast(middleData.getAnalyses_ReportPath(), StringPool.SLASH); + String reportName = StringUtils.substringAfterLast(middleData.getAnalyses_ReportPath(), StringPool.SLASH) + ".txt"; + String savePath = StringPool.SLASH + spectrumPathProperties.getRootPath() + StringPool.SLASH + reportPath; + String tempDir = System.getProperty("java.io.tmpdir"); + // 创建文件 + File reportFile = FileUtil.writeString(reportContent, tempDir + System.currentTimeMillis(), "utf8"); + try { + ftpUtil.saveFile(savePath, reportName, new FileInputStream(reportFile)); + } catch (FileNotFoundException e) { + throw new RuntimeException(e); + } finally { + if (null != reportFile) { + reportFile.delete(); + } + } }catch (Exception e){ e.printStackTrace(); @@ -207,7 +223,7 @@ public class Sample_G_Analysis { * @param middleData */ private void writeLog(String logFilePath, GStoreMiddleProcessData middleData) { - logFilePath = StringPool.SLASH + spectrumPathProperties.getRootPath() + StringPool.SLASH + logFilePath; + logFilePath = StringPool.SLASH + spectrumPathProperties.getLogPath() + StringPool.SLASH + logFilePath; String sampleId = middleData.getSample_id(); MyLogFormatUtil myLogFormatUtil = new MyLogFormatUtil(); List writes = new LinkedList<>();