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; } /**