Merge remote-tracking branch 'origin/station' into station

This commit is contained in:
qiaoqinzheng 2023-10-26 10:05:31 +08:00
commit 7c23d956af
7 changed files with 25 additions and 21 deletions

View File

@ -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);

View File

@ -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();
}
}
}

View File

@ -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();
}
}

View File

@ -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();
}
}

View File

@ -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()) &&

View File

@ -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();
}
}

View File

@ -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();
}
}