From 5f2bb475cb483c3c76b26e41c12640022941f6f7 Mon Sep 17 00:00:00 2001 From: hzj <826100833@qq.com> Date: Tue, 11 Mar 2025 10:04:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9A=82=E6=80=81=E4=BA=8B=E4=BB=B6=E8=BE=BD?= =?UTF-8?q?=E5=AE=81=E6=96=87=E4=BB=B6=E5=90=8E=E7=BC=80=E9=80=82=E9=85=8D?= =?UTF-8?q?=E5=A4=A7=E5=B0=8F=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../majornetwork/Impl/TransientServiceImpl.java | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/TransientServiceImpl.java b/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/TransientServiceImpl.java index ea32cd454..111068d59 100644 --- a/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/TransientServiceImpl.java +++ b/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/TransientServiceImpl.java @@ -196,7 +196,7 @@ public class TransientServiceImpl implements TransientService { ip = monitorVO.getIp(); } String waveName = eventDetail.getWavePath(); - String cfgPath, datPath; + String cfgPath, datPath,cfgPath2,datPath2; if (generalInfo.getBusinessWaveFileStorage() == GeneralConstant.LOCAL_DISK) { cfgPath = generalInfo.getBusinessWavePath() + File.separator + ip + File.separator + waveName + GeneralConstant.CFG; datPath = generalInfo.getBusinessWavePath() + File.separator + ip + File.separator + waveName + GeneralConstant.DAT; @@ -210,6 +210,9 @@ public class TransientServiceImpl implements TransientService { } else { cfgPath = OssPath.WAVE_DIR + ip + StrUtil.SLASH + waveName + GeneralConstant.CFG; 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); try ( InputStream cfgStream = fileStorageUtil.getFileStream(cfgPath); @@ -220,7 +223,17 @@ public class TransientServiceImpl implements TransientService { } waveDataDTO = waveFileComponent.getComtrade(cfgStream, datStream, 1); } 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);