自动处理增加逻辑判断,如果对应路径文件数据存在,判断数据状态如果是P,则抛出文件重复异常,如果是F,不进行处理,如果对应路径文件数据不存在,则正常存储数据
This commit is contained in:
parent
0a2a2c2260
commit
a48f162d1d
|
@ -224,9 +224,11 @@ public abstract class AbstractS_D_Q_G_SpectrumHandler extends AbstractSpectrumHa
|
|||
this.startIntoDatabaseTime = new Date();
|
||||
//如果数据已经存储,不在重复存储
|
||||
final GardsSampleData query = spectrumServiceQuotes.getSampleDataService().findByInputFileName(super.spectrumFileRelativePath);
|
||||
//如果数据已经存储 并且状态是 P 则判断文件重复 如果数据已经存储并且状态是 F 不进行处理
|
||||
if(Objects.nonNull(query)){
|
||||
this.sampleData = query;
|
||||
this.endIntoDatabaseTime = new Date();
|
||||
if (query.getStatus().equalsIgnoreCase(SampleStatus.COMPLETE.value)) {
|
||||
//设置文件重复标记为true
|
||||
this.parsingProcessLog.setFileRepeat(true);
|
||||
//发送文件重复错误事件,后续统计报告使用
|
||||
|
@ -234,6 +236,7 @@ public abstract class AbstractS_D_Q_G_SpectrumHandler extends AbstractSpectrumHa
|
|||
ErrorLogManager.getInstance().write(new SpectrumErrorEvent(new Date(),ErrorType.FILE_REPEAT.getContent(),super.spectrumFile.getName()));
|
||||
throw new FileRepeatException("file repeat");
|
||||
}
|
||||
} else if (Objects.isNull(query)) { // 如果没有查询出对应的数据 则对数据进行存储操作
|
||||
DataSourceSwitcher.switchToOracle();
|
||||
final TransactionStatus transactionStatus = spectrumServiceQuotes.getTransactionManager().getTransaction(spectrumServiceQuotes.getTransactionDefinition());
|
||||
try{
|
||||
|
@ -258,6 +261,7 @@ public abstract class AbstractS_D_Q_G_SpectrumHandler extends AbstractSpectrumHa
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改解析状态
|
||||
|
|
Loading…
Reference in New Issue
Block a user