From f838ba0a082526be349769bc8b40181ed25c3ce4 Mon Sep 17 00:00:00 2001 From: xiaoguangbin Date: Thu, 12 Oct 2023 14:27:04 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9Agamma=E8=87=AA=E5=8A=A8=E5=A4=84?= =?UTF-8?q?=E7=90=86=E7=94=9F=E6=88=90=E6=8A=A5=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/spectrum/Sample_G_Analysis.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) 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<>();