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
fad02218
Commit
fad02218
authored
Feb 18, 2022
by
chenzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改bug
parent
b3445951
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
3 deletions
+68
-3
TreeParser.java
...va/com/yeejoin/amos/boot/biz/common/utils/TreeParser.java
+57
-0
FireTeamServiceImpl.java
...t/module/common/biz/service/impl/FireTeamServiceImpl.java
+11
-3
No files found.
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/utils/TreeParser.java
View file @
fad02218
...
@@ -104,6 +104,63 @@ public class TreeParser {
...
@@ -104,6 +104,63 @@ public class TreeParser {
return
resultList
;
return
resultList
;
}
}
public
static
List
<
Menu
>
getTreeTeam
(
Long
topId
,
@SuppressWarnings
(
"rawtypes"
)
Collection
entityList
,
String
packageURL
,
String
IDMethodName
,
int
IDHierarchy
,
String
NAMEMethodName
,
String
PARENTIDMethodName
,
List
<
FirefightersTreeDto
>
list
,
String
treeCode
)
throws
Exception
{
List
<
Menu
>
resultList
=
new
ArrayList
<>();
@SuppressWarnings
(
"rawtypes"
)
Class
clazz
=
Class
.
forName
(
packageURL
);
Method
IDMethodNameme
=
null
;
switch
(
IDHierarchy
)
{
case
1
:
IDMethodNameme
=
clazz
.
getDeclaredMethod
(
IDMethodName
);
break
;
case
2
:
IDMethodNameme
=
clazz
.
getSuperclass
().
getDeclaredMethod
(
IDMethodName
);
break
;
case
3
:
IDMethodNameme
=
clazz
.
getSuperclass
().
getSuperclass
().
getDeclaredMethod
(
IDMethodName
);
break
;
default
:
IDMethodNameme
=
clazz
.
getDeclaredMethod
(
IDMethodName
);
break
;
}
Method
NAMEMethodNameme
=
clazz
.
getDeclaredMethod
(
NAMEMethodName
);
Method
PARENTIDMethodNameme
=
clazz
.
getDeclaredMethod
(
PARENTIDMethodName
);
//获取顶层元素集合
Long
parentId
;
for
(
Object
ob
:
entityList
)
{
Object
entity
=
clazz
.
cast
(
ob
);
parentId
=
PARENTIDMethodNameme
.
invoke
(
entity
)
!=
null
?
Long
.
valueOf
(
String
.
valueOf
(
PARENTIDMethodNameme
.
invoke
(
entity
)))
:
null
;
if
(
parentId
==
null
)
{
//陈浩2021-12-01修改 topId == parentId 的判断
String
codeString
=
String
.
valueOf
(
IDMethodNameme
.
invoke
(
entity
));
Integer
num
=
0
;
if
(
list
!=
null
&&
list
.
size
()
>
0
)
{
for
(
FirefightersTreeDto
map
:
list
)
{
if
(
null
!=
map
.
getJobTitleCode
()
&&
map
.
getJobTitleCode
().
equals
(
codeString
))
{
num
=
Integer
.
valueOf
((
String
)
map
.
getNum
());
break
;
}
}
;
}
Menu
menu
=
new
Menu
(
Long
.
valueOf
(
codeString
),
String
.
valueOf
(
NAMEMethodNameme
.
invoke
(
entity
)),
parentId
,
num
);
resultList
.
add
(
menu
);
}
}
//获取每个顶层元素的子数据集合
for
(
Menu
entity
:
resultList
)
{
entity
.
setChildren
(
getSub
(
entity
.
getId
(),
entityList
,
packageURL
,
IDMethodName
,
IDHierarchy
,
NAMEMethodName
,
PARENTIDMethodName
,
list
,
treeCode
));
}
return
resultList
;
}
/**
/**
* 获取子数据集合
* 获取子数据集合
*/
*/
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/FireTeamServiceImpl.java
View file @
fad02218
...
@@ -29,6 +29,7 @@ import com.yeejoin.amos.boot.module.common.api.service.IFireTeamService;
...
@@ -29,6 +29,7 @@ import com.yeejoin.amos.boot.module.common.api.service.IFireTeamService;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.exception.BaseException
;
import
org.typroject.tyboot.core.foundation.exception.BaseException
;
...
@@ -65,6 +66,9 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire
...
@@ -65,6 +66,9 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire
@Autowired
@Autowired
private
RedisUtils
redisUtils
;
private
RedisUtils
redisUtils
;
@Value
(
"${fire-rescue}"
)
private
String
fireRescueId
;
/**
/**
* 获取监控大队列表
* 获取监控大队列表
...
@@ -494,16 +498,20 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire
...
@@ -494,16 +498,20 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire
LambdaQueryWrapper
<
FireTeam
>
queryWrapper
=
new
LambdaQueryWrapper
<
FireTeam
>();
LambdaQueryWrapper
<
FireTeam
>
queryWrapper
=
new
LambdaQueryWrapper
<
FireTeam
>();
queryWrapper
.
eq
(
FireTeam:
:
getTypeCode
,
code
);
queryWrapper
.
eq
(
FireTeam:
:
getTypeCode
,
code
);
queryWrapper
.
eq
(
FireTeam:
:
getIsDelete
,
false
);
queryWrapper
.
eq
(
FireTeam:
:
getIsDelete
,
false
);
queryWrapper
.
eq
(
FireTeam:
:
getCompanyName
,
"消防救援保障部"
);
// queryWrapper.eq(FireTeam::getCompanyName, "消防急救保障部");
// 消防救援保障部为保证灵活性以及防止名字变更 通过id查询 ID在配置文件中配置
queryWrapper
.
eq
(
FireTeam:
:
getCompany
,
fireRescueId
);
LambdaQueryWrapper
<
FireTeam
>
queryWrapper1
=
new
LambdaQueryWrapper
<
FireTeam
>();
LambdaQueryWrapper
<
FireTeam
>
queryWrapper1
=
new
LambdaQueryWrapper
<
FireTeam
>();
queryWrapper1
.
eq
(
FireTeam:
:
getIsDelete
,
false
);
queryWrapper1
.
eq
(
FireTeam:
:
getIsDelete
,
false
);
queryWrapper1
.
eq
(
FireTeam:
:
getCompanyName
,
"消防救援保障部"
);
// queryWrapper1.eq(FireTeam::getCompanyName, "消防急救保障部");
queryWrapper1
.
eq
(
FireTeam:
:
getCompany
,
fireRescueId
);
queryWrapper1
.
isNull
(
FireTeam:
:
getParent
);
queryWrapper1
.
isNull
(
FireTeam:
:
getParent
);
queryWrapper1
.
eq
(
FireTeam:
:
getTypeCode
,
code
);
FireTeam
parentFireTeam
=
this
.
baseMapper
.
selectOne
(
queryWrapper1
);
FireTeam
parentFireTeam
=
this
.
baseMapper
.
selectOne
(
queryWrapper1
);
if
(
parentFireTeam
==
null
)
{
if
(
parentFireTeam
==
null
)
{
return
null
;
return
null
;
}
}
return
TreeParser
.
getTree
(
parentFireTeam
.
getSequenceNbr
(),
this
.
baseMapper
.
selectList
(
queryWrapper
),
FireTeam
.
class
.
getName
(),
"getSequenceNbr"
,
2
,
"getName"
,
"getParent"
,
return
TreeParser
.
getTree
Team
(
parentFireTeam
.
getSequenceNbr
(),
this
.
baseMapper
.
selectList
(
queryWrapper
),
FireTeam
.
class
.
getName
(),
"getSequenceNbr"
,
2
,
"getName"
,
"getParent"
,
null
,
null
);
null
,
null
);
// TODO Auto-generated method stub
// TODO Auto-generated method stub
}
}
...
...
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