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
7ea7bdda
Commit
7ea7bdda
authored
May 25, 2022
by
徐高华
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' of
http://git.gicdev.com/haoban3.0/haoban-manage3.0.git
into developer
parents
9b52a14f
4a2b0172
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
26 deletions
+42
-26
StaffMapper.java
...com/gic/haoban/manage/service/dao/mapper/StaffMapper.java
+5
-5
TabHaobanStaff.java
.../com/gic/haoban/manage/service/entity/TabHaobanStaff.java
+14
-1
StaffApiServiceImpl.java
.../manage/service/service/out/impl/StaffApiServiceImpl.java
+21
-19
StaffMapper.xml
...manage3-service/src/main/resources/mapper/StaffMapper.xml
+2
-1
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/StaffMapper.java
View file @
7ea7bdda
...
...
@@ -24,11 +24,11 @@ public interface StaffMapper {
List
<
TabHaobanStaff
>
listLikeName
(
@Param
(
"staffName"
)
String
staffName
,
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
);
Page
<
TabHaobanStaff
>
pageStaff
(
@Param
(
"staffIds"
)
List
<
String
>
staffIds
,
@Param
(
"activeFlag"
)
Integer
activeFlag
,
@Param
(
"keyword"
)
String
keyword
,
@Param
(
"departmentIds"
)
List
<
String
>
departmentIds
,
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
,
@Param
(
"relationFlag"
)
Integer
relationFlag
);
@Param
(
"activeFlag"
)
Integer
activeFlag
,
@Param
(
"keyword"
)
String
keyword
,
@Param
(
"departmentIds"
)
List
<
String
>
departmentIds
,
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
,
@Param
(
"relationFlag"
)
Integer
relationFlag
);
/**
* 选择用户id和企业标识
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/entity/TabHaobanStaff.java
View file @
7ea7bdda
package
com
.
gic
.
haoban
.
manage
.
service
.
entity
;
import
javax.persistence.Transient
;
import
java.io.Serializable
;
import
java.util.Date
;
...
...
@@ -47,7 +48,10 @@ public class TabHaobanStaff implements Serializable {
private
String
wxOpenId
;
private
String
qrCode
;
@Transient
private
String
departmentIds
;
public
String
getStaffId
()
{
return
staffId
;
}
...
...
@@ -215,4 +219,12 @@ public class TabHaobanStaff implements Serializable {
public
void
setQrCode
(
String
qrCode
)
{
this
.
qrCode
=
qrCode
;
}
public
String
getDepartmentIds
()
{
return
departmentIds
;
}
public
void
setDepartmentIds
(
String
departmentIds
)
{
this
.
departmentIds
=
departmentIds
;
}
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffApiServiceImpl.java
View file @
7ea7bdda
...
...
@@ -210,20 +210,19 @@ public class StaffApiServiceImpl implements StaffApiService {
}
@Override
public
Page
<
StaffDTO
>
pageStaff
(
List
<
String
>
departmentIds
,
Integer
activeFlag
,
String
keyword
,
BasePageInfo
pageInfo
,
Integer
relationFlag
,
String
wxEnterpriseId
)
{
List
<
String
>
staffIds
=
new
ArrayList
<>();
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
<>();
}
staffDTOList
.
forEach
(
one
->
{
//one.setDepartmentIds(Objects.isNull(related) ? null : related.getDepartmentId());
// 关联状态
List
<
StaffClerkRelationDTO
>
staffClerkRelationDTOS
=
staffClerkRelationService
.
listByStaffId
(
wxEnterpriseId
,
one
.
getStaffId
());
one
.
setRelationFlag
(
CollectionUtils
.
isNotEmpty
(
staffClerkRelationDTOS
)
?
1
:
0
);
...
...
@@ -1207,24 +1206,24 @@ public class StaffApiServiceImpl implements StaffApiService {
this
.
addDepartInfo
(
list
);
return
list
;
}
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
);
...
...
@@ -1310,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
)
{
...
...
@@ -1326,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
...
...
@@ -1345,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
;
}
...
...
haoban-manage3-service/src/main/resources/mapper/StaffMapper.xml
View file @
7ea7bdda
...
...
@@ -275,7 +275,8 @@
<select
id=
"pageStaff"
resultMap=
"BaseResultMap"
>
select
a.*
a.*,
b.department_id departmentIds
from tab_haoban_staff a
left join tab_haoban_staff_department_related b on a.staff_id = b.staff_id
where a.status_flag = 1 and a.wx_enterprise_id = #{wxEnterpriseId}
...
...
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