Commit 9a462646 by 江和松

菜单APP端查询需要查询出树结构

parent 363c3378
...@@ -12,13 +12,7 @@ import com.baosight.iplat4j.core.ioc.spring.PlatApplicationContext; ...@@ -12,13 +12,7 @@ import com.baosight.iplat4j.core.ioc.spring.PlatApplicationContext;
import com.baosight.iplat4j.core.util.StringUtils; import com.baosight.iplat4j.core.util.StringUtils;
import com.baosight.xservices.xs.util.LoginUserDetails; import com.baosight.xservices.xs.util.LoginUserDetails;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList; import java.util.*;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
...@@ -574,12 +568,16 @@ public class AuthenticationInfo { ...@@ -574,12 +568,16 @@ public class AuthenticationInfo {
BigDecimal retLeaf = (BigDecimal)retResultMap.get("leaf"); BigDecimal retLeaf = (BigDecimal)retResultMap.get("leaf");
BigDecimal menuDecimal = new BigDecimal("2"); BigDecimal menuDecimal = new BigDecimal("2");
BigDecimal leafDecimal = new BigDecimal("1"); BigDecimal leafDecimal = new BigDecimal("1");
String parent = (String)retResultMap.get("parent");
if (retLeaf != null && menuDecimal.equals(retLeaf)) { if (retLeaf != null && menuDecimal.equals(retLeaf)) {
Map paramMap = new HashMap(); Map paramMap = new HashMap();
paramMap.put("node", retResultMap.get("label").toString()); paramMap.put("node", retResultMap.get("label").toString());
List childPageForMenu = getDao().query("XSMenu.queryForRecursiveChildPage", paramMap); List childPageForMenu = getDao().query("XSMenu.queryForRecursiveChildPage", paramMap);
boolean flag = false; boolean flag = false;
List childList = new LinkedList();
if (childPageForMenu != null && childPageForMenu.size() > 0) { if (childPageForMenu != null && childPageForMenu.size() > 0) {
//APP需要遍历所有子菜单
if(parent.equals("APP")){
label85: label85:
for(int j = 0; j < pageAuthList.size(); ++j) { for(int j = 0; j < pageAuthList.size(); ++j) {
Map pageAuthMap = (Map)pageAuthList.get(j); Map pageAuthMap = (Map)pageAuthList.get(j);
...@@ -588,12 +586,27 @@ public class AuthenticationInfo { ...@@ -588,12 +586,27 @@ public class AuthenticationInfo {
Map childPageMap = (Map)childPageForMenu.get(k); Map childPageMap = (Map)childPageForMenu.get(k);
if (childPageMap.get("label").toString().equals(pageAuthMap.get("label").toString())) { if (childPageMap.get("label").toString().equals(pageAuthMap.get("label").toString())) {
flag = true; flag = true;
childList.add(pageAuthMap);
}
}
}
}else{
label85:
for(int j = 0; j < pageAuthList.size(); ++j) {
Map pageAuthMap = (Map)pageAuthList.get(j);
for(int k = 0; k < childPageForMenu.size(); ++k) {
Map childPageMap = (Map)childPageForMenu.get(k);
if (childPageMap.get("label").toString().equals(pageAuthMap.get("label").toString())) {
flag = true;
childList.add(pageAuthMap);
break label85; break label85;
} }
} }
} }
} }
retResultMap.put("childMenu",childList);
}
if (flag) { if (flag) {
menuAndPageListForTree.add(retResultMap); menuAndPageListForTree.add(retResultMap);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment