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
54ff1e59
Commit
54ff1e59
authored
Apr 11, 2023
by
songyinghui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 权限初始化
parent
e5626c08
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
10 deletions
+20
-10
HaobanRoleApiServiceImpl.java
...rvice/service/out/impl/role/HaobanRoleApiServiceImpl.java
+20
-10
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/role/HaobanRoleApiServiceImpl.java
View file @
54ff1e59
...
...
@@ -495,6 +495,7 @@ public class HaobanRoleApiServiceImpl implements HaobanRoleApiService {
@Override
public
ServiceResponse
<
Void
>
contentMaterialRoleInit
(
ContentMaterialROleInitQDTO
contentMaterialROleInitQDTO
)
{
logger
.
info
(
"好办权限初始化 {}"
,
JSON
.
toJSONString
(
contentMaterialROleInitQDTO
));
if
(
contentMaterialROleInitQDTO
.
getVersion
()
==
null
)
{
return
ServiceResponse
.
success
();
}
...
...
@@ -509,8 +510,8 @@ public class HaobanRoleApiServiceImpl implements HaobanRoleApiService {
for
(
TabHaobanWxEnterprise
wxEnterpris
:
tabHaobanWxEnterprises
)
{
// 查询企微下 导购、店长、区经 的role_id
String
wxEnterpriseId
=
wxEnterpris
.
getWxEnterpriseId
();
//
运维后台 +
好办后台
List
<
HaobanRoleBO
>
haobanRoleBOS
=
haobanRoleService
.
getListByWxEnterpriseId
(
wxEnterpriseId
,
null
);
//
只取
好办后台
List
<
HaobanRoleBO
>
haobanRoleBOS
=
haobanRoleService
.
getListByWxEnterpriseId
(
wxEnterpriseId
,
1
);
if
(
CollectionUtils
.
isEmpty
(
haobanRoleBOS
))
{
logger
.
info
(
"企业{} 企微 {} 下没有角色 "
,
contentMaterialROleInitQDTO
.
getEnterpriseId
(),
wxEnterpriseId
);
continue
;
...
...
@@ -523,7 +524,14 @@ public class HaobanRoleApiServiceImpl implements HaobanRoleApiService {
if
(
CollectionUtils
.
isEmpty
(
menuCodes
))
{
continue
;
}
logger
.
info
(
"本次对应的menuCode:{}"
,
JSON
.
toJSONString
(
menuCodes
));
List
<
String
>
hasExistMenuCodes
=
haobanRoleMenuService
.
getByWxEnterpriseIdAndRoleId
(
wxEnterpriseId
,
haobanRoleBO
.
getRoleId
());
if
(
CollectionUtils
.
isEmpty
(
hasExistMenuCodes
))
{
hasExistMenuCodes
=
new
ArrayList
<>();
}
List
<
String
>
finalHasExistMenuCodes
=
hasExistMenuCodes
;
List
<
TabHaobanRoleMenu
>
tabHaobanRoleMenus
=
menuCodes
.
stream
()
.
filter
(
item
->
!
finalHasExistMenuCodes
.
contains
(
item
))
.
map
(
item
->
{
TabHaobanRoleMenu
temp
=
new
TabHaobanRoleMenu
();
temp
.
setRoleId
(
haobanRoleBO
.
getRoleId
());
...
...
@@ -537,8 +545,10 @@ public class HaobanRoleApiServiceImpl implements HaobanRoleApiService {
.
collect
(
Collectors
.
toList
());
haobanRoleMenus
.
addAll
(
tabHaobanRoleMenus
);
}
haobanRoleMenuService
.
insertBatch
(
haobanRoleMenus
);
logger
.
info
(
"新增权限code: {}"
,
JSON
.
toJSONString
(
haobanRoleMenus
));
if
(
CollectionUtils
.
isNotEmpty
(
haobanRoleMenus
))
{
haobanRoleMenuService
.
insertBatch
(
haobanRoleMenus
);
}
}
return
ServiceResponse
.
success
();
}
...
...
@@ -547,15 +557,15 @@ public class HaobanRoleApiServiceImpl implements HaobanRoleApiService {
static
{
// 导购
menuCodeMap
.
put
(
"0"
+
ContentMaterialROleInitQDTO
.
Version
.
LOW
.
getCode
(),
Arrays
.
asList
(
"material
Center"
,
"goodsDetail_material"
,
"goodsCenter_Count"
,
"materialManage
"
));
menuCodeMap
.
put
(
"0"
+
ContentMaterialROleInitQDTO
.
Version
.
HIGH
.
getCode
(),
Arrays
.
asList
(
"
goodsDetail_material"
,
"goodsCenter_Count"
,
"materialManage
"
,
"salesClue"
,
"customerDetail_interact"
));
menuCodeMap
.
put
(
"0"
+
ContentMaterialROleInitQDTO
.
Version
.
LOW
.
getCode
(),
Arrays
.
asList
(
"material
Main"
,
"goodsDetail_material"
,
"goodsCenter_Count
"
));
menuCodeMap
.
put
(
"0"
+
ContentMaterialROleInitQDTO
.
Version
.
HIGH
.
getCode
(),
Arrays
.
asList
(
"
materialMain"
,
"goodsDetail_material"
,
"goodsCenter_Count
"
,
"salesClue"
,
"customerDetail_interact"
));
// 店长
menuCodeMap
.
put
(
"1"
+
ContentMaterialROleInitQDTO
.
Version
.
LOW
.
getCode
(),
Arrays
.
asList
(
"material
Center
"
,
"goodsDetail_material"
,
"goodsCenter_Count"
,
"materialManage"
));
menuCodeMap
.
put
(
"1"
+
ContentMaterialROleInitQDTO
.
Version
.
HIGH
.
getCode
(),
Arrays
.
asList
(
"material
Center"
,
"goodsDetail_material"
,
"goodsCenter_Count"
,
"materialManage"
,
"salesClue"
,
"customerDetail_interact"
));
menuCodeMap
.
put
(
"1"
+
ContentMaterialROleInitQDTO
.
Version
.
LOW
.
getCode
(),
Arrays
.
asList
(
"material
Main
"
,
"goodsDetail_material"
,
"goodsCenter_Count"
,
"materialManage"
));
menuCodeMap
.
put
(
"1"
+
ContentMaterialROleInitQDTO
.
Version
.
HIGH
.
getCode
(),
Arrays
.
asList
(
"material
Main"
,
"goodsDetail_material"
,
"goodsCenter_Count"
,
"materialManage"
,
"salesClue"
,
"customerDetail_interact"
));
// 区经
menuCodeMap
.
put
(
"2"
+
ContentMaterialROleInitQDTO
.
Version
.
LOW
.
getCode
(),
Arrays
.
asList
(
"material
Center
"
,
"goodsDetail_material"
,
"goodsCenter_Count"
,
"materialManage"
));
menuCodeMap
.
put
(
"2"
+
ContentMaterialROleInitQDTO
.
Version
.
HIGH
.
getCode
(),
Arrays
.
asList
(
"material
Center"
,
"goodsDetail_material"
,
"goodsCenter_Count"
,
"materialManage"
,
"salesClue"
,
"customerDetail_interact
"
));
menuCodeMap
.
put
(
"2"
+
ContentMaterialROleInitQDTO
.
Version
.
LOW
.
getCode
(),
Arrays
.
asList
(
"material
Main
"
,
"goodsDetail_material"
,
"goodsCenter_Count"
,
"materialManage"
));
menuCodeMap
.
put
(
"2"
+
ContentMaterialROleInitQDTO
.
Version
.
HIGH
.
getCode
(),
Arrays
.
asList
(
"material
Main"
,
"goodsDetail_material"
,
"goodsCenter_Count"
,
"materialManage
"
));
}
...
...
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