From 789a67bd033b03ff8bf8fa4b807b3649076c1332 Mon Sep 17 00:00:00 2001 From: nieziyan Date: Fri, 27 Oct 2023 19:24:32 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9AviewAutomaticAnalysisLog?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/SpectrumAnalysisServiceImpl.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SpectrumAnalysisServiceImpl.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SpectrumAnalysisServiceImpl.java index 859b3608..0c53010f 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SpectrumAnalysisServiceImpl.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SpectrumAnalysisServiceImpl.java @@ -4445,6 +4445,26 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { } } + @Override + public void viewAutomaticAnalysisLog(Integer sampleId, HttpServletResponse response) { + try { + String path = "C:\\Users\\a\\Desktop\\demo.log"; + InputStream inputStream = new FileInputStream(new File(path)); + OutputStream outputStream = ExportUtil.stream(response, "demo.log"); + + // 缓冲区大小 + byte[] buffer = new byte[4096]; + int bytesRead; + + // 将文件输出流写入到输出流中 + while ((bytesRead = inputStream.read(buffer)) != -1) { + outputStream.write(buffer, 0, bytesRead); + } + } catch (IOException e) { + e.printStackTrace(); + } + } + private List calibrations(GardsCalibrationSpectrum gammaCalibrationCE,GardsCalibrationSpectrum gammaCalibrationEC, GardsCalibrationSpectrum betaCalibrationCE, GardsCalibrationSpectrum betaCalibrationEC) { int min = 79; String space = StrUtil.SPACE;