From 6732cd7a4e0fd7ea083d4ae11254bde35adb1ee4 Mon Sep 17 00:00:00 2001 From: xiejun <xj@2023> Date: 星期五, 17 十一月 2023 01:39:20 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- Source/UBCS/ubcs-service-api/ubcs-util-api/src/main/java/com/vci/ubcs/starter/web/pagemodel/Tree.java | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 49 insertions(+), 0 deletions(-) diff --git a/Source/UBCS/ubcs-service-api/ubcs-util-api/src/main/java/com/vci/ubcs/starter/web/pagemodel/Tree.java b/Source/UBCS/ubcs-service-api/ubcs-util-api/src/main/java/com/vci/ubcs/starter/web/pagemodel/Tree.java index bb09378..abaeb25 100644 --- a/Source/UBCS/ubcs-service-api/ubcs-util-api/src/main/java/com/vci/ubcs/starter/web/pagemodel/Tree.java +++ b/Source/UBCS/ubcs-service-api/ubcs-util-api/src/main/java/com/vci/ubcs/starter/web/pagemodel/Tree.java @@ -14,6 +14,8 @@ private static final long serialVersionUID = 6886695271635257882L; private String oid; private String text; + private String count; + private String name; private boolean leaf = false; private boolean showCheckbox = false; private boolean checked = false; @@ -28,6 +30,8 @@ private String index; private Map<String, String> attributes = new HashMap(); + + public Tree() { } @@ -36,12 +40,28 @@ this.setText(text); } + public String getCount() { + return count; + } + + public void setCount(String count) { + this.count = count; + } + public String getOid() { return this.oid; } public void setOid(String oid) { this.oid = oid; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; } public String getText() { @@ -198,6 +218,35 @@ } + public void findSystemClassChild(List<Tree> treenode, List<Tree> children) { + Tree node; + for(Iterator var3 = treenode.iterator(); var3.hasNext(); this.getChildren().add(node)) { + node = (Tree)var3.next(); + Iterator var5 = children.iterator(); + + while(var5.hasNext()) { + Tree childnode = (Tree)var5.next(); + if (node.getAttributes().get("classifyOid").equalsIgnoreCase(childnode.getParentId())) { + childnode.setParentName(node.getText()); + if (StringUtil.isBlank(childnode.getParentBtmName())) { + childnode.setParentBtmName((String)node.getAttributes().getOrDefault("btmname", "")); + } + + node.getChildren().add(childnode); + } + } + + if (node.getChildren().size() > 0) { + this.findSystemClassChild(node.getChildren(), children); + node.setLeaf(false); + } else { + node.setLeaf(true); + } + } + + } + + @Override public String toString() { return "Tree{oid='" + this.oid + '\'' + ", text='" + this.text + '\'' + ", leaf=" + this.leaf + ", showCheckbox=" + this.showCheckbox + ", checked=" + this.checked + ", children=" + this.children + ", icon='" + this.icon + '\'' + ", iconCls='" + this.iconCls + '\'' + ", parentId='" + this.parentId + '\'' + ", parentName='" + this.parentName + '\'' + ", parentBtmName='" + this.parentBtmName + '\'' + ", expanded=" + this.expanded + ", href='" + this.href + '\'' + ", index='" + this.index + '\'' + ", attributes=" + this.attributes + '}'; } -- Gitblit v1.9.3