From 11f942072b5ed1c30c573ddae2d29978bf8aa882 Mon Sep 17 00:00:00 2001 From: qiaoqinzheng Date: Tue, 2 Jan 2024 14:03:28 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=A4=84=E7=90=86=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E9=80=BB=E8=BE=91=E5=88=A4=E6=96=AD=EF=BC=8C=E8=B0=83?= =?UTF-8?q?=E7=94=A8C++=E8=BF=9B=E8=A1=8C=E5=88=86=E6=9E=90=E5=A6=82?= =?UTF-8?q?=E6=9E=9C=E5=88=86=E6=9E=90=E7=BB=93=E6=9E=9C=E6=98=AF=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E7=9A=84=EF=BC=8C=E6=97=A5=E5=BF=97=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E5=B0=86=E5=88=86=E6=9E=90=E9=94=99=E8=AF=AF=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=88=B0=E6=97=A5=E5=BF=97=E4=B8=AD=E5=B9=B6?= =?UTF-8?q?=E4=B8=94=E4=B8=8D=E8=B5=B0=E5=85=B6=E4=BB=96=E7=9A=84=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E9=80=BB=E8=BE=91=EF=BC=8C=E5=88=86=E6=9E=90=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E6=98=AF=E6=B2=A1=E6=9C=89=E9=94=99=E8=AF=AF=E7=9A=84?= =?UTF-8?q?=E6=AD=A3=E5=B8=B8=E7=9A=84=E5=8F=82=E4=B8=8E=E5=88=B0=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E5=86=85=E5=AE=B9=E7=9A=84=E4=B9=A6=E5=86=99=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/spectrum/ParsingProcessLog.java | 59 +++++++++++++------ .../modules/spectrum/Sample_B_Analysis.java | 2 +- 2 files changed, 43 insertions(+), 18 deletions(-) diff --git a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/ParsingProcessLog.java b/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/ParsingProcessLog.java index c487ffbc..a0dbbbcb 100644 --- a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/ParsingProcessLog.java +++ b/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/ParsingProcessLog.java @@ -1,5 +1,6 @@ package org.jeecg.modules.spectrum; +import com.baomidou.mybatisplus.core.toolkit.StringUtils; import lombok.Setter; import org.jeecg.common.constant.StringConstant; import org.jeecg.common.properties.SpectrumPathProperties; @@ -47,6 +48,12 @@ public class ParsingProcessLog extends AbstractAutoLogOrReport{ @Setter private boolean analysisDataStoreFlag = false; + /** + * 分析数据是否成功 + */ + @Setter + private boolean analysisResultFlag = false; + /** * 能谱处理父类 */ @@ -163,26 +170,44 @@ public class ParsingProcessLog extends AbstractAutoLogOrReport{ analysisLog.append(System.lineSeparator()).append(System.lineSeparator()); this.setDetAndGasIdLog(); - if(fileNotExist){ - // Gas谱或Det谱文件找不到异常结束 - fileNotExistException(); - }else{ - this.readCalibrationData(); - this.reading_roi_limits(); - this.reading_roi_ratios(); - this.reading_B_G_Efficiency(); - this.NCC_analysis(); + //获取analyseResult + BgAnalyseResult analyseResult = sample_B_Analysis.analyseResult; + if (StringUtils.isNotBlank(analyseResult.error_log) && !analyseResult.error_log.equalsIgnoreCase("no error.")) { + analysisResultFlag = true; } - - if(fileRepeat || fileNotExist || analysisDataStoreFlag){ + //如果分析结果错误 + if (analysisResultFlag) { storeFlag = "Error"; + analysisLog.append(rowFormat(storeResult,storeFlag)); + analysisLog.append(System.lineSeparator()).append(System.lineSeparator()); + analysisLog.append(rowFormat(storeStatus,storeFlag,spectrumHandler.status)); + analysisLog.append(System.lineSeparator()).append(System.lineSeparator()); + analysisLog.append(analyseResult.error_log); + analysisLog.append(System.lineSeparator()).append(System.lineSeparator()); + analysisLog.append(titleFormat(analysisResultsEnd,25,StringConstant.DASH,storeFlag,endAnalysisTime,StringConstant.DASH)); + analysisLog.append(System.lineSeparator()).append(System.lineSeparator()).append(System.lineSeparator()); + } else { + if (fileNotExist){ + // Gas谱或Det谱文件找不到异常结束 + fileNotExistException(); + } else { + this.readCalibrationData(); + this.reading_roi_limits(); + this.reading_roi_ratios(); + this.reading_B_G_Efficiency(); + this.NCC_analysis(); + } + + if(fileRepeat || fileNotExist || analysisDataStoreFlag){ + storeFlag = "Error"; + } + analysisLog.append(rowFormat(storeResult,storeFlag)); + analysisLog.append(System.lineSeparator()).append(System.lineSeparator()); + analysisLog.append(rowFormat(storeStatus,storeFlag,spectrumHandler.status)); + analysisLog.append(System.lineSeparator()).append(System.lineSeparator()); + analysisLog.append(titleFormat(analysisResultsEnd,25,StringConstant.DASH,storeFlag,endAnalysisTime,StringConstant.DASH)); + analysisLog.append(System.lineSeparator()).append(System.lineSeparator()).append(System.lineSeparator()); } - analysisLog.append(rowFormat(storeResult,storeFlag)); - analysisLog.append(System.lineSeparator()).append(System.lineSeparator()); - analysisLog.append(rowFormat(storeStatus,storeFlag,spectrumHandler.status)); - analysisLog.append(System.lineSeparator()).append(System.lineSeparator()); - analysisLog.append(titleFormat(analysisResultsEnd,25,StringConstant.DASH,storeFlag,endAnalysisTime,StringConstant.DASH)); - analysisLog.append(System.lineSeparator()).append(System.lineSeparator()).append(System.lineSeparator()); } /** diff --git a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/Sample_B_Analysis.java b/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/Sample_B_Analysis.java index 92967311..dac87c66 100644 --- a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/Sample_B_Analysis.java +++ b/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/Sample_B_Analysis.java @@ -225,10 +225,10 @@ public class Sample_B_Analysis implements BlockConstant { private void autoAnalyse() throws BAnalyseException, FileNotExistException { BgAnalyseResult analyseResult = EnergySpectrumHandler.bgAnalyse(this.sampleFileFinalPath,this.gasFileFinalPath,this.detFileFinalPath); System.out.println(analyseResult); + this.analyseResult = analyseResult; if(Objects.isNull(analyseResult) || !analyseResult.analyse_flag){ throw new BAnalyseException("THE PHD file cannot be parsed:"+this.sampleFileFinalPath+","+this.gasFileFinalPath+","+this.detFileFinalPath); } - this.analyseResult = analyseResult; } /**