Commit 065eb453 authored by 李成龙's avatar 李成龙

Merge branch 'developer' of http://172.16.10.76/moa/amos-boot-biz into developer

parents b373d319 0774494d
...@@ -13,68 +13,6 @@ import java.util.List; ...@@ -13,68 +13,6 @@ import java.util.List;
* </PRE> * </PRE>
*/ */
public class TreeParser{ public class TreeParser{
// /**
// * 解析树形数据
// * @param topId
// * @param entityList
//
// */
// public static List<Menu> getTreeList(Long topId, Collection<DataDictionary> entityList) {
// List<Menu> resultList=new ArrayList<>();
//
// //获取顶层元素集合
// Long parentId;
// for (DataDictionary entity : entityList) {
// parentId=entity.getParent();
// if(parentId==null||topId==parentId){
// Menu menu=new Menu(Long.valueOf(entity.getCode()), entity.getName(), parentId);
// resultList.add(menu);
// }
// }
//
// //获取每个顶层元素的子数据集合
// for (Menu entity : resultList) {
// entity.setChildren(getSubList(entity.getId(),entityList));
// }
//
// return resultList;
// }
//
// /**
// * 获取子数据集合
// */
// private static List<Menu> getSubList(Long id, Collection<DataDictionary> entityList) {
// List<Menu> childList=new ArrayList<>();
// Long parentId;
//
// //子集的直接子对象
// for (DataDictionary entity : entityList) {
// parentId=entity.getParent();
// if(id.equals(parentId)){
// Menu menu=new Menu(Long.valueOf(entity.getCode()), entity.getName(), parentId);
// childList.add(menu);
// }
// }
//
// //子集的间接子对象
// for (Menu entity : childList) {
// entity.setChildren(getSubList(entity.getId(), entityList));
// }
//
// //递归退出条件
// if(childList.size()==0){
// return null;
// }
//
// return childList;
// }
/** /**
* @param topId 父id * @param topId 父id
* @param entityList 数据集合 * @param entityList 数据集合
...@@ -90,9 +28,10 @@ public class TreeParser{ ...@@ -90,9 +28,10 @@ public class TreeParser{
* </PRE> * </PRE>
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public static List<Menu> getTree(Long topId, Collection entityList,String packageURL,String IDMethodName,int IDHierarchy, String NAMEMethodName,String PARENTIDMethodName ) throws Exception{ public static List<Menu> getTree(Long topId, @SuppressWarnings("rawtypes") Collection entityList,String packageURL,String IDMethodName,int IDHierarchy, String NAMEMethodName,String PARENTIDMethodName ) throws Exception{
List<Menu> resultList=new ArrayList<>(); List<Menu> resultList=new ArrayList<>();
Class clazz= Class.forName(packageURL); @SuppressWarnings("rawtypes")
Class clazz= Class.forName(packageURL);
Method IDMethodNameme = null; Method IDMethodNameme = null;
switch (IDHierarchy) { case 1: switch (IDHierarchy) { case 1:
IDMethodNameme = clazz.getDeclaredMethod(IDMethodName); IDMethodNameme = clazz.getDeclaredMethod(IDMethodName);
...@@ -134,9 +73,11 @@ public class TreeParser{ ...@@ -134,9 +73,11 @@ public class TreeParser{
/** /**
* 获取子数据集合 * 获取子数据集合
*/ */
private static List<Menu> getSub(Long topId, Collection entityList,String packageURL,String IDMethodName,int IDHierarchy,String NAMEMethodName,String PARENTIDMethodName ) throws Exception{ @SuppressWarnings("unchecked")
private static List<Menu> getSub(Long topId, @SuppressWarnings("rawtypes") Collection entityList,String packageURL,String IDMethodName,int IDHierarchy,String NAMEMethodName,String PARENTIDMethodName ) throws Exception{
List<Menu> childList=new ArrayList<>(); List<Menu> childList=new ArrayList<>();
Class clazz= Class.forName(packageURL); @SuppressWarnings("rawtypes")
Class clazz= Class.forName(packageURL);
Method IDMethodNameme = null; Method IDMethodNameme = null;
switch (IDHierarchy) { switch (IDHierarchy) {
case 1: case 1:
......
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