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
f5f8aa4f
Commit
f5f8aa4f
authored
Apr 06, 2023
by
songyinghui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 好办权限初始化
parent
00a5332e
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
149 additions
and
2 deletions
+149
-2
ContentMaterialROleInitQDTO.java
...manage/api/dto/qdto/role/ContentMaterialROleInitQDTO.java
+84
-0
HaobanRoleApiService.java
.../haoban/manage/api/service/role/HaobanRoleApiService.java
+8
-0
InteractRecordMessageContext.java
...pojo/bo/content/context/InteractRecordMessageContext.java
+3
-1
InteractRecordMessageService.java
...service/content/message/InteractRecordMessageService.java
+1
-1
HaobanRoleApiServiceImpl.java
...rvice/service/out/impl/role/HaobanRoleApiServiceImpl.java
+53
-0
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/qdto/role/ContentMaterialROleInitQDTO.java
0 → 100644
View file @
f5f8aa4f
package
com
.
gic
.
haoban
.
manage
.
api
.
dto
.
qdto
.
role
;
import
java.io.Serializable
;
/**
* @Author MUSI
* @Date 2023/4/6 12:46 PM
* @Description
* @Version
**/
public
class
ContentMaterialROleInitQDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
726271440180247126L
;
/**
* 企业id
*/
private
String
enterpriseId
;
/**
* 企业微信
*/
private
String
wxEnterpriseId
;
/**
* 1 基础版本
* 2 高级版本
* @see Version
*/
private
Integer
version
;
public
enum
Version
{
LOW
(
1
,
"基础版本"
),
HIGH
(
2
,
"高级版"
);
private
Integer
code
;
private
String
desc
;
Version
(
Integer
code
,
String
desc
)
{
this
.
code
=
code
;
this
.
desc
=
desc
;
}
public
Integer
getCode
()
{
return
code
;
}
public
void
setCode
(
Integer
code
)
{
this
.
code
=
code
;
}
public
String
getDesc
()
{
return
desc
;
}
public
void
setDesc
(
String
desc
)
{
this
.
desc
=
desc
;
}
}
public
String
getEnterpriseId
()
{
return
enterpriseId
;
}
public
void
setEnterpriseId
(
String
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
}
public
String
getWxEnterpriseId
()
{
return
wxEnterpriseId
;
}
public
void
setWxEnterpriseId
(
String
wxEnterpriseId
)
{
this
.
wxEnterpriseId
=
wxEnterpriseId
;
}
public
Integer
getVersion
()
{
return
version
;
}
public
void
setVersion
(
Integer
version
)
{
this
.
version
=
version
;
}
}
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/role/HaobanRoleApiService.java
View file @
f5f8aa4f
...
...
@@ -2,6 +2,7 @@ package com.gic.haoban.manage.api.service.role;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.haoban.base.api.common.pojo.dto.WebLoginDTO
;
import
com.gic.haoban.manage.api.dto.qdto.role.ContentMaterialROleInitQDTO
;
import
com.gic.haoban.manage.api.dto.qdto.role.HaobanRoleQDTO
;
import
com.gic.haoban.manage.api.dto.role.HaobanRoleDTO
;
...
...
@@ -74,4 +75,11 @@ public interface HaobanRoleApiService {
*/
//无效接口
// ServiceResponse<List<String>> getMenuCodesByClerkType(String wxEnterpriseId,Integer clerkType,Integer systemFlag);
/**
* 内容 权限初始化
* @return
*/
ServiceResponse
<
Void
>
contentMaterialRoleInit
(
ContentMaterialROleInitQDTO
contentMaterialROleInitQDTO
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/pojo/bo/content/context/InteractRecordMessageContext.java
View file @
f5f8aa4f
...
...
@@ -12,6 +12,7 @@ import org.apache.commons.lang3.StringUtils;
import
org.springframework.beans.BeanUtils
;
import
java.util.Date
;
import
java.util.Optional
;
/**
* @Author MUSI
...
...
@@ -80,7 +81,8 @@ public class InteractRecordMessageContext {
temp
.
setStoreId
(
this
.
interactRecordMessageBO
.
getStoreId
());
temp
.
setChannelSource
(
this
.
interactRecordMessageBO
.
getChannelSource
());
temp
.
setEventType
(
this
.
interactRecordMessageBO
.
getEventType
());
temp
.
setDurationTime
(
this
.
interactRecordMessageBO
.
getDurationTime
());
Integer
durationTime
=
Optional
.
ofNullable
(
this
.
interactRecordMessageBO
.
getDurationTime
()).
orElse
(
0
);
temp
.
setDurationTime
(
durationTime
/
1000
);
temp
.
setBizType
(
ShareBizType
.
MATERIAL
.
getCode
());
temp
.
setBizId
(
this
.
interactRecordMessageBO
.
getMaterialId
()
+
""
);
temp
.
setTimes
(
this
.
times
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/content/message/InteractRecordMessageService.java
View file @
f5f8aa4f
...
...
@@ -62,7 +62,7 @@ public class InteractRecordMessageService {
// 修改访问类型
interactRecordBO
.
setUpdateTime
(
new
Date
());
Integer
durationTime
=
Optional
.
ofNullable
(
interactRecordBO
.
getDurationTime
()).
orElse
(
0
);
interactRecordBO
.
setDurationTime
(
durationTime
+
Optional
.
ofNullable
(
interactRecordMessageBO
.
getDurationTime
()).
orElse
(
0
));
interactRecordBO
.
setDurationTime
(
durationTime
+
Optional
.
ofNullable
(
interactRecordMessageBO
.
getDurationTime
()).
map
(
item
->
item
/
1000
).
orElse
(
0
));
// 事件类型
if
(
interactRecordBO
.
getEventType
()
<
interactRecordBO
.
getEventType
())
{
interactRecordBO
.
setEventType
(
interactRecordMessageBO
.
getEventType
());
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/role/HaobanRoleApiServiceImpl.java
View file @
f5f8aa4f
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
out
.
impl
.
role
;
import
com.alibaba.fastjson.JSON
;
import
com.ctrip.framework.apollo.Config
;
import
com.ctrip.framework.apollo.ConfigService
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.UniqueIdUtils
;
...
...
@@ -9,6 +11,7 @@ import com.gic.haoban.base.api.common.pojo.dto.WebLoginDTO;
import
com.gic.haoban.common.utils.RolesListUtils
;
import
com.gic.haoban.manage.api.dto.ClerkEditInfoDTO
;
import
com.gic.haoban.manage.api.dto.TemplateEnterpriseRelatedDTO
;
import
com.gic.haoban.manage.api.dto.qdto.role.ContentMaterialROleInitQDTO
;
import
com.gic.haoban.manage.api.dto.qdto.role.HaobanRoleMenuQDTO
;
import
com.gic.haoban.manage.api.dto.qdto.role.HaobanRoleQDTO
;
import
com.gic.haoban.manage.api.dto.role.HaobanMenuDTO
;
...
...
@@ -17,6 +20,7 @@ import com.gic.haoban.manage.api.enums.role.RoleClerkTypeEnum;
import
com.gic.haoban.manage.api.service.ApplicationSettingApiService
;
import
com.gic.haoban.manage.api.service.role.HaobanRoleApiService
;
import
com.gic.haoban.manage.service.dao.mapper.TabHaobanTemplateApplicationRelatedMapper
;
import
com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise
;
import
com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseRelated
;
import
com.gic.haoban.manage.service.entity.role.TabHaobanRole
;
import
com.gic.haoban.manage.service.entity.role.TabHaobanRoleMenu
;
...
...
@@ -27,6 +31,7 @@ import com.gic.haoban.manage.service.service.WxEnterpriseRelatedService;
import
com.gic.haoban.manage.service.service.role.HaobanMenuService
;
import
com.gic.haoban.manage.service.service.role.HaobanRoleMenuService
;
import
com.gic.haoban.manage.service.service.role.HaobanRoleService
;
import
com.google.common.base.Splitter
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.logging.log4j.LogManager
;
...
...
@@ -468,4 +473,52 @@ public class HaobanRoleApiServiceImpl implements HaobanRoleApiService {
add
(
haobanRoleSystemQDTO
,
login
);
return
ServiceResponse
.
success
();
}
/**
* 内容 权限初始化
*
* @param contentMaterialROleInitQDTO
* @return
* ● 基础版:GIC后台-内容、好办-素材中心、好办商品中心下的发圈素材与素材数量;
* ● 高级版:GIC后台-内容、好办-素材中心、好办商品中心下的发圈素材与素材数量、微商城所有功能、好办小程序销售线索功能
*/
@Override
public
ServiceResponse
<
Void
>
contentMaterialRoleInit
(
ContentMaterialROleInitQDTO
contentMaterialROleInitQDTO
)
{
if
(
contentMaterialROleInitQDTO
.
getVersion
()
==
null
)
{
return
ServiceResponse
.
success
();
}
Config
appConfig
=
ConfigService
.
getAppConfig
();
String
menuCodeStr
=
appConfig
.
getProperty
(
"haoban.material.version.menu-1"
+
contentMaterialROleInitQDTO
.
getVersion
(),
""
);
if
(
StringUtils
.
isBlank
(
menuCodeStr
))
{
return
ServiceResponse
.
success
();
}
List
<
String
>
menuCodes
=
Splitter
.
on
(
","
).
trimResults
()
.
omitEmptyStrings
()
.
splitToList
(
menuCodeStr
);
// 查询企业下所有的微信企业id
List
<
TabHaobanWxEnterprise
>
tabHaobanWxEnterprises
=
wxEnterpriseRelatedService
.
listByEnterpriseId
(
contentMaterialROleInitQDTO
.
getEnterpriseId
());
if
(
CollectionUtils
.
isEmpty
(
tabHaobanWxEnterprises
))
{
logger
.
info
(
"企业 {} 未关联企微 "
,
contentMaterialROleInitQDTO
.
getEnterpriseId
());
return
ServiceResponse
.
success
();
}
for
(
TabHaobanWxEnterprise
wxEnterpris
:
tabHaobanWxEnterprises
)
{
// 查询企微下 导购、店长、区经 的role_id
String
wxEnterpriseId
=
wxEnterpris
.
getWxEnterpriseId
();
// 运维后台 + 好办后台
List
<
HaobanRoleBO
>
haobanRoleBOS
=
haobanRoleService
.
getListByWxEnterpriseId
(
wxEnterpriseId
,
null
);
if
(
CollectionUtils
.
isEmpty
(
haobanRoleBOS
))
{
logger
.
info
(
"企业{} 企微 {} 下没有角色 "
,
contentMaterialROleInitQDTO
.
getEnterpriseId
(),
wxEnterpriseId
);
continue
;
}
// 为role 添加菜单
haobanRoleMenuService
.
insertBatch
(
Collections
.
emptyList
());
}
return
ServiceResponse
.
success
();
}
}
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