Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
yangxiujun
/
paidan_demo
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 3bae1d7e
authored
Aug 04, 2023
by
wangli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mp2jpa
1 parent
50c7e200
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
14 deletions
project-order/src/main/java/com/dituhui/pea/order/service/impl/BusinessBlockServiceImpl.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/BusinessBlockServiceImpl.java
View file @
3bae1d7
...
...
@@ -29,7 +29,7 @@ import java.util.stream.Collectors;
public
class
BusinessBlockServiceImpl
implements
BusinessBlockService
{
@Autowired
private
OrgTeam
MPDao
orgTeamMP
Dao
;
private
OrgTeam
Dao
orgTeam
Dao
;
@Autowired
private
MapBlockInfoMPDao
mapBlockInfoMPDao
;
...
...
@@ -45,6 +45,9 @@ public class BusinessBlockServiceImpl implements BusinessBlockService {
@Autowired
private
ISaaSRemoteService
saasRemoteService
;
@Autowired
private
MapBlockInfoDao
mapBlockInfoDao
;
@Autowired
private
OrgGroupDao
orgGroupDao
;
...
...
@@ -62,15 +65,22 @@ public class BusinessBlockServiceImpl implements BusinessBlockService {
String
url
;
@Override
public
Result
<?>
businessServerBlocks
(
String
levelType
,
String
levelValue
,
long
page
,
long
size
,
String
layerId
,
String
teamId
)
{
public
Result
<?>
businessServerBlocks
(
String
levelType
,
String
levelValue
,
int
page
,
int
size
,
String
layerId
,
String
teamId
)
{
BusinessServerBlocksRespDTO
resp
=
new
BusinessServerBlocksRespDTO
();
LambdaQueryWrapper
<
OrgTeam
>
lqwTeam
=
new
LambdaQueryWrapper
<>();
lqwTeam
.
eq
(
levelType
.
equals
(
"cluster"
),
OrgTeam:
:
getClusterId
,
levelValue
);
lqwTeam
.
eq
(
levelType
.
equals
(
"branch"
),
OrgTeam:
:
getBranchId
,
levelValue
);
lqwTeam
.
eq
(
levelType
.
equals
(
"group"
),
OrgTeam:
:
getGroupId
,
levelValue
);
lqwTeam
.
eq
(
StringUtils
.
isNotEmpty
(
teamId
),
OrgTeam:
:
getTeamId
,
teamId
);
List
<
OrgTeam
>
teams
=
orgTeamMPDao
.
selectList
(
lqwTeam
);
List
<
OrgTeamEntity
>
teams
=
new
ArrayList
<>();
if
(
levelType
.
equals
(
"cluster"
)){
teams
=
orgTeamDao
.
findAllByClusterId
(
levelValue
);
}
else
if
(
levelType
.
equals
(
"branch"
)){
teams
=
orgTeamDao
.
findAllByBranchId
(
levelValue
);
}
else
if
(
levelType
.
equals
(
"group"
)){
teams
=
orgTeamDao
.
findAllByGroupId
(
levelValue
);
}
if
(
StringUtils
.
isNotEmpty
(
teamId
))
{
teams
=
teams
.
stream
().
filter
(
t
->
t
.
getTeamId
().
equals
(
teamId
)).
collect
(
Collectors
.
toList
());
}
if
(
ListUtils
.
isEmpty
(
teams
))
{
resp
.
setTotal
(
0
);
resp
.
setPages
(
1
);
...
...
@@ -82,16 +92,16 @@ public class BusinessBlockServiceImpl implements BusinessBlockService {
}
// 获得teamId与team的映射
Map
<
String
,
OrgTeam
>
teamMapping
=
new
HashMap
<>();
for
(
OrgTeam
t
:
teams
)
{
Map
<
String
,
OrgTeam
Entity
>
teamMapping
=
new
HashMap
<>();
for
(
OrgTeam
Entity
t
:
teams
)
{
teamMapping
.
put
(
t
.
getTeamId
(),
t
);
}
// teamId列表
List
<
String
>
teamIds
=
teams
.
stream
().
map
(
OrgTeam:
:
getTeamId
).
collect
(
Collectors
.
toList
());
List
<
String
>
teamIds
=
teams
.
stream
().
map
(
OrgTeam
Entity
:
:
getTeamId
).
collect
(
Collectors
.
toList
());
// 获取groupId集合
Set
<
String
>
groupIds
=
teams
.
stream
().
map
(
OrgTeam:
:
getGroupId
).
collect
(
Collectors
.
toSet
());
Set
<
String
>
groupIds
=
teams
.
stream
().
map
(
OrgTeam
Entity
:
:
getGroupId
).
collect
(
Collectors
.
toSet
());
List
<
OrgGroup
>
groups
=
orgGroupMPDao
.
selectByGroupIds
(
new
ArrayList
<>(
groupIds
));
Map
<
String
,
String
>
groupMapping
=
groups
.
stream
().
collect
(
Collectors
.
toMap
(
OrgGroup:
:
getGroupId
,
OrgGroup:
:
getGroupName
));
...
...
@@ -107,7 +117,7 @@ public class BusinessBlockServiceImpl implements BusinessBlockService {
for
(
MapBlockInfo
b
:
pg
.
getRecords
())
{
BusinessServerBlocksRespDTO
.
Block
block
=
new
BusinessServerBlocksRespDTO
.
Block
();
OrgTeam
team
=
teamMapping
.
get
(
b
.
getTeamId
());
OrgTeam
Entity
team
=
teamMapping
.
get
(
b
.
getTeamId
());
String
groupId
=
team
.
getGroupId
();
String
groupName
=
groupMapping
.
get
(
groupId
);
...
...
@@ -152,7 +162,7 @@ public class BusinessBlockServiceImpl implements BusinessBlockService {
layerName
=
layer1
.
getLayer
();
}
OrgTeam
team
=
orgTeamMP
Dao
.
getByTeamId
(
teamId
);
OrgTeam
Entity
team
=
orgTeam
Dao
.
getByTeamId
(
teamId
);
if
(
team
==
null
)
{
throw
new
BusinessException
(
"关联小队不存在"
);
}
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment