fix:1.添加FileRepeat异常时文件不需放入undel目录

This commit is contained in:
panbaolin 2023-10-26 11:56:29 +08:00
parent 7c23d956af
commit aab5ee7d59
5 changed files with 15 additions and 6 deletions

View File

@ -5,6 +5,7 @@ import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
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.exception.FileRepeatException;
import org.jeecg.modules.file.FileOperation; import org.jeecg.modules.file.FileOperation;
import java.io.File; import java.io.File;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
@ -186,8 +187,8 @@ public abstract class AbstractSpectrumHandler extends AbstractChain {
* 处理解析失败的文件上传到undeal目录 * 处理解析失败的文件上传到undeal目录
* @throws FileNotFoundException * @throws FileNotFoundException
*/ */
protected void handleParseingFailFile() throws FileNotFoundException { protected void handleParseingFailFile(Exception e) throws FileNotFoundException {
if(!fromUndel){ if(!fromUndel && !(e instanceof FileRepeatException)){
try { try {
//解析失败会把文件移动到undeal目录 //解析失败会把文件移动到undeal目录
final String rootPath = spectrumServiceQuotes.getSpectrumPathProperties().getRootPath(); final String rootPath = spectrumServiceQuotes.getSpectrumPathProperties().getRootPath();

View File

@ -2,6 +2,8 @@ package org.jeecg.modules.spectrum;
import org.jeecg.modules.base.enums.DataType; import org.jeecg.modules.base.enums.DataType;
import org.jeecg.modules.base.enums.SampleStatus; import org.jeecg.modules.base.enums.SampleStatus;
import org.jeecg.modules.exception.FileRepeatException;
import java.util.Objects; import java.util.Objects;
/** /**
@ -55,7 +57,7 @@ public class DetbkphdSpectrum extends AbstractS_D_Q_G_SpectrumHandler {
super.updateStatus(); super.updateStatus();
//处理解析失败的文件上传到undeal目录 //处理解析失败的文件上传到undeal目录
super.handleParseingFailFile(); super.handleParseingFailFile(e);
throw e; throw e;
}finally { }finally {
if(Objects.nonNull(this.parsingProcessLog)){ if(Objects.nonNull(this.parsingProcessLog)){

View File

@ -3,6 +3,8 @@ package org.jeecg.modules.spectrum;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.base.enums.DataType; import org.jeecg.modules.base.enums.DataType;
import org.jeecg.modules.base.enums.SampleStatus; import org.jeecg.modules.base.enums.SampleStatus;
import org.jeecg.modules.exception.FileRepeatException;
import java.util.Objects; import java.util.Objects;
/** /**
@ -57,7 +59,7 @@ public class GasbkphdSpectrum extends AbstractS_D_Q_G_SpectrumHandler {
super.updateStatus(); super.updateStatus();
//处理解析失败的文件上传到undeal目录 //处理解析失败的文件上传到undeal目录
super.handleParseingFailFile(); super.handleParseingFailFile(e);
throw e; throw e;
}finally { }finally {
if(Objects.nonNull(this.parsingProcessLog)){ if(Objects.nonNull(this.parsingProcessLog)){

View File

@ -2,6 +2,8 @@ package org.jeecg.modules.spectrum;
import org.jeecg.modules.base.enums.DataType; import org.jeecg.modules.base.enums.DataType;
import org.jeecg.modules.base.enums.SampleStatus; import org.jeecg.modules.base.enums.SampleStatus;
import org.jeecg.modules.exception.FileRepeatException;
import java.util.Objects; import java.util.Objects;
/** /**
@ -56,7 +58,7 @@ public class QcphdSpectrum extends AbstractS_D_Q_G_SpectrumHandler {
super.updateStatus(); super.updateStatus();
//处理解析失败的文件上传到undeal目录 //处理解析失败的文件上传到undeal目录
super.handleParseingFailFile(); super.handleParseingFailFile(e);
throw e; throw e;
}finally { }finally {
if(Objects.nonNull(this.parsingProcessLog)){ if(Objects.nonNull(this.parsingProcessLog)){

View File

@ -3,6 +3,8 @@ package org.jeecg.modules.spectrum;
import org.jeecg.modules.base.enums.DataType; import org.jeecg.modules.base.enums.DataType;
import org.jeecg.modules.base.enums.SampleStatus; import org.jeecg.modules.base.enums.SampleStatus;
import org.jeecg.modules.base.enums.SystemType; import org.jeecg.modules.base.enums.SystemType;
import org.jeecg.modules.exception.FileRepeatException;
import java.util.Objects; import java.util.Objects;
/** /**
@ -59,7 +61,7 @@ public class SamplephdSpectrum extends AbstractS_D_Q_G_SpectrumHandler {
super.updateStatus(); super.updateStatus();
//处理解析失败的文件上传到undeal目录 //处理解析失败的文件上传到undeal目录
super.handleParseingFailFile(); super.handleParseingFailFile(e);
throw e; throw e;
}finally { }finally {
if(Objects.nonNull(this.parsingProcessLog)){ if(Objects.nonNull(this.parsingProcessLog)){