diff --git a/pqs-event/event-api/src/main/java/com/njcn/event/pojo/vo/DetailVO.java b/pqs-event/event-api/src/main/java/com/njcn/event/pojo/vo/DetailVO.java index 3e15230d9..796ff8271 100644 --- a/pqs-event/event-api/src/main/java/com/njcn/event/pojo/vo/DetailVO.java +++ b/pqs-event/event-api/src/main/java/com/njcn/event/pojo/vo/DetailVO.java @@ -5,7 +5,6 @@ import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; -import org.influxdb.annotation.Column; import java.io.Serializable; @@ -19,13 +18,13 @@ import java.io.Serializable; @NoArgsConstructor public class DetailVO extends AreaLineInfoVO implements Serializable { - @ApiModelProperty(name = "persistTime",value = "持续时间") + @ApiModelProperty(name = "duration",value = "持续时间") private Double duration; - @ApiModelProperty(value = "暂降类型(Event_Type)") + @ApiModelProperty(name = "advanceType",value = "暂降类型(Event_Type)") private String advanceType; - @ApiModelProperty(name = "eventValue",value = "特征幅值") + @ApiModelProperty(name = "featureAmplitude",value = "特征幅值") private Double featureAmplitude; @ApiModelProperty(name = "startTime",value = "发生时间") diff --git a/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/EventAnalysisServiceImpl.java b/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/EventAnalysisServiceImpl.java index ee23d2ec1..229938873 100644 --- a/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/EventAnalysisServiceImpl.java +++ b/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/EventAnalysisServiceImpl.java @@ -1488,6 +1488,8 @@ public class EventAnalysisServiceImpl implements EventAnalysisService { */ @Override public Page getMonitorEventAnalyseQuery(EventBaseParam eventBaseParam) { + List eventReasonList = dicDataFeignClient.getDicDataByTypeName(DicDataTypeEnum.EVENT_REASON.getName()).getData(); + List eventTypeList = dicDataFeignClient.getDicDataByTypeName(DicDataTypeEnum.EVENT_TYPE.getName()).getData(); //数据暂降查询 Page pageInfo = eventDetailService.page(new Page<>(eventBaseParam.getPageNum(), eventBaseParam.getPageSize()), new LambdaQueryWrapper() @@ -1498,7 +1500,7 @@ public class EventAnalysisServiceImpl implements EventAnalysisService { ); //获取关于监测点发电站相关信息 List areaLineList = lineFeignClient.getBaseLineAreaInfo(Arrays.asList(eventBaseParam.getLineId())).getData(); - if(CollectionUtil.isNotEmpty(areaLineList)){ + if(CollectionUtil.isEmpty(areaLineList)){ throw new BusinessException(EventResponseEnum.NOT_FOUND); } List waveTypeVOS = new ArrayList<>(); @@ -1529,6 +1531,30 @@ public class EventAnalysisServiceImpl implements EventAnalysisService { waveTypeVO.setLng(lineInfoVO.getLng()); waveTypeVO.setManufacturer(lineInfoVO.getManufacturer()); waveTypeVO.setVoltageScale(lineInfoVO.getVoltageScale()); + //查询字典表替换事件原因与事件类型的字符串 + if (waveTypeVO.getAdvanceReason() != null) { + for (DictData dictData : eventReasonList) { + //将字典数据id与VO中属性eventReason对应的字符串进行比较 + if (waveTypeVO.getAdvanceReason().equals(dictData.getId())) { + waveTypeVO.setAdvanceReason(dictData.getName()); + } + } + } else { + //抛出异常,当前暂态原因为空 + throw new BusinessException(EventResponseEnum.EVENT_REASON_NOT_FOUND); + } + + if (waveTypeVO.getAdvanceType() != null) { + for (DictData dictData : eventTypeList) { + //将字典数据id与VO中属性eventType对应的字符串进行比较 + if (waveTypeVO.getAdvanceType().equals(dictData.getId())) { + waveTypeVO.setAdvanceType(dictData.getName()); + } + } + } else { + //抛出异常,当前暂态类型为空 + throw new BusinessException(EventResponseEnum.EVENT_TYPE_NOT_FOUND); + } waveTypeVOS.add(waveTypeVO); } }