diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarMenuStandard/service/impl/SarMenuStandardNewServiceNewImpl.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarMenuStandard/service/impl/SarMenuStandardNewServiceNewImpl.java index 9213a8d4..b297ba57 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarMenuStandard/service/impl/SarMenuStandardNewServiceNewImpl.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarMenuStandard/service/impl/SarMenuStandardNewServiceNewImpl.java @@ -208,7 +208,9 @@ public class SarMenuStandardNewServiceNewImpl extends ServiceImpl resource1.getParentId().equals(resource.getId())) .collect(Collectors.toList()); if (!tsResources.isEmpty()) { - tsResources = tsResources.stream().sorted(Comparator.comparing(resource1 -> resource1.getDisplaySeq())).collect(Collectors.toList()); - tsResources.forEach(resource1 -> { - resource1.setTreeType("sarMs"); - resource1.setChildren(recursionGetListChildrenStand((resource1), (children))); - }); + try { + tsResources = tsResources.stream().sorted(Comparator.comparing(resource1 -> resource1.getDisplaySeq())).collect(Collectors.toList()); + tsResources.forEach(resource1 -> { + resource1.setTreeType("sarMs"); + resource1.setChildren(recursionGetListChildrenStand((resource1), (children))); + }); + } catch (Exception e) { + log.error("异常"); + } } return tsResources; } diff --git a/adc-da-sys/src/main/java/com/adc/da/sys/sarMenuStandard/entity/SarMenuStandard.java b/adc-da-sys/src/main/java/com/adc/da/sys/sarMenuStandard/entity/SarMenuStandard.java index 356328b5..28e31571 100644 --- a/adc-da-sys/src/main/java/com/adc/da/sys/sarMenuStandard/entity/SarMenuStandard.java +++ b/adc-da-sys/src/main/java/com/adc/da/sys/sarMenuStandard/entity/SarMenuStandard.java @@ -147,14 +147,16 @@ public class SarMenuStandard extends BaseEntity { this.fbStandCount = countMatches(fbStandMenu, this.id, fbStandIdList); this.esStandCount = countMatches(esStandMenu, this.id, esStandIdList); - for (SarMenuStandard child : children) { - child.calculateAndSetCounts(gbStandMenu, fbStandMenu, esStandMenu, curLevel + 1); - this.gbStandCount += child.gbStandCount; - this.gbStandIdList.addAll(child.gbStandIdList); - this.fbStandCount += child.fbStandCount; - this.fbStandIdList.addAll(child.fbStandIdList); - this.esStandCount += child.esStandCount; - this.esStandIdList.addAll(child.esStandIdList); + if (children != null && !children.isEmpty()) { + for (SarMenuStandard child : children) { + child.calculateAndSetCounts(gbStandMenu, fbStandMenu, esStandMenu, curLevel + 1); + this.gbStandCount += child.gbStandCount; + this.gbStandIdList.addAll(child.gbStandIdList); + this.fbStandCount += child.fbStandCount; + this.fbStandIdList.addAll(child.fbStandIdList); + this.esStandCount += child.esStandCount; + this.esStandIdList.addAll(child.esStandIdList); + } } }