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
4a2b0172
Commit
4a2b0172
authored
May 25, 2022
by
墨竹
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:打印日志
parent
e40352fc
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
15 deletions
+18
-15
StaffApiServiceImpl.java
.../manage/service/service/out/impl/StaffApiServiceImpl.java
+18
-15
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffApiServiceImpl.java
View file @
4a2b0172
...
...
@@ -210,14 +210,14 @@ public class StaffApiServiceImpl implements StaffApiService {
}
@Override
public
Page
<
StaffDTO
>
pageStaff
(
List
<
String
>
departmentIds
,
Integer
activeFlag
,
String
keyword
,
BasePageInfo
pageInfo
,
Integer
relationFlag
,
String
wxEnterpriseId
)
{
public
Page
<
StaffDTO
>
pageStaff
(
List
<
String
>
departmentIds
,
Integer
activeFlag
,
String
keyword
,
BasePageInfo
pageInfo
,
Integer
relationFlag
,
String
wxEnterpriseId
)
{
List
<
String
>
staffIds
=
new
ArrayList
<>();
if
(
relationFlag
!=
null
)
{
List
<
TabHaobanStaffClerkRelation
>
relationList
=
staffClerkRelationService
.
listByWxEnterpriseId
(
wxEnterpriseId
);
staffIds
=
relationList
.
stream
().
map
(
TabHaobanStaffClerkRelation:
:
getStaffId
).
collect
(
Collectors
.
toList
());
}
PageHelper
.
startPage
(
pageInfo
.
getPageNum
(),
pageInfo
.
getPageSize
());
Page
<
StaffDTO
>
page
=
PageUtil
.
changePageHelperToCurrentPage
(
staffService
.
pageStaff
(
staffIds
,
activeFlag
,
keyword
,
departmentIds
,
wxEnterpriseId
,
relationFlag
),
StaffDTO
.
class
);
Page
<
StaffDTO
>
page
=
PageUtil
.
changePageHelperToCurrentPage
(
staffService
.
pageStaff
(
staffIds
,
activeFlag
,
keyword
,
departmentIds
,
wxEnterpriseId
,
relationFlag
),
StaffDTO
.
class
);
List
<
StaffDTO
>
staffDTOList
=
page
.
getResult
();
if
(
CollectionUtils
.
isEmpty
(
staffDTOList
))
{
return
new
Page
<>();
...
...
@@ -1209,21 +1209,21 @@ public class StaffApiServiceImpl implements StaffApiService {
private
void
addDepartInfo
(
List
<
StaffDTO
>
list
)
{
List
<
String
>
staffIdList
=
list
.
stream
().
map
(
dto
->
dto
.
getStaffId
()).
collect
(
Collectors
.
toList
())
;
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
())
;
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
))
{
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
()))
;
for
(
TabHaobanStaffDepartmentRelated
item
:
relateList
)
{
if
(
null
!=
depMap
.
get
(
item
.
getDepartmentId
()))
{
staffDepList
.
add
(
depMap
.
get
(
item
.
getDepartmentId
()));
}
}
dto
.
setDepartmentList
(
staffDepList
);
...
...
@@ -1309,6 +1309,7 @@ public class StaffApiServiceImpl implements StaffApiService {
return
Collections
.
emptyList
();
}
List
<
String
>
enterpriseIdStoreIds
=
storeRangeService
.
listStoreIdByWxEnterpriseId
(
staffClerkRelationDTO
.
getEnterpriseId
(),
staffClerkRelationDTO
.
getWxEnterpriseId
());
logger
.
info
(
"好办门店id:{}"
,
JSON
.
toJSONString
(
enterpriseIdStoreIds
));
Integer
superManagerFlag
=
staff
.
getSuperManagerFlag
();
//超管
if
(
superManagerFlag
!=
null
&&
superManagerFlag
==
1
)
{
...
...
@@ -1325,7 +1326,9 @@ public class StaffApiServiceImpl implements StaffApiService {
}
//取交集
Sets
.
SetView
<
String
>
intersection
=
Sets
.
intersection
(
Sets
.
newHashSet
(
enterpriseIdStoreIds
),
Sets
.
newHashSet
(
gicStoreIds
));
return
intersection
.
stream
().
collect
(
Collectors
.
toList
());
List
<
String
>
storeList
=
intersection
.
stream
().
collect
(
Collectors
.
toList
());
logger
.
info
(
"该导购权限:clerkId:{},门店:{}"
,
clerkId
,
JSON
.
toJSONString
(
storeList
));
return
storeList
;
}
@Override
...
...
@@ -1344,7 +1347,7 @@ public class StaffApiServiceImpl implements StaffApiService {
@Override
public
boolean
isFlagByStoreIdAndEnterpriseId
(
String
storeId
,
String
enterpriseId
,
String
wxEnterpriseId
)
{
List
<
String
>
enterpriseIdStoreIds
=
storeRangeService
.
listStoreIdByWxEnterpriseId
(
wxEnterpriseId
,
enterpriseId
);
List
<
String
>
enterpriseIdStoreIds
=
storeRangeService
.
listStoreIdByWxEnterpriseId
(
wxEnterpriseId
,
enterpriseId
);
if
(
CollectionUtils
.
isEmpty
(
enterpriseIdStoreIds
))
{
return
false
;
}
...
...
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