Browse Source

查询开关运行数据getBeakerSvgInfoVOByPsrId新增异常捕获

liruikang 6 months ago
parent
commit
5712c42dba

+ 12 - 8
services/load-transfer-bf/src/main/java/com/hdkj/lt/bf/service/impl/FhzgSvgBreakersServiceImpl.java

@@ -719,7 +719,7 @@ public class FhzgSvgBreakersServiceImpl implements FhzgSvgBreakersService {
      */
     @Override
     public BeakerSvgInfoVO getBeakerSvgInfoVOByPsrId(BeakerStatusDTO dto) {
-        List<StateEstimation.StateEstimationSwitchResult> periodSwitchSeResult;
+        List<StateEstimation.StateEstimationSwitchResult> periodSwitchSeResult = new ArrayList<>();
         DwdShbDsFeederBase dwdShbDsFeederBase = dwdShbDsFeederBaseService.getByPsrId(dto.getLinePsrId());
         if (ObjectUtil.isNull(dwdShbDsFeederBase)) {
             ExceptionCast.cast("线路不存在");
@@ -732,13 +732,17 @@ public class FhzgSvgBreakersServiceImpl implements FhzgSvgBreakersService {
         if (s != null) {
             periodSwitchSeResult = s.getPeriodSwitchSeResult();
         } else {
-            periodSwitchSeResult = iStateEstimationApiClient.queryByFeederSave(StateEstimationRequest.builder()
-                    .psrIds(Collections.singletonList(dto.getLinePsrId()))
-                    .containerCode(Collections.singletonList(CommonConstant.SWITCH))
-                    .startTime(dto.getTime())
-                    .endTime(dto.getTime())
-                    .isAuto(Boolean.FALSE)
-                    .build()).getData().getPeriodSwitchSeResult();
+            try {
+                periodSwitchSeResult = iStateEstimationApiClient.queryByFeederSave(StateEstimationRequest.builder()
+                        .psrIds(Collections.singletonList(dto.getLinePsrId()))
+                        .containerCode(Collections.singletonList(CommonConstant.SWITCH))
+                        .startTime(dto.getTime())
+                        .endTime(dto.getTime())
+                        .isAuto(Boolean.FALSE)
+                        .build()).getData().getPeriodSwitchSeResult();
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
         }
         BeakerSvgInfoVO beakerSvgInfoVO = BeakerSvgInfoVO.builder().breakerPsrId(dto.getPsrId()).build();
         if (CollectionUtils.isNotEmpty(periodSwitchSeResult)) {