fix:1.添加在原始库之前解析失败时生成日志功能报错会把真实报错顶掉问题
This commit is contained in:
parent
c697b8da71
commit
fd3e341fbc
|
@ -57,10 +57,6 @@ public abstract class AbstractS_D_Q_G_SpectrumHandler extends AbstractSpectrumHa
|
||||||
* 能谱文件处理状态,默认为:未处理
|
* 能谱文件处理状态,默认为:未处理
|
||||||
*/
|
*/
|
||||||
protected String status = SampleStatus.UNTREATED.getValue();
|
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.spectrumServiceQuotes.getTransactionManager().commit(transactionStatus);
|
||||||
this.isStoreSuccess = true;
|
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
//回滚事务
|
//回滚事务
|
||||||
spectrumServiceQuotes.getTransactionManager().rollback(transactionStatus);
|
spectrumServiceQuotes.getTransactionManager().rollback(transactionStatus);
|
||||||
|
|
|
@ -3,8 +3,6 @@ package org.jeecg.modules.spectrum;
|
||||||
import cn.hutool.core.io.FileUtil;
|
import cn.hutool.core.io.FileUtil;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
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.common.properties.SpectrumPathProperties;
|
||||||
import org.jeecg.modules.base.enums.DataType;
|
import org.jeecg.modules.base.enums.DataType;
|
||||||
import org.jeecg.modules.file.FileOperation;
|
import org.jeecg.modules.file.FileOperation;
|
||||||
|
@ -12,7 +10,6 @@ import java.io.File;
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.UUID;
|
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();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,7 @@ public class DetbkphdSpectrum extends AbstractS_D_Q_G_SpectrumHandler {
|
||||||
super.handleParseingFailFile();
|
super.handleParseingFailFile();
|
||||||
throw e;
|
throw e;
|
||||||
}finally {
|
}finally {
|
||||||
if(Objects.nonNull(this.parsingProcessLog) && super.isStoreSuccess){
|
if(Objects.nonNull(this.parsingProcessLog)){
|
||||||
this.parsingProcessLog.handleLog();
|
this.parsingProcessLog.handleLog();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,7 +60,7 @@ public class GasbkphdSpectrum extends AbstractS_D_Q_G_SpectrumHandler {
|
||||||
super.handleParseingFailFile();
|
super.handleParseingFailFile();
|
||||||
throw e;
|
throw e;
|
||||||
}finally {
|
}finally {
|
||||||
if(Objects.nonNull(this.parsingProcessLog) && super.isStoreSuccess){
|
if(Objects.nonNull(this.parsingProcessLog)){
|
||||||
this.parsingProcessLog.handleLog();
|
this.parsingProcessLog.handleLog();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
* @return
|
||||||
|
@ -763,6 +780,10 @@ public class ParsingProcessLog extends AbstractAutoLogOrReport{
|
||||||
* 处理所有日志
|
* 处理所有日志
|
||||||
*/
|
*/
|
||||||
protected void handleLog() throws IOException {
|
protected void handleLog() throws IOException {
|
||||||
|
//生成日志前置检查
|
||||||
|
if(this.preCheck() == false){
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.handleStorageProcessLog();
|
this.handleStorageProcessLog();
|
||||||
if(DataType.SAMPLEPHD.getType().equals(this.spectrumHandler.currDataType.getType()) &&
|
if(DataType.SAMPLEPHD.getType().equals(this.spectrumHandler.currDataType.getType()) &&
|
||||||
this.spectrumHandler.sourceData.system_type.equals(SystemType.BETA.getType()) &&
|
this.spectrumHandler.sourceData.system_type.equals(SystemType.BETA.getType()) &&
|
||||||
|
|
|
@ -59,7 +59,7 @@ public class QcphdSpectrum extends AbstractS_D_Q_G_SpectrumHandler {
|
||||||
super.handleParseingFailFile();
|
super.handleParseingFailFile();
|
||||||
throw e;
|
throw e;
|
||||||
}finally {
|
}finally {
|
||||||
if(Objects.nonNull(this.parsingProcessLog) && super.isStoreSuccess){
|
if(Objects.nonNull(this.parsingProcessLog)){
|
||||||
this.parsingProcessLog.handleLog();
|
this.parsingProcessLog.handleLog();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,7 +62,7 @@ public class SamplephdSpectrum extends AbstractS_D_Q_G_SpectrumHandler {
|
||||||
super.handleParseingFailFile();
|
super.handleParseingFailFile();
|
||||||
throw e;
|
throw e;
|
||||||
}finally {
|
}finally {
|
||||||
if(Objects.nonNull(this.parsingProcessLog) && super.isStoreSuccess){
|
if(Objects.nonNull(this.parsingProcessLog)){
|
||||||
this.parsingProcessLog.handleLog();
|
this.parsingProcessLog.handleLog();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user