diff --git a/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/EventDetailServiceImpl.java b/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/EventDetailServiceImpl.java index 0156f891c..b0c7b29fb 100644 --- a/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/EventDetailServiceImpl.java +++ b/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/EventDetailServiceImpl.java @@ -186,29 +186,31 @@ public class EventDetailServiceImpl extends ServiceImpl dept = new HashSet<>(); - dept.add(id); - DeptGetLineParam deptGetLineParam = new DeptGetLineParam(); - deptGetLineParam.setDeptId(id); - List deptList = commTerminalGeneralClient.getDeptChildrenByParent(deptGetLineParam).getData(); - if (CollectionUtil.isNotEmpty(deptList)) { - deptList.forEach(item->{ - dept.addAll(item.getUnitChildrenList()); - }); + if(Objects.nonNull(deptLine)){ + String id = deptLine.getId(); + Set dept = new HashSet<>(); + dept.add(id); + DeptGetLineParam deptGetLineParam = new DeptGetLineParam(); + deptGetLineParam.setDeptId(id); + List deptList = commTerminalGeneralClient.getDeptChildrenByParent(deptGetLineParam).getData(); + if (CollectionUtil.isNotEmpty(deptList)) { + deptList.forEach(item->{ + dept.addAll(item.getUnitChildrenList()); + }); + } + SendEventVO vo = new SendEventVO(); + vo.setDeptList(dept); + vo.setTime(po.getStartTime()); + vo.setEventValue(po.getFeatureAmplitude()); + vo.setPersistTime(po.getDuration()); + vo.setEventType(po.getEventType()); + vo.setEventReason(po.getAdvanceReason()); + List lineInfoVOList = lineFeignClient.getBaseLineAreaInfo(Collections.singletonList(po.getLineId())).getData(); + vo.setLineName(lineInfoVOList.get(0).getLineName()); + vo.setPowerCompany(lineInfoVOList.get(0).getGdName()); + vo.setSubstation(lineInfoVOList.get(0).getSubName()); + publisher.send("/sendEvent", PubUtils.obj2json(vo), 1, false); } - SendEventVO vo = new SendEventVO(); - vo.setDeptList(dept); - vo.setTime(po.getStartTime()); - vo.setEventValue(po.getFeatureAmplitude()); - vo.setPersistTime(po.getDuration()); - vo.setEventType(po.getEventType()); - vo.setEventReason(po.getAdvanceReason()); - List lineInfoVOList = lineFeignClient.getBaseLineAreaInfo(Collections.singletonList(po.getLineId())).getData(); - vo.setLineName(lineInfoVOList.get(0).getLineName()); - vo.setPowerCompany(lineInfoVOList.get(0).getGdName()); - vo.setSubstation(lineInfoVOList.get(0).getSubName()); - publisher.send("/sendEvent", PubUtils.obj2json(vo), 1, false); } public String eventTypeReflection(Integer eventType){