From 6c7ca8eb462cea85938a431bc6bb1c33d7d7349c Mon Sep 17 00:00:00 2001 From: hzj <826100833@qq.com> Date: Thu, 14 May 2026 10:53:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B3=A2=E5=BD=A2=E6=B7=BB=E5=8A=A0=E5=A4=A7?= =?UTF-8?q?=E5=B0=8F=E5=86=99=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/EventGateServiceImpl.java | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/cn-terminal/src/main/java/com/njcn/product/terminal/event/service/impl/EventGateServiceImpl.java b/cn-terminal/src/main/java/com/njcn/product/terminal/event/service/impl/EventGateServiceImpl.java index bc91a81..acd5568 100644 --- a/cn-terminal/src/main/java/com/njcn/product/terminal/event/service/impl/EventGateServiceImpl.java +++ b/cn-terminal/src/main/java/com/njcn/product/terminal/event/service/impl/EventGateServiceImpl.java @@ -59,21 +59,26 @@ public class EventGateServiceImpl implements EventGateService { if (StrUtil.isBlank(waveName)) { throw new BusinessException(WaveFileResponseEnum.ANALYSE_WAVE_NOT_FOUND); } - cfgPath = generalInfo.getBusinessWavePath()+ File.separator+pqLine.getIp()+"/"+waveName+".CFG"; - datPath = generalInfo.getBusinessWavePath()+ File.separator+pqLine.getIp()+"/"+waveName+".DAT"; + try { + cfgPath = generalInfo.getBusinessWavePath()+ File.separator+pqLine.getIp()+"/"+waveName+".CFG"; + datPath = generalInfo.getBusinessWavePath()+ File.separator+pqLine.getIp()+"/"+waveName+".DAT"; + cfgStream = waveFileComponent.getFileInputStreamByFilePath(cfgPath); + datStream = waveFileComponent.getFileInputStreamByFilePath(datPath); + log.info("本地磁盘波形文件路径----" + cfgPath); - cfgPath1 = generalInfo.getBusinessWavePath()+ File.separator+pqLine.getIp()+"/"+waveName+".cfg"; - datPath1 = generalInfo.getBusinessWavePath()+ File.separator+pqLine.getIp()+"/"+waveName+".dat"; - - log.info("本地磁盘波形文件路径----" + cfgPath); - cfgStream = waveFileComponent.getFileInputStreamByFilePath(cfgPath); - datStream = waveFileComponent.getFileInputStreamByFilePath(datPath); - if (Objects.isNull(cfgStream) || Objects.isNull(datStream)) { + }catch (Exception e){ + cfgPath1 = generalInfo.getBusinessWavePath()+ File.separator+pqLine.getIp()+"/"+waveName+".cfg"; + datPath1 = generalInfo.getBusinessWavePath()+ File.separator+pqLine.getIp()+"/"+waveName+".dat"; cfgStream = waveFileComponent.getFileInputStreamByFilePath(cfgPath1); datStream = waveFileComponent.getFileInputStreamByFilePath(datPath1); - if(Objects.isNull(cfgStream) || Objects.isNull(datStream)) { - throw new BusinessException(WaveFileResponseEnum.ANALYSE_WAVE_NOT_FOUND); - } + } + + + + if (Objects.isNull(cfgStream) || Objects.isNull(datStream)) { + + throw new BusinessException(WaveFileResponseEnum.ANALYSE_WAVE_NOT_FOUND); + } waveDataDTO = waveFileComponent.getComtrade(cfgStream, datStream, 1);