From 979f24a10ce8068e062c49f95ffac89db51459d9 Mon Sep 17 00:00:00 2001 From: nieziyan Date: Tue, 6 Aug 2024 18:23:21 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E8=87=AA=E5=BB=BA=E5=8F=B0?= =?UTF-8?q?=E7=AB=99view=20log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/jeecg/common/util/GammaFileUtil.java | 2 +- .../controller/SelfStationController.java | 12 +++ .../mapper/SpectrumAnalysisMapper.java | 2 + .../mapper/xml/SpectrumAnalysisMapper.xml | 4 + .../modules/service/ISelfStationService.java | 4 + .../service/impl/SelfStationServiceImpl.java | 76 ++++++++++++++++--- 6 files changed, 90 insertions(+), 10 deletions(-) diff --git a/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/common/util/GammaFileUtil.java b/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/common/util/GammaFileUtil.java index d3fbb4f6..aa5b1a64 100644 --- a/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/common/util/GammaFileUtil.java +++ b/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/common/util/GammaFileUtil.java @@ -2700,7 +2700,7 @@ public class GammaFileUtil extends AbstractLogOrReport { strBuffer.append(System.lineSeparator()); if (middleData.sample_Type.equals(SystemType.PARTICULATE.getType())) { strBuffer.append(" (Particulates Version) "); - } else if (middleData.sample_Type.equals(SystemType.GAMMA.getType())) { + } else if (StrUtil.equalsAny(middleData.sample_Type, SystemType.GAMMA.getType(), SystemType.SELFSTATION.getType())) { strBuffer.append(" (Noble Gas Version) "); } //换行 diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/controller/SelfStationController.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/controller/SelfStationController.java index 9f88b706..f31dd862 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/controller/SelfStationController.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/controller/SelfStationController.java @@ -414,4 +414,16 @@ public class SelfStationController { public Result viewRRR(@RequestBody RRRLogInfo rrrLogInfo, HttpServletRequest request) { return selfStationService.viewRRR(rrrLogInfo, request); } + + @GetMapping("viewAutomaticAnalysisLog") + @ApiOperation(value = "查看Automatic Analysis Log页面数据", notes = "查看Automatic Analysis Log页面数据") + public Result viewAutomaticAnalysisLog(Integer sampleId) { + return selfStationService.viewAutomaticAnalysisLog(sampleId); + } + + @GetMapping("viewBGLogViewer") + @ApiOperation(value = "查看BG Log Viewer数据", notes = "查看BG Log Viewer数据") + public Result viewBGLogViewer(String sampleFileName, HttpServletRequest request) { + return selfStationService.viewBGLogViewer(sampleFileName, request); + } } diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/mapper/SpectrumAnalysisMapper.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/mapper/SpectrumAnalysisMapper.java index d294af8f..3a088bde 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/mapper/SpectrumAnalysisMapper.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/mapper/SpectrumAnalysisMapper.java @@ -42,6 +42,8 @@ public interface SpectrumAnalysisMapper { GardsAnalyses viewARRSelf(@Param(value = "sampleId") Integer sampleId); + GardsAnalyses viewLogSelf(@Param(value = "sampleId") Integer sampleId); + String viewRRR(@Param(value = "sampleId") Integer sampleId); GardsSampleDataSpectrum getSampleData(@Param(value = "sampleId") Integer sampleId); diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/mapper/xml/SpectrumAnalysisMapper.xml b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/mapper/xml/SpectrumAnalysisMapper.xml index 3571a11b..c8b7a0fe 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/mapper/xml/SpectrumAnalysisMapper.xml +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/mapper/xml/SpectrumAnalysisMapper.xml @@ -234,6 +234,10 @@ SELECT IDANALYSIS, REPORT_PAHT AS reportPath FROM RNAUTO.GARDS_ANALYSES where SAMPLE_ID = #{sampleId} + + diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/ISelfStationService.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/ISelfStationService.java index 18938282..e5690439 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/ISelfStationService.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/ISelfStationService.java @@ -136,4 +136,8 @@ public interface ISelfStationService { Result viewARR(Integer sampleId, HttpServletResponse response); Result viewRRR(RRRLogInfo rrrLogInfo, HttpServletRequest request); + + Result viewAutomaticAnalysisLog(Integer sampleId); + + Result viewBGLogViewer(String sampleFileName, HttpServletRequest request); } diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SelfStationServiceImpl.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SelfStationServiceImpl.java index d71d2f6d..a1a9b8fc 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SelfStationServiceImpl.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SelfStationServiceImpl.java @@ -5208,7 +5208,7 @@ public class SelfStationServiceImpl implements ISelfStationService { @DS("ora") public Result viewARR(Integer sampleId, HttpServletResponse response) { GardsAnalyses analyses = spectrumAnalysisMapper.viewARRSelf(sampleId); - Map> result = new HashMap<>(); + Map result = new HashMap<>(); if (ObjectUtil.isNull(analyses)) return Result.error("The automatic handler generated report does not exist!"); Integer idAnalysis = analyses.getIdAnalysis(); @@ -5218,14 +5218,14 @@ public class SelfStationServiceImpl implements ISelfStationService { reportPath = rootPath + saveFilePath + StrUtil.SLASH + reportPath + FileTypeEnum.arr.getType(); if (!FileUtil.exist(reportPath)) return Result.error("The automatic handler generated report does not exist!"); - result.put("Beta", FileUtil.readUtf8Lines(reportPath)); + result.put("Beta", FileUtil.readUtf8String(reportPath)); List analysisRois = analysisRoiAutoService.analysisRoi(idAnalysis); for (GardsAnalysisRoi analysisRoi : analysisRois) { Integer roiNum = analysisRoi.getRoiNum(); String roiReportPath = analysisRoi.getReportPath(); roiReportPath = rootPath + saveFilePath + StrUtil.SLASH + roiReportPath + FileTypeEnum.arr.getType(); if (!FileUtil.exist(roiReportPath)) continue; - result.put("Gamma_ROI_" + roiNum, FileUtil.readUtf8Lines(roiReportPath)); + result.put("Gamma_ROI_" + roiNum, FileUtil.readUtf8String(roiReportPath)); } return Result.OK(result); } @@ -5233,12 +5233,12 @@ public class SelfStationServiceImpl implements ISelfStationService { @Override public Result viewRRR(RRRLogInfo rrrLogInfo, HttpServletRequest request) { String userName = JwtUtil.getUserNameByToken(request); - Map> result = new HashMap<>(); + Map result = new HashMap<>(); Cache selfCache = selfStationCache.getSelfCache(); SelfStationData selfStationData = selfCache.getIfPresent(rrrLogInfo.getSampleFileName() + StringPool.DASH + userName); if (ObjectUtil.isNull(selfStationData)) return Result.error("Please select the parse file first!"); - // TODO BetaDataFile赋值后 解开注释 + // TODO BetaDataFile赋值后 放开注释 // 生成Beta 报告内容 /*BetaDataFile betaDataFile = selfStationData.getBetaDataFile(); if (ObjectUtil.isNull(betaDataFile)) @@ -5251,10 +5251,10 @@ public class SelfStationServiceImpl implements ISelfStationService { PHDFile phd2 = sampleVueData.getROITwoPHDFile(); PHDFile phd3 = sampleVueData.getROIThreePHDFile(); PHDFile phd4 = sampleVueData.getROIFourPHDFile(); - List reportContent1 = gammaFileUtil.GetReportContent(phd1, userName, "log"); - List reportContent2 = gammaFileUtil.GetReportContent(phd2, userName, "log"); - List reportContent3 = gammaFileUtil.GetReportContent(phd3, userName, "log"); - List reportContent4 = gammaFileUtil.GetReportContent(phd4, userName, "log"); + String reportContent1 = gammaFileUtil.GetReportContent(phd1, userName, false,"log"); + String reportContent2 = gammaFileUtil.GetReportContent(phd2, userName, false,"log"); + String reportContent3 = gammaFileUtil.GetReportContent(phd3, userName, false,"log"); + String reportContent4 = gammaFileUtil.GetReportContent(phd4, userName, false,"log"); result.put("Gamma_ROI_1", reportContent1); result.put("Gamma_ROI_2", reportContent2); result.put("Gamma_ROI_3", reportContent3); @@ -5262,6 +5262,64 @@ public class SelfStationServiceImpl implements ISelfStationService { return Result.OK(result); } + @Override + @DS("ora") + public Result viewAutomaticAnalysisLog(Integer sampleId) { + GardsAnalyses analyses = spectrumAnalysisMapper.viewLogSelf(sampleId); + Map result = new HashMap<>(); + if (ObjectUtil.isNull(analyses)) + return Result.error("The log generated by the automatic processor does not exist!"); + Integer idAnalysis = analyses.getIdAnalysis(); + String logPath = analyses.getLogPath(); + String rootPath = spectrumPathProperties.getRootPath(); + String logPathPrefix = spectrumPathProperties.getLogPath(); + logPath = rootPath + logPathPrefix + StrUtil.SLASH + logPath; + if (!FileUtil.exist(logPath)) + return Result.error("The log generated by the automatic processor does not exist!"); + result.put("Beta", FileUtil.readUtf8String(logPath)); + List analysisRois = analysisRoiAutoService.analysisRoi(idAnalysis); + for (GardsAnalysisRoi analysisRoi : analysisRois) { + Integer roiNum = analysisRoi.getRoiNum(); + String roiLogPath = analysisRoi.getLogPath(); + roiLogPath = rootPath + logPathPrefix + StrUtil.SLASH + roiLogPath; + if (!FileUtil.exist(roiLogPath)) continue; + result.put("Gamma_ROI_" + roiNum, FileUtil.readUtf8String(roiLogPath)); + } + return Result.OK(result); + } + + @Override + public Result viewBGLogViewer(String sampleFileName, HttpServletRequest request) { + String userName = JwtUtil.getUserNameByToken(request); + Map result = new HashMap<>(); + Cache selfCache = selfStationCache.getSelfCache(); + SelfStationData selfStationData = selfCache.getIfPresent(sampleFileName + StringPool.DASH + userName); + if (ObjectUtil.isNull(selfStationData)) + return Result.error("Please select the parse file first!"); + SelfStationVueData sampleVueData = selfStationData.getSampleVueData(); + // 生成Beta日志内容 + String logFilePath = parameterProperties.getLogFilePath(); + String formatDate = DateUtils.formatDate(new Date(), "yyyy-MM-dd"); + String replace = StrUtil.replace(sampleFileName, "PHD", "log"); + logFilePath = logFilePath + StrUtil.SLASH + formatDate + StrUtil.SLASH + replace; + if (FileUtil.exist(logFilePath)) + result.put("Beta", FileUtil.readUtf8String(logFilePath)); + // 生成4个Gamma ROI日志内容 + PHDFile phd1 = sampleVueData.getROIOnePHDFile(); + PHDFile phd2 = sampleVueData.getROITwoPHDFile(); + PHDFile phd3 = sampleVueData.getROIThreePHDFile(); + PHDFile phd4 = sampleVueData.getROIFourPHDFile(); + String logContent1 = gammaFileUtil.GetReportContent(phd1, userName, true, "log"); + String logContent2 = gammaFileUtil.GetReportContent(phd2, userName, true, "log"); + String logContent3 = gammaFileUtil.GetReportContent(phd3, userName, true, "log"); + String logContent4 = gammaFileUtil.GetReportContent(phd4, userName, true, "log"); + result.put("Gamma_ROI_1", logContent1); + result.put("Gamma_ROI_2", logContent2); + result.put("Gamma_ROI_3", logContent3); + result.put("Gamma_ROI_4", logContent4); + return Result.OK(result); + } + @Transactional public boolean SaveSampleToDB(PHDFile phd, String input_file_name) { boolean bRet = false;