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
1
Merge Requests
1
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
204e76e0
Commit
204e76e0
authored
Apr 06, 2023
by
songyinghui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 好办权限初始化
parent
f5f8aa4f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
86 additions
and
14 deletions
+86
-14
pom.xml
haoban-manage3-service/pom.xml
+10
-0
InteractRecordMessageBuilder.java
...service/content/adaptor/InteractRecordMessageBuilder.java
+21
-0
HaobanRoleApiServiceImpl.java
...rvice/service/out/impl/role/HaobanRoleApiServiceImpl.java
+52
-14
dubbo-haoban-manage-service.xml
...ervice/src/main/resources/dubbo-haoban-manage-service.xml
+3
-0
No files found.
haoban-manage3-service/pom.xml
View file @
204e76e0
...
...
@@ -192,6 +192,16 @@
<artifactId>
gic-business-order-api
</artifactId>
<version>
${gic-business-order-api}
</version>
</dependency>
<dependency>
<groupId>
com.gic
</groupId>
<artifactId>
gic-order-ecommerce-api
</artifactId>
<version>
${gic-order-ecommerce-api}
</version>
</dependency>
<dependency>
<groupId>
com.gic
</groupId>
<artifactId>
gic-order-api
</artifactId>
<version>
${gic-order-api}
</version>
</dependency>
</dependencies>
<build>
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/content/adaptor/InteractRecordMessageBuilder.java
View file @
204e76e0
...
...
@@ -14,6 +14,10 @@ import com.gic.haoban.manage.service.pojo.qo.content.InteractRecordQO;
import
com.gic.haoban.manage.service.service.content.InteractRecordService
;
import
com.gic.member.api.dto.MemberDTO
;
import
com.gic.member.api.service.MemberService
;
import
com.gic.order.api.service.sharding.OrderApiService
;
import
com.gic.orderecommerce.api.constant.OrderChannelEnum
;
import
com.gic.orderecommerce.api.dto.MallEorderDTO
;
import
com.gic.orderecommerce.api.service.EcommerceOrderOutputApiService
;
import
com.gic.store.goods.dto.goods.GoodsSpuInfoDTO
;
import
com.gic.store.goods.dto.qdto.GoodsListQDTO
;
import
com.gic.store.goods.service.GoodsCenterApiService
;
...
...
@@ -49,6 +53,10 @@ public class InteractRecordMessageBuilder {
OrderInfoOutApiService
orderInfoOutApiService
;
@Autowired
private
GoodsCenterApiService
goodsCenterApiService
;
@Autowired
private
EcommerceOrderOutputApiService
ecommerceOrderOutputApiService
;
@Autowired
private
OrderApiService
orderApiService
;
/**
* 计算互动记录的访问次数
...
...
@@ -98,7 +106,20 @@ public class InteractRecordMessageBuilder {
log
.
info
(
"互动记录冗余会员信息 会员id不存在"
);
return
;
}
String
enterpriseId
=
context
.
getInteractRecordMessageBO
().
getEnterpriseId
();
// 查询会员全渠道订单
Integer
countOfSale
=
orderApiService
.
getCountOfSale
(
memberId
,
enterpriseId
);
if
(
countOfSale
!=
null
&&
countOfSale
>
0
)
{
context
.
setHasDeal
(
true
);
return
;
}
for
(
OrderChannelEnum
value
:
OrderChannelEnum
.
values
())
{
Page
<
MallEorderDTO
>
eorderDTOPage
=
ecommerceOrderOutputApiService
.
queryEorderListByMemberId
(
enterpriseId
,
memberId
,
null
,
1
,
1
,
value
.
getChannelCode
());
if
(
eorderDTOPage
!=
null
&&
CollectionUtils
.
isNotEmpty
(
eorderDTOPage
.
getResult
()))
{
context
.
setHasDeal
(
true
);
return
;
}
}
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/role/HaobanRoleApiServiceImpl.java
View file @
204e76e0
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
;
...
...
@@ -31,7 +29,6 @@ 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
;
...
...
@@ -40,7 +37,15 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.*
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
@Service
public
class
HaobanRoleApiServiceImpl
implements
HaobanRoleApiService
{
...
...
@@ -481,6 +486,11 @@ public class HaobanRoleApiServiceImpl implements HaobanRoleApiService {
* @return
* ● 基础版:GIC后台-内容、好办-素材中心、好办商品中心下的发圈素材与素材数量;
* ● 高级版:GIC后台-内容、好办-素材中心、好办商品中心下的发圈素材与素材数量、微商城所有功能、好办小程序销售线索功能
*
* 权限初始化的时候:
* 导购:销售线索、互动记录、发圈素材 、素材数量
* 店长:素材管理卡片、销售线索、互动记录列表、发圈素材 、素材数量
* 区经:素材管理卡片、、发圈素材 、素材数量
*/
@Override
public
ServiceResponse
<
Void
>
contentMaterialRoleInit
(
ContentMaterialROleInitQDTO
contentMaterialROleInitQDTO
)
{
...
...
@@ -489,15 +499,6 @@ public class HaobanRoleApiServiceImpl implements HaobanRoleApiService {
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
))
{
...
...
@@ -515,10 +516,47 @@ public class HaobanRoleApiServiceImpl implements HaobanRoleApiService {
continue
;
}
// 为role 添加菜单
haobanRoleMenuService
.
insertBatch
(
Collections
.
emptyList
());
List
<
TabHaobanRoleMenu
>
haobanRoleMenus
=
new
ArrayList
<>();
for
(
HaobanRoleBO
haobanRoleBO
:
haobanRoleBOS
)
{
List
<
String
>
menuCodes
=
menuCodeMap
.
get
(
haobanRoleBO
.
getClerkType
()
+
""
+
contentMaterialROleInitQDTO
.
getVersion
());
if
(
CollectionUtils
.
isEmpty
(
menuCodes
))
{
continue
;
}
List
<
TabHaobanRoleMenu
>
tabHaobanRoleMenus
=
menuCodes
.
stream
()
.
map
(
item
->
{
TabHaobanRoleMenu
temp
=
new
TabHaobanRoleMenu
();
temp
.
setRoleId
(
haobanRoleBO
.
getRoleId
());
temp
.
setWxEnterpriseId
(
wxEnterpriseId
);
temp
.
setStatusFlag
(
1
);
temp
.
setMenuCode
(
item
);
temp
.
setCreateTime
(
new
Date
());
temp
.
setUpdateTime
(
new
Date
());
return
temp
;
})
.
collect
(
Collectors
.
toList
());
haobanRoleMenus
.
addAll
(
tabHaobanRoleMenus
);
}
haobanRoleMenuService
.
insertBatch
(
haobanRoleMenus
);
}
return
ServiceResponse
.
success
();
}
private
static
final
Map
<
String
,
List
<
String
>
>
menuCodeMap
=
new
HashMap
<>();
static
{
// 导购
menuCodeMap
.
put
(
"0"
+
ContentMaterialROleInitQDTO
.
Version
.
LOW
.
getCode
(),
Arrays
.
asList
(
"materialCenter"
,
"goodsDetail_material"
,
"goodsCenter_Count"
,
"materialManage"
));
menuCodeMap
.
put
(
"0"
+
ContentMaterialROleInitQDTO
.
Version
.
HIGH
.
getCode
(),
Arrays
.
asList
(
"goodsDetail_material"
,
"goodsCenter_Count"
,
"materialManage"
,
"salesClue"
,
"customerDetail_interact"
));
// 店长
menuCodeMap
.
put
(
"1"
+
ContentMaterialROleInitQDTO
.
Version
.
LOW
.
getCode
(),
Arrays
.
asList
(
"materialCenter"
,
"goodsDetail_material"
,
"goodsCenter_Count"
,
"materialManage"
));
menuCodeMap
.
put
(
"1"
+
ContentMaterialROleInitQDTO
.
Version
.
HIGH
.
getCode
(),
Arrays
.
asList
(
"materialCenter"
,
"goodsDetail_material"
,
"goodsCenter_Count"
,
"materialManage"
,
"salesClue"
,
"customerDetail_interact"
));
// 区经
menuCodeMap
.
put
(
"2"
+
ContentMaterialROleInitQDTO
.
Version
.
LOW
.
getCode
(),
Arrays
.
asList
(
"materialCenter"
,
"goodsDetail_material"
,
"goodsCenter_Count"
,
"materialManage"
));
menuCodeMap
.
put
(
"2"
+
ContentMaterialROleInitQDTO
.
Version
.
HIGH
.
getCode
(),
Arrays
.
asList
(
"materialCenter"
,
"goodsDetail_material"
,
"goodsCenter_Count"
,
"materialManage"
,
"salesClue"
,
"customerDetail_interact"
));
}
}
haoban-manage3-service/src/main/resources/dubbo-haoban-manage-service.xml
View file @
204e76e0
...
...
@@ -216,4 +216,6 @@
<dubbo:reference
interface=
"com.gic.store.goods.service.GoodsInfoOutApiService"
id=
"goodsInfoOutApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
interface=
"com.gic.store.goods.service.GoodsCenterApiService"
id=
"goodsCenterApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
interface=
"com.gic.business.order.service.ordermanage.OrderInfoOutApiService"
id=
"orderInfoOutApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
interface=
"com.gic.orderecommerce.api.service.EcommerceOrderOutputApiService"
id=
"ecommerceOrderOutputApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
interface=
"com.gic.order.api.service.sharding.OrderApiService"
id=
"orderApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
</beans>
\ No newline at end of file
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