Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
Overview
Overview
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
haoban3.0
haoban-manage3.0
Commits
60ef60b3
Commit
60ef60b3
authored
May 24, 2022
by
徐高华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
查询优化
parent
d117540a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
4 deletions
+30
-4
StaffApiServiceImpl.java
.../manage/service/service/out/impl/StaffApiServiceImpl.java
+30
-4
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffApiServiceImpl.java
View file @
60ef60b3
...
@@ -903,7 +903,7 @@ public class StaffApiServiceImpl implements StaffApiService {
...
@@ -903,7 +903,7 @@ public class StaffApiServiceImpl implements StaffApiService {
if
(
CollectionUtils
.
isEmpty
(
list
))
{
if
(
CollectionUtils
.
isEmpty
(
list
))
{
return
Collections
.
EMPTY_LIST
;
return
Collections
.
EMPTY_LIST
;
}
}
for
(
StaffDTO
staffDTO
:
list
)
{
/*
for (StaffDTO staffDTO : list) {
List<String> departmentIds = new ArrayList<>();
List<String> departmentIds = new ArrayList<>();
List<TabHaobanStaffDepartmentRelated> relatedList = staffDepartmentRelatedService.listStaffDepartmentByStaffId(staffDTO.getStaffId());
List<TabHaobanStaffDepartmentRelated> relatedList = staffDepartmentRelatedService.listStaffDepartmentByStaffId(staffDTO.getStaffId());
for (TabHaobanStaffDepartmentRelated tabHaobanStaffDepartmentRelated : relatedList) {
for (TabHaobanStaffDepartmentRelated tabHaobanStaffDepartmentRelated : relatedList) {
...
@@ -911,7 +911,8 @@ public class StaffApiServiceImpl implements StaffApiService {
...
@@ -911,7 +911,8 @@ public class StaffApiServiceImpl implements StaffApiService {
}
}
List<DepartmentDTO> departmentList = departmentService.listByIds(departmentIds);
List<DepartmentDTO> departmentList = departmentService.listByIds(departmentIds);
staffDTO.setDepartmentList(departmentList);
staffDTO.setDepartmentList(departmentList);
}
}*/
this
.
addDepartInfo
(
list
);
return
list
;
return
list
;
}
}
...
@@ -1194,7 +1195,7 @@ public class StaffApiServiceImpl implements StaffApiService {
...
@@ -1194,7 +1195,7 @@ public class StaffApiServiceImpl implements StaffApiService {
if
(
CollectionUtils
.
isEmpty
(
list
))
{
if
(
CollectionUtils
.
isEmpty
(
list
))
{
return
Collections
.
EMPTY_LIST
;
return
Collections
.
EMPTY_LIST
;
}
}
for
(
StaffDTO
staffDTO
:
list
)
{
/*
for (StaffDTO staffDTO : list) {
List<String> departmentIds = new ArrayList<>();
List<String> departmentIds = new ArrayList<>();
List<TabHaobanStaffDepartmentRelated> relatedList = staffDepartmentRelatedService.listStaffDepartmentByStaffId(staffDTO.getStaffId());
List<TabHaobanStaffDepartmentRelated> relatedList = staffDepartmentRelatedService.listStaffDepartmentByStaffId(staffDTO.getStaffId());
for (TabHaobanStaffDepartmentRelated tabHaobanStaffDepartmentRelated : relatedList) {
for (TabHaobanStaffDepartmentRelated tabHaobanStaffDepartmentRelated : relatedList) {
...
@@ -1202,9 +1203,34 @@ public class StaffApiServiceImpl implements StaffApiService {
...
@@ -1202,9 +1203,34 @@ public class StaffApiServiceImpl implements StaffApiService {
}
}
List<DepartmentDTO> departmentList = departmentService.listByIds(departmentIds);
List<DepartmentDTO> departmentList = departmentService.listByIds(departmentIds);
staffDTO.setDepartmentList(departmentList);
staffDTO.setDepartmentList(departmentList);
}
}*/
this
.
addDepartInfo
(
list
);
return
list
;
return
list
;
}
}
private
void
addDepartInfo
(
List
<
StaffDTO
>
list
)
{
List
<
String
>
staffIdList
=
list
.
stream
().
map
(
dto
->
dto
.
getStaffId
()).
collect
(
Collectors
.
toList
())
;
List
<
TabHaobanStaffDepartmentRelated
>
deplist
=
staffDepartmentRelatedMapper
.
listStaffDepartmentByStaffIds
(
staffIdList
);
if
(
CollectionUtil
.
isNotEmpty
(
list
))
{
Map
<
String
,
List
<
TabHaobanStaffDepartmentRelated
>>
map
=
deplist
.
stream
().
collect
(
Collectors
.
groupingBy
(
TabHaobanStaffDepartmentRelated:
:
getStaffId
))
;
List
<
String
>
depIdList
=
deplist
.
stream
().
map
(
dto
->
dto
.
getDepartmentId
()).
collect
(
Collectors
.
toList
())
;
List
<
DepartmentDTO
>
departmentList
=
this
.
departmentService
.
listByIds
(
depIdList
);
Map
<
String
,
DepartmentDTO
>
depMap
=
departmentList
.
stream
().
collect
(
Collectors
.
toMap
(
DepartmentDTO:
:
getDepartmentId
,
dto
->
dto
,(
k1
,
k2
)->
k1
))
;
for
(
StaffDTO
dto
:
list
)
{
String
staffId
=
dto
.
getStaffId
()
;
List
<
TabHaobanStaffDepartmentRelated
>
relateList
=
map
.
get
(
staffId
)
;
if
(
CollectionUtils
.
isNotEmpty
(
relateList
))
{
List
<
DepartmentDTO
>
staffDepList
=
new
ArrayList
<>();
for
(
TabHaobanStaffDepartmentRelated
item
:
relateList
)
{
if
(
null
!=
depMap
.
get
(
item
.
getDepartmentId
()))
{
staffDepList
.
add
(
depMap
.
get
(
item
.
getDepartmentId
()))
;
}
}
}
}
}
}
@Override
@Override
public
int
updateOpenUserIdsByUserId
(
String
wxEnterpriseId
,
String
wxUserId
,
String
wxOpenUseId
)
{
public
int
updateOpenUserIdsByUserId
(
String
wxEnterpriseId
,
String
wxUserId
,
String
wxOpenUseId
)
{
...
...
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