diff --git a/pqs-advance/advance-boot/src/main/java/com/njcn/advance/event/service/impl/EventAdvanceServiceImpl.java b/pqs-advance/advance-boot/src/main/java/com/njcn/advance/event/service/impl/EventAdvanceServiceImpl.java index 83d8047ba..954340552 100644 --- a/pqs-advance/advance-boot/src/main/java/com/njcn/advance/event/service/impl/EventAdvanceServiceImpl.java +++ b/pqs-advance/advance-boot/src/main/java/com/njcn/advance/event/service/impl/EventAdvanceServiceImpl.java @@ -7,7 +7,6 @@ import com.njcn.advance.event.cause.model.DataFeature; import com.njcn.advance.event.type.jna.*; import com.njcn.advance.pojo.dto.EventAnalysisDTO; import com.njcn.advance.event.service.IEventAdvanceService; -import com.njcn.advance.pojo.dto.waveAnalysis.Rect; import com.njcn.advance.utils.Utils; import com.njcn.common.config.GeneralInfo; import com.njcn.common.pojo.exception.BusinessException; @@ -133,19 +132,7 @@ public class EventAdvanceServiceImpl implements IEventAdvanceService { } else { eventAnalysis.setType(DataFeature.TYPE10); } - String str = WriteData2File(typeDataStruct); - if (Objects.isNull(wlFilePath)) { - String hdrPath = OssPath.WAVE_DIR + ip+StrUtil.SLASH; - String hdrName = waveName + GeneralConstant.HDR_LOWER; - fileStorageUtil.uploadStreamSpecifyName(new ByteArrayInputStream(str.getBytes()),hdrPath,hdrName); - } else { - // comtrade/00:B7:8D:00:A8:7A/PQMonitor_PQM1_00100_20260204_162453_071_WAV.hdr - String fullPath = wlFilePath + GeneralConstant.HDR_LOWER; - int lastSlashIndex = fullPath.lastIndexOf('/'); - String hdrPath = fullPath.substring(0, lastSlashIndex + 1); - String hdrName = fullPath.substring(lastSlashIndex + 1); - fileStorageUtil.uploadStreamSpecifyName(new ByteArrayInputStream(str.getBytes()),hdrPath,hdrName); - } + System.out.println("结束qvvrdll方法调用-----------"); } catch (Exception e) { eventAnalysis.setType(DataFeature.TYPE10); @@ -174,12 +161,30 @@ public class EventAdvanceServiceImpl implements IEventAdvanceService { eventAnalysis.setCause(DataFeature.CAUSE_TYPE0); eventAnalysis.setCauseFlag(0); } + String str = null; + try { + str = WriteData2File(typeDataStruct,causeDataStruct); + } catch (Exception e) { + throw new RuntimeException(e); + } + if (Objects.isNull(wlFilePath)) { + String hdrPath = OssPath.WAVE_DIR + ip+StrUtil.SLASH; + String hdrName = waveName + GeneralConstant.HDR_LOWER; + fileStorageUtil.uploadStreamSpecifyName(new ByteArrayInputStream(str.getBytes()),hdrPath,hdrName); + } else { + // comtrade/00:B7:8D:00:A8:7A/PQMonitor_PQM1_00100_20260204_162453_071_WAV.hdr + String fullPath = wlFilePath + GeneralConstant.HDR_LOWER; + int lastSlashIndex = fullPath.lastIndexOf('/'); + String hdrPath = fullPath.substring(0, lastSlashIndex + 1); + String hdrName = fullPath.substring(lastSlashIndex + 1); + fileStorageUtil.uploadStreamSpecifyName(new ByteArrayInputStream(str.getBytes()),hdrPath,hdrName); + } System.out.println("暂降原因分析完毕==============="); System.out.println("cause:" + eventAnalysis); return eventAnalysis; } - public String WriteData2File(QvvrDLL.QvvrDataStruct rect) throws Exception { + public String WriteData2File(QvvrDLL.QvvrDataStruct rect, QvvrCauseDLL.QvvrDataStruct causeDataStruct) throws Exception { StringBuilder stringBuilder = new StringBuilder("{" + EnumEvt.NEWLINE.getProperty()); /** @@ -414,7 +419,7 @@ public class EventAdvanceServiceImpl implements IEventAdvanceService { */ for (int k = 0; k < rect.evt_buf[i].u_min_num; k++) { setEigenVlaue(k, stringBuilder, EnumEvt.QVVR_CATA_CAUSE.getProperty(), null, - rect.evt_buf[i].qvvr_cata_cause[k]); + causeDataStruct.cause); if (rect.evt_buf[i].u_min_num - 1 == k) { stringBuilder.delete(stringBuilder.lastIndexOf(","), stringBuilder.length() - 1); diff --git a/pqs-advance/advance-boot/src/main/java/com/njcn/advance/service/impl/EventWaveAnalysisServiceImpl.java b/pqs-advance/advance-boot/src/main/java/com/njcn/advance/service/impl/EventWaveAnalysisServiceImpl.java index 780af4430..22f956b75 100644 --- a/pqs-advance/advance-boot/src/main/java/com/njcn/advance/service/impl/EventWaveAnalysisServiceImpl.java +++ b/pqs-advance/advance-boot/src/main/java/com/njcn/advance/service/impl/EventWaveAnalysisServiceImpl.java @@ -81,6 +81,8 @@ public class EventWaveAnalysisServiceImpl implements EventWaveAnalysisService { //获取所有暂态原因 List dicDataList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.EVENT_TYPE.getCode()).getData(); Map eventTypeMap = dicDataList.stream().collect(Collectors.toMap(DictData::getAlgoDescribe, Function.identity())); + List reasonList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.EVENT_REASON.getCode()).getData(); + Map eventReasonMap = reasonList.stream().collect(Collectors.toMap(DictData::getAlgoDescribe, Function.identity())); InputStream inputStreamCfg; InputStream inputStreamDat; try { @@ -192,7 +194,7 @@ public class EventWaveAnalysisServiceImpl implements EventWaveAnalysisService { if (entityAdvancedData.backNumber > 0) { for (int i = 0; i < entityAdvancedData.backNumber; i++) { entityAdvancedData.sagType[i] = eventTypeMap.get(entityAdvancedData.evt_buf[i].qvvr_cata_type[0]).getName(); - + entityAdvancedData.sagReason[i]= eventReasonMap.get(entityAdvancedData.evt_buf[i].qvvr_cata_cause[0]).getName(); switch (entityAdvancedData.evt_buf[i].qvvr_phasetype[0]) { case 1: entityAdvancedData.sagPhaseType[i] = "单相";