fix:1.修改能谱解析完成后再移动能谱文件
This commit is contained in:
parent
f266a98bb2
commit
ad90c521d0
|
@ -169,6 +169,9 @@ public abstract class AbstractS_D_Q_G_SpectrumHandler extends AbstractSpectrumHa
|
||||||
throw new FileNotFoundException(super.spectrumFile.getAbsolutePath()+" does not exist");
|
throw new FileNotFoundException(super.spectrumFile.getAbsolutePath()+" does not exist");
|
||||||
}
|
}
|
||||||
super.spectrumFile = FileUtil.rename(super.spectrumFile, newFileName.toString(), true);
|
super.spectrumFile = FileUtil.rename(super.spectrumFile, newFileName.toString(), true);
|
||||||
|
//设置能谱文件保存相对路径(包含文件名称)
|
||||||
|
String fileSavePath = this.getFileSaveRelativePath();
|
||||||
|
this.spectrumFileRelativePath = fileSavePath+File.separator+this.spectrumFile.getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -144,8 +144,6 @@ public abstract class AbstractSpectrumHandler extends AbstractChain {
|
||||||
* 保存能谱文件到savefile
|
* 保存能谱文件到savefile
|
||||||
*/
|
*/
|
||||||
protected void saveFileToSavefile() throws Exception{
|
protected void saveFileToSavefile() throws Exception{
|
||||||
//修改能谱文件名称
|
|
||||||
this.updateSpectrumFileName();
|
|
||||||
//获取文件保存路径
|
//获取文件保存路径
|
||||||
String fileSavePath = this.getFileSaveRelativePath();
|
String fileSavePath = this.getFileSaveRelativePath();
|
||||||
final SpectrumPathProperties properties = this.spectrumServiceQuotes.getSpectrumPathProperties();
|
final SpectrumPathProperties properties = this.spectrumServiceQuotes.getSpectrumPathProperties();
|
||||||
|
@ -159,8 +157,6 @@ public abstract class AbstractSpectrumHandler extends AbstractChain {
|
||||||
finalPath.append(this.spectrumFile.getName());
|
finalPath.append(this.spectrumFile.getName());
|
||||||
FileOperation.moveFile(this.spectrumFile,finalPath.toString(),true);
|
FileOperation.moveFile(this.spectrumFile,finalPath.toString(),true);
|
||||||
this.spectrumFile = new File(finalPath.toString());
|
this.spectrumFile = new File(finalPath.toString());
|
||||||
//设置能谱文件保存相对路径(包含文件名称)
|
|
||||||
this.spectrumFileRelativePath = fileSavePath+File.separator+this.spectrumFile.getName();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -256,7 +252,7 @@ public abstract class AbstractSpectrumHandler extends AbstractChain {
|
||||||
if (isDateFormatErr) {
|
if (isDateFormatErr) {
|
||||||
//修改能谱文件名称
|
//修改能谱文件名称
|
||||||
this.updateErrorSpectrumFileName();
|
this.updateErrorSpectrumFileName();
|
||||||
//解析失败会把文件移动到undeal目录
|
//解析失败会把文件移动到errorfile目录
|
||||||
final String rootPath = spectrumServiceQuotes.getSpectrumPathProperties().getRootPath();
|
final String rootPath = spectrumServiceQuotes.getSpectrumPathProperties().getRootPath();
|
||||||
final String errorFilePath = spectrumServiceQuotes.getSpectrumPathProperties().getErrorFilePath();
|
final String errorFilePath = spectrumServiceQuotes.getSpectrumPathProperties().getErrorFilePath();
|
||||||
final String finalPath = rootPath+File.separator+errorFilePath;
|
final String finalPath = rootPath+File.separator+errorFilePath;
|
||||||
|
@ -266,11 +262,13 @@ public abstract class AbstractSpectrumHandler extends AbstractChain {
|
||||||
final String rootPath = spectrumServiceQuotes.getSpectrumPathProperties().getRootPath();
|
final String rootPath = spectrumServiceQuotes.getSpectrumPathProperties().getRootPath();
|
||||||
final String undealPath = spectrumServiceQuotes.getSpectrumPathProperties().getUndealPath();
|
final String undealPath = spectrumServiceQuotes.getSpectrumPathProperties().getUndealPath();
|
||||||
final String finalPath = rootPath+File.separator+undealPath;
|
final String finalPath = rootPath+File.separator+undealPath;
|
||||||
FileOperation.copyFile(spectrumFile,finalPath,true);
|
FileOperation.moveFile(spectrumFile,finalPath,true);
|
||||||
}
|
}
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
|
}else if(SpectrumSource.FROM_FILE_SOURCE.getSourceType().equals(spectrumSource) && (e instanceof FileRepeatException)){
|
||||||
|
this.spectrumFile.delete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -78,10 +78,12 @@ public class AlertSpectrum extends AbstractSpectrumHandler{
|
||||||
super.printCurrDataType();
|
super.printCurrDataType();
|
||||||
//解析邮件内容
|
//解析邮件内容
|
||||||
this.parseingEmail();
|
this.parseingEmail();
|
||||||
//保存PHD文件到savefile
|
//修改能谱文件名称
|
||||||
super.saveFileToSavefile();
|
this.updateSpectrumFileName();
|
||||||
//结构体数据入库
|
//结构体数据入库
|
||||||
this.handlerOriginalData();
|
this.handlerOriginalData();
|
||||||
|
//保存PHD文件到savefile
|
||||||
|
super.saveFileToSavefile();
|
||||||
//若本次文件来自于undel目录,解析成功则删除
|
//若本次文件来自于undel目录,解析成功则删除
|
||||||
deleteIfFromUndelFile();
|
deleteIfFromUndelFile();
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
|
@ -149,6 +151,9 @@ public class AlertSpectrum extends AbstractSpectrumHandler{
|
||||||
throw new FileNotFoundException(super.spectrumFile.getAbsolutePath()+" does not exist");
|
throw new FileNotFoundException(super.spectrumFile.getAbsolutePath()+" does not exist");
|
||||||
}
|
}
|
||||||
super.spectrumFile = FileOperation.rename(super.spectrumFile,newFileName.toString(),true);
|
super.spectrumFile = FileOperation.rename(super.spectrumFile,newFileName.toString(),true);
|
||||||
|
//设置能谱文件保存相对路径(包含文件名称)
|
||||||
|
String fileSavePath = this.getFileSaveRelativePath();
|
||||||
|
this.spectrumFileRelativePath = fileSavePath+File.separator+this.spectrumFile.getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -38,10 +38,12 @@ public class DetbkphdSpectrum extends AbstractS_D_Q_G_SpectrumHandler {
|
||||||
super.parseingEmail();
|
super.parseingEmail();
|
||||||
//读取邮件内容标签
|
//读取邮件内容标签
|
||||||
super.readFileLabel();
|
super.readFileLabel();
|
||||||
//保存PHD文件到savefile
|
//修改能谱文件名称
|
||||||
super.saveFileToSavefile();
|
super.updateSpectrumFileName();
|
||||||
//结构体数据入库
|
//结构体数据入库
|
||||||
super.handlerOriginalData();
|
super.handlerOriginalData();
|
||||||
|
//保存PHD文件到savefile
|
||||||
|
super.saveFileToSavefile();
|
||||||
//修改状态为解析完成
|
//修改状态为解析完成
|
||||||
super.status = SampleStatus.COMPLETE.getValue();
|
super.status = SampleStatus.COMPLETE.getValue();
|
||||||
super.updateStatus();
|
super.updateStatus();
|
||||||
|
@ -54,7 +56,7 @@ public class DetbkphdSpectrum extends AbstractS_D_Q_G_SpectrumHandler {
|
||||||
super.status = SampleStatus.FAIL.getValue();
|
super.status = SampleStatus.FAIL.getValue();
|
||||||
super.updateStatus();
|
super.updateStatus();
|
||||||
|
|
||||||
//处理解析失败的文件,上传到undeal目录
|
//处理解析失败的文件
|
||||||
super.handleParseingFailFile(e);
|
super.handleParseingFailFile(e);
|
||||||
throw e;
|
throw e;
|
||||||
}finally {
|
}finally {
|
||||||
|
|
|
@ -40,10 +40,12 @@ public class GasbkphdSpectrum extends AbstractS_D_Q_G_SpectrumHandler {
|
||||||
super.parseingEmail();
|
super.parseingEmail();
|
||||||
//读取邮件内容标签
|
//读取邮件内容标签
|
||||||
super.readFileLabel();
|
super.readFileLabel();
|
||||||
//保存PHD文件到savefile
|
//修改能谱文件名称
|
||||||
super.saveFileToSavefile();
|
super.updateSpectrumFileName();
|
||||||
//结构体数据入库
|
//结构体数据入库
|
||||||
super.handlerOriginalData();
|
super.handlerOriginalData();
|
||||||
|
//保存PHD文件到savefile
|
||||||
|
super.saveFileToSavefile();
|
||||||
//修改状态为解析完成
|
//修改状态为解析完成
|
||||||
super.status = SampleStatus.COMPLETE.getValue();
|
super.status = SampleStatus.COMPLETE.getValue();
|
||||||
super.updateStatus();
|
super.updateStatus();
|
||||||
|
@ -56,7 +58,7 @@ public class GasbkphdSpectrum extends AbstractS_D_Q_G_SpectrumHandler {
|
||||||
super.status = SampleStatus.FAIL.getValue();
|
super.status = SampleStatus.FAIL.getValue();
|
||||||
super.updateStatus();
|
super.updateStatus();
|
||||||
|
|
||||||
//处理解析失败的文件,上传到undeal目录
|
//处理解析失败的文件
|
||||||
super.handleParseingFailFile(e);
|
super.handleParseingFailFile(e);
|
||||||
throw e;
|
throw e;
|
||||||
}finally {
|
}finally {
|
||||||
|
|
|
@ -78,10 +78,12 @@ public class HealthStatusSpectrum extends AbstractSpectrumHandler{
|
||||||
super.printCurrDataType();
|
super.printCurrDataType();
|
||||||
//解析邮件内容
|
//解析邮件内容
|
||||||
this.parseingEmail();
|
this.parseingEmail();
|
||||||
//保存PHD文件到savefile
|
//修改能谱文件名称
|
||||||
super.saveFileToSavefile();
|
this.updateSpectrumFileName();
|
||||||
//结构体数据入库
|
//结构体数据入库
|
||||||
this.handlerOriginalData();
|
this.handlerOriginalData();
|
||||||
|
//保存PHD文件到savefile
|
||||||
|
super.saveFileToSavefile();
|
||||||
//把流程日志保存到日志目录
|
//把流程日志保存到日志目录
|
||||||
this.saveLogToLogDir();
|
this.saveLogToLogDir();
|
||||||
//若本次文件来自于undel目录,解析成功则删除
|
//若本次文件来自于undel目录,解析成功则删除
|
||||||
|
@ -149,6 +151,9 @@ public class HealthStatusSpectrum extends AbstractSpectrumHandler{
|
||||||
throw new FileNotFoundException(super.spectrumFile.getAbsolutePath()+" does not exist");
|
throw new FileNotFoundException(super.spectrumFile.getAbsolutePath()+" does not exist");
|
||||||
}
|
}
|
||||||
super.spectrumFile = FileOperation.rename(super.spectrumFile,newFileName.toString(),true);
|
super.spectrumFile = FileOperation.rename(super.spectrumFile,newFileName.toString(),true);
|
||||||
|
//设置能谱文件保存相对路径(包含文件名称)
|
||||||
|
String fileSavePath = this.getFileSaveRelativePath();
|
||||||
|
this.spectrumFileRelativePath = fileSavePath+File.separator+this.spectrumFile.getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -68,10 +68,12 @@ public class MetSpectrum extends AbstractSpectrumHandler{
|
||||||
super.printCurrDataType();
|
super.printCurrDataType();
|
||||||
//解析邮件内容
|
//解析邮件内容
|
||||||
this.parseingEmail();
|
this.parseingEmail();
|
||||||
//保存PHD文件到savefile
|
//修改能谱文件名称
|
||||||
super.saveFileToSavefile();
|
this.updateSpectrumFileName();
|
||||||
//结构体数据入库
|
//结构体数据入库
|
||||||
this.handlerOriginalData();
|
this.handlerOriginalData();
|
||||||
|
//保存PHD文件到savefile
|
||||||
|
super.saveFileToSavefile();
|
||||||
//把流程日志保存到日志目录
|
//把流程日志保存到日志目录
|
||||||
this.saveLogToLogDir();
|
this.saveLogToLogDir();
|
||||||
//若本次文件来自于undel目录,解析成功则删除
|
//若本次文件来自于undel目录,解析成功则删除
|
||||||
|
@ -138,6 +140,9 @@ public class MetSpectrum extends AbstractSpectrumHandler{
|
||||||
throw new FileNotFoundException(super.spectrumFile.getAbsolutePath()+" does not exist");
|
throw new FileNotFoundException(super.spectrumFile.getAbsolutePath()+" does not exist");
|
||||||
}
|
}
|
||||||
super.spectrumFile = FileOperation.rename(super.spectrumFile,newFileName.toString(),true);
|
super.spectrumFile = FileOperation.rename(super.spectrumFile,newFileName.toString(),true);
|
||||||
|
//设置能谱文件保存相对路径(包含文件名称)
|
||||||
|
String fileSavePath = this.getFileSaveRelativePath();
|
||||||
|
this.spectrumFileRelativePath = fileSavePath+File.separator+this.spectrumFile.getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -39,10 +39,12 @@ public class QcphdSpectrum extends AbstractS_D_Q_G_SpectrumHandler {
|
||||||
super.parseingEmail();
|
super.parseingEmail();
|
||||||
//读取邮件内容标签
|
//读取邮件内容标签
|
||||||
super.readFileLabel();
|
super.readFileLabel();
|
||||||
//保存PHD文件到savefile
|
//修改能谱文件名称
|
||||||
super.saveFileToSavefile();
|
super.updateSpectrumFileName();
|
||||||
//结构体数据入库
|
//结构体数据入库
|
||||||
super.handlerOriginalData();
|
super.handlerOriginalData();
|
||||||
|
//保存PHD文件到savefile
|
||||||
|
super.saveFileToSavefile();
|
||||||
//修改状态为解析完成
|
//修改状态为解析完成
|
||||||
super.status = SampleStatus.COMPLETE.getValue();
|
super.status = SampleStatus.COMPLETE.getValue();
|
||||||
super.updateStatus();
|
super.updateStatus();
|
||||||
|
@ -55,7 +57,7 @@ public class QcphdSpectrum extends AbstractS_D_Q_G_SpectrumHandler {
|
||||||
super.status = SampleStatus.FAIL.getValue();
|
super.status = SampleStatus.FAIL.getValue();
|
||||||
super.updateStatus();
|
super.updateStatus();
|
||||||
|
|
||||||
//处理解析失败的文件,上传到undeal目录
|
//处理解析失败的文件
|
||||||
super.handleParseingFailFile(e);
|
super.handleParseingFailFile(e);
|
||||||
throw e;
|
throw e;
|
||||||
}finally {
|
}finally {
|
||||||
|
|
|
@ -39,13 +39,14 @@ public class SamplephdSpectrum extends AbstractS_D_Q_G_SpectrumHandler {
|
||||||
super.parseingEmail();
|
super.parseingEmail();
|
||||||
//读取邮件内容标签
|
//读取邮件内容标签
|
||||||
super.readFileLabel();
|
super.readFileLabel();
|
||||||
//保存PHD文件到savefile
|
//修改能谱文件名称
|
||||||
super.saveFileToSavefile();
|
super.updateSpectrumFileName();
|
||||||
//结构体数据入库
|
//结构体数据入库
|
||||||
super.handlerOriginalData();
|
super.handlerOriginalData();
|
||||||
//进行B、G(P)谱分析
|
//进行B、G(P)谱分析
|
||||||
this.autoAnalysis();
|
this.autoAnalysis();
|
||||||
|
//保存PHD文件到savefile
|
||||||
|
super.saveFileToSavefile();
|
||||||
//修改状态为解析完成
|
//修改状态为解析完成
|
||||||
super.status = SampleStatus.COMPLETE.getValue();
|
super.status = SampleStatus.COMPLETE.getValue();
|
||||||
super.updateStatus();
|
super.updateStatus();
|
||||||
|
@ -58,7 +59,7 @@ public class SamplephdSpectrum extends AbstractS_D_Q_G_SpectrumHandler {
|
||||||
super.status = SampleStatus.FAIL.getValue();
|
super.status = SampleStatus.FAIL.getValue();
|
||||||
super.updateStatus();
|
super.updateStatus();
|
||||||
|
|
||||||
//处理解析失败的文件,上传到undeal目录
|
//处理解析失败的文件
|
||||||
super.handleParseingFailFile(e);
|
super.handleParseingFailFile(e);
|
||||||
throw e;
|
throw e;
|
||||||
}finally {
|
}finally {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user