自动处理文件名称重命名错误问题修改

This commit is contained in:
qiaoqinzheng 2024-01-25 14:15:04 +08:00
parent 8c5f85b499
commit 39348f16f3

View File

@ -157,12 +157,9 @@ public abstract class AbstractS_D_Q_G_SpectrumHandler extends AbstractSpectrumHa
@Override
protected void updateSpectrumFileName() throws FileNotFoundException {
StringBuilder newFileName = new StringBuilder();
newFileName.append(this.sourceData.detector_code);
newFileName.append(StringConstant.DASH);
newFileName.append(StringUtils.replace(this.sourceData.acquisition_start_date,StringConstant.SLASH,""));
newFileName.append(StringConstant.UNDER_LINE);
newFileName.append(StringUtils.replace(this.sourceData.acquisition_start_time.substring(0,this.sourceData.acquisition_start_time.lastIndexOf(":")),":",""));
newFileName.append(super.spectrumServiceQuotes.getNameStandUtil().GetSuffix(super.currDataType.getType(),this.sourceData.spectrum_quantity,String.valueOf(this.sourceData.acquisition_live_time)));
String suffix = super.spectrumServiceQuotes.getNameStandUtil().GetSuffix(super.currDataType.getType(), this.sourceData.spectrum_quantity, String.valueOf(this.sourceData.acquisition_live_time));
String newName = super.spectrumServiceQuotes.getNameStandUtil().GetFileNameFromDateTime(this.sourceData.measurement_id, suffix);
newFileName.append(newName);
if(!super.spectrumFile.exists()){
//发送格式化错误事件后续统计报告使用
spectrumServiceQuotes.getApplicationContext().publishEvent(new FormatErrorEvent());