fix: 空数据时接口报错

This commit is contained in:
2023-11-27 18:30:57 +08:00
parent 098077e325
commit d0f3777d4a
2 changed files with 22 additions and 14 deletions
@@ -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);
}
}
}