From fd3e341fbc2bddfd18d4915649532c8fdf04dcdb Mon Sep 17 00:00:00 2001 From: panbaolin <123456> Date: Thu, 26 Oct 2023 09:40:48 +0800 Subject: [PATCH] =?UTF-8?q?fix:1.=E6=B7=BB=E5=8A=A0=E5=9C=A8=E5=8E=9F?= =?UTF-8?q?=E5=A7=8B=E5=BA=93=E4=B9=8B=E5=89=8D=E8=A7=A3=E6=9E=90=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E6=97=B6=E7=94=9F=E6=88=90=E6=97=A5=E5=BF=97=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E6=8A=A5=E9=94=99=E4=BC=9A=E6=8A=8A=E7=9C=9F=E5=AE=9E?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E9=A1=B6=E6=8E=89=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AbstractS_D_Q_G_SpectrumHandler.java | 5 ----- .../spectrum/AbstractSpectrumHandler.java | 12 ----------- .../modules/spectrum/DetbkphdSpectrum.java | 2 +- .../modules/spectrum/GasbkphdSpectrum.java | 2 +- .../modules/spectrum/ParsingProcessLog.java | 21 +++++++++++++++++++ .../jeecg/modules/spectrum/QcphdSpectrum.java | 2 +- .../modules/spectrum/SamplephdSpectrum.java | 2 +- 7 files changed, 25 insertions(+), 21 deletions(-) diff --git a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/AbstractS_D_Q_G_SpectrumHandler.java b/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/AbstractS_D_Q_G_SpectrumHandler.java index 8c34be87..452c4a12 100644 --- a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/AbstractS_D_Q_G_SpectrumHandler.java +++ b/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/AbstractS_D_Q_G_SpectrumHandler.java @@ -57,10 +57,6 @@ public abstract class AbstractS_D_Q_G_SpectrumHandler extends AbstractSpectrumHa * 能谱文件处理状态,默认为:未处理 */ protected String status = SampleStatus.UNTREATED.getValue(); - /** - * 原始库是否存储成功 - */ - protected boolean isStoreSuccess = false; /** * 前置检查 @@ -184,7 +180,6 @@ public abstract class AbstractS_D_Q_G_SpectrumHandler extends AbstractSpectrumHa } //提交事务 this.spectrumServiceQuotes.getTransactionManager().commit(transactionStatus); - this.isStoreSuccess = true; }catch (Exception e){ //回滚事务 spectrumServiceQuotes.getTransactionManager().rollback(transactionStatus); diff --git a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/AbstractSpectrumHandler.java b/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/AbstractSpectrumHandler.java index 40d5ad77..a0bbb36a 100644 --- a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/AbstractSpectrumHandler.java +++ b/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/AbstractSpectrumHandler.java @@ -3,8 +3,6 @@ package org.jeecg.modules.spectrum; import cn.hutool.core.io.FileUtil; import com.google.common.collect.Lists; import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.RandomUtils; -import org.jeecg.common.constant.StringConstant; import org.jeecg.common.properties.SpectrumPathProperties; import org.jeecg.modules.base.enums.DataType; import org.jeecg.modules.file.FileOperation; @@ -12,7 +10,6 @@ import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.util.List; -import java.util.Objects; import java.util.UUID; /** @@ -220,13 +217,4 @@ public abstract class AbstractSpectrumHandler extends AbstractChain { } } } - - /** - * 删除本地临时文件 - */ - protected void deleteLocalTemporaryFile(){ - if(Objects.nonNull(spectrumFile) && spectrumFile.isFile() && spectrumFile.exists()){ - spectrumFile.delete(); - } - } } diff --git a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/DetbkphdSpectrum.java b/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/DetbkphdSpectrum.java index 18fa6920..3960744a 100644 --- a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/DetbkphdSpectrum.java +++ b/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/DetbkphdSpectrum.java @@ -58,7 +58,7 @@ public class DetbkphdSpectrum extends AbstractS_D_Q_G_SpectrumHandler { super.handleParseingFailFile(); throw e; }finally { - if(Objects.nonNull(this.parsingProcessLog) && super.isStoreSuccess){ + if(Objects.nonNull(this.parsingProcessLog)){ this.parsingProcessLog.handleLog(); } } diff --git a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/GasbkphdSpectrum.java b/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/GasbkphdSpectrum.java index 7492ad45..85c4bf14 100644 --- a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/GasbkphdSpectrum.java +++ b/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/GasbkphdSpectrum.java @@ -60,7 +60,7 @@ public class GasbkphdSpectrum extends AbstractS_D_Q_G_SpectrumHandler { super.handleParseingFailFile(); throw e; }finally { - if(Objects.nonNull(this.parsingProcessLog) && super.isStoreSuccess){ + if(Objects.nonNull(this.parsingProcessLog)){ this.parsingProcessLog.handleLog(); } } 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 15d06b7c..c698016a 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 @@ -741,6 +741,23 @@ public class ParsingProcessLog extends AbstractAutoLogOrReport{ } } + /** + * 前置检查 + */ + private boolean preCheck(){ + boolean flag = true; + if(Objects.isNull(spectrumHandler)){ + flag = false; + } + if(Objects.isNull(spectrumHandler.startIntoDatabaseTime) || Objects.isNull(spectrumHandler.endIntoDatabaseTime)){ + flag = false; + } + if(Objects.isNull(spectrumHandler.sampleData)){ + flag = false; + } + return flag; + } + /** * 处理存储流程日志 * @return @@ -763,6 +780,10 @@ public class ParsingProcessLog extends AbstractAutoLogOrReport{ * 处理所有日志 */ protected void handleLog() throws IOException { + //生成日志前置检查 + if(this.preCheck() == false){ + return; + } this.handleStorageProcessLog(); if(DataType.SAMPLEPHD.getType().equals(this.spectrumHandler.currDataType.getType()) && this.spectrumHandler.sourceData.system_type.equals(SystemType.BETA.getType()) && diff --git a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/QcphdSpectrum.java b/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/QcphdSpectrum.java index 37fe423b..d4dada10 100644 --- a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/QcphdSpectrum.java +++ b/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/QcphdSpectrum.java @@ -59,7 +59,7 @@ public class QcphdSpectrum extends AbstractS_D_Q_G_SpectrumHandler { super.handleParseingFailFile(); throw e; }finally { - if(Objects.nonNull(this.parsingProcessLog) && super.isStoreSuccess){ + if(Objects.nonNull(this.parsingProcessLog)){ this.parsingProcessLog.handleLog(); } } diff --git a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/SamplephdSpectrum.java b/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/SamplephdSpectrum.java index efc02304..44ba14f8 100644 --- a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/SamplephdSpectrum.java +++ b/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/SamplephdSpectrum.java @@ -62,7 +62,7 @@ public class SamplephdSpectrum extends AbstractS_D_Q_G_SpectrumHandler { super.handleParseingFailFile(); throw e; }finally { - if(Objects.nonNull(this.parsingProcessLog) && super.isStoreSuccess){ + if(Objects.nonNull(this.parsingProcessLog)){ this.parsingProcessLog.handleLog(); } }