暂态事件辽宁文件后缀适配大小写

This commit is contained in:
hzj
2025-03-11 10:04:38 +08:00
parent 64cf03d01c
commit 5f2bb475cb

View File

@@ -196,7 +196,7 @@ public class TransientServiceImpl implements TransientService {
ip = monitorVO.getIp(); ip = monitorVO.getIp();
} }
String waveName = eventDetail.getWavePath(); String waveName = eventDetail.getWavePath();
String cfgPath, datPath; String cfgPath, datPath,cfgPath2,datPath2;
if (generalInfo.getBusinessWaveFileStorage() == GeneralConstant.LOCAL_DISK) { if (generalInfo.getBusinessWaveFileStorage() == GeneralConstant.LOCAL_DISK) {
cfgPath = generalInfo.getBusinessWavePath() + File.separator + ip + File.separator + waveName + GeneralConstant.CFG; cfgPath = generalInfo.getBusinessWavePath() + File.separator + ip + File.separator + waveName + GeneralConstant.CFG;
datPath = generalInfo.getBusinessWavePath() + File.separator + ip + File.separator + waveName + GeneralConstant.DAT; datPath = generalInfo.getBusinessWavePath() + File.separator + ip + File.separator + waveName + GeneralConstant.DAT;
@@ -210,6 +210,9 @@ public class TransientServiceImpl implements TransientService {
} else { } else {
cfgPath = OssPath.WAVE_DIR + ip + StrUtil.SLASH + waveName + GeneralConstant.CFG; cfgPath = OssPath.WAVE_DIR + ip + StrUtil.SLASH + waveName + GeneralConstant.CFG;
datPath = OssPath.WAVE_DIR + ip + StrUtil.SLASH + waveName + GeneralConstant.DAT; datPath = OssPath.WAVE_DIR + ip + StrUtil.SLASH + waveName + GeneralConstant.DAT;
//适配文件后缀小写
cfgPath2 = OssPath.WAVE_DIR + ip + StrUtil.SLASH + waveName + GeneralConstant.CFG.toLowerCase();
datPath2 = OssPath.WAVE_DIR + ip + StrUtil.SLASH + waveName + GeneralConstant.DAT.toLowerCase();
log.info("文件服务器波形文件路径----"+cfgPath); log.info("文件服务器波形文件路径----"+cfgPath);
try ( try (
InputStream cfgStream = fileStorageUtil.getFileStream(cfgPath); InputStream cfgStream = fileStorageUtil.getFileStream(cfgPath);
@@ -220,7 +223,17 @@ public class TransientServiceImpl implements TransientService {
} }
waveDataDTO = waveFileComponent.getComtrade(cfgStream, datStream, 1); waveDataDTO = waveFileComponent.getComtrade(cfgStream, datStream, 1);
} catch (Exception e) { } catch (Exception e) {
throw new BusinessException(WaveFileResponseEnum.WAVE_DATA_INVALID); try {
InputStream cfgStream = fileStorageUtil.getFileStream(cfgPath2);
InputStream datStream = fileStorageUtil.getFileStream(datPath2);
if (Objects.isNull(cfgStream) || Objects.isNull(datStream)) {
throw new BusinessException(WaveFileResponseEnum.ANALYSE_WAVE_NOT_FOUND);
}
waveDataDTO = waveFileComponent.getComtrade(cfgStream, datStream, 1);
}catch (Exception e1){
throw new BusinessException(WaveFileResponseEnum.WAVE_DATA_INVALID);
}
} }
} }
waveDataDTO = waveFileComponent.getValidData(waveDataDTO); waveDataDTO = waveFileComponent.getValidData(waveDataDTO);