Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
065eb453
Commit
065eb453
authored
Jun 23, 2021
by
李成龙
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' of
http://172.16.10.76/moa/amos-boot-biz
into developer
parents
b373d319
0774494d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
64 deletions
+5
-64
TreeParser.java
...va/com/yeejoin/amos/boot/biz/common/utils/TreeParser.java
+5
-64
No files found.
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/utils/TreeParser.java
View file @
065eb453
...
@@ -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,8 +28,9 @@ public class TreeParser{
...
@@ -90,8 +28,9 @@ 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
<>();
@SuppressWarnings
(
"rawtypes"
)
Class
clazz
=
Class
.
forName
(
packageURL
);
Class
clazz
=
Class
.
forName
(
packageURL
);
Method
IDMethodNameme
=
null
;
Method
IDMethodNameme
=
null
;
switch
(
IDHierarchy
)
{
case
1
:
switch
(
IDHierarchy
)
{
case
1
:
...
@@ -134,8 +73,10 @@ public class TreeParser{
...
@@ -134,8 +73,10 @@ 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
<>();
@SuppressWarnings
(
"rawtypes"
)
Class
clazz
=
Class
.
forName
(
packageURL
);
Class
clazz
=
Class
.
forName
(
packageURL
);
Method
IDMethodNameme
=
null
;
Method
IDMethodNameme
=
null
;
switch
(
IDHierarchy
)
{
switch
(
IDHierarchy
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment