Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yanxuan-wx-store-sharer
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
wx
yanxuan-wx-store-sharer
Commits
462b7721
Commit
462b7721
authored
Mar 19, 2025
by
fanjiaxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
刷新用户信息加入绑定用户分佣比例
parent
d7b18ecd
Pipeline
#71905
passed with stages
in 1 minute 9 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
13 deletions
+23
-13
DrmSharerConfig.java
...e/yanxuan/wx/store/sharer/biz/config/DrmSharerConfig.java
+9
-11
UserServiceImpl.java
...uan/wx/store/sharer/biz/service/impl/UserServiceImpl.java
+14
-2
No files found.
yanxuan-wx-store-sharer-biz/src/main/java/com/netease/yanxuan/wx/store/sharer/biz/config/DrmSharerConfig.java
View file @
462b7721
...
@@ -324,7 +324,7 @@ public class DrmSharerConfig {
...
@@ -324,7 +324,7 @@ public class DrmSharerConfig {
/**
/**
* 获取推客分佣比例
* 获取推客分佣比例
*/
*/
p
rivate
BigDecimal
getSharerCommissionRatioOrDefault
(
String
openId
)
{
p
ublic
BigDecimal
getSharerCommissionRatioOrDefault
(
String
openId
)
{
BigDecimal
sharerCommissionRatio
=
getSharerCommissionRatio
(
openId
);
BigDecimal
sharerCommissionRatio
=
getSharerCommissionRatio
(
openId
);
return
null
!=
sharerCommissionRatio
?
sharerCommissionRatio
:
defaultCommissionRatio
;
return
null
!=
sharerCommissionRatio
?
sharerCommissionRatio
:
defaultCommissionRatio
;
}
}
...
@@ -332,7 +332,7 @@ public class DrmSharerConfig {
...
@@ -332,7 +332,7 @@ public class DrmSharerConfig {
/**
/**
* 获取推客分佣比例
* 获取推客分佣比例
*/
*/
p
rivate
BigDecimal
getSharerCommissionRatio
(
String
openId
)
{
p
ublic
BigDecimal
getSharerCommissionRatio
(
String
openId
)
{
Map
<
String
,
CommissionSharerBO
>
sharerCommissionMap
=
convertCommissionSharerMap
(
commissionSharerList
);
Map
<
String
,
CommissionSharerBO
>
sharerCommissionMap
=
convertCommissionSharerMap
(
commissionSharerList
);
CommissionSharerBO
commissionSharerBO
=
sharerCommissionMap
.
get
(
openId
);
CommissionSharerBO
commissionSharerBO
=
sharerCommissionMap
.
get
(
openId
);
// 返回推客分佣
// 返回推客分佣
...
@@ -342,7 +342,7 @@ public class DrmSharerConfig {
...
@@ -342,7 +342,7 @@ public class DrmSharerConfig {
/**
/**
* 获取推客商品未配置的分佣比例集合
* 获取推客商品未配置的分佣比例集合
*/
*/
p
rivate
List
<
SharerProductCommission
>
getSharerProductCommissionUnsetList
(
String
openId
)
{
p
ublic
List
<
SharerProductCommission
>
getSharerProductCommissionUnsetList
(
String
openId
)
{
// 返回推客商品分佣
// 返回推客商品分佣
LambdaQueryWrapper
<
SharerProductCommission
>
lqw
=
Wrappers
.
lambdaQuery
();
LambdaQueryWrapper
<
SharerProductCommission
>
lqw
=
Wrappers
.
lambdaQuery
();
lqw
.
eq
(
SharerProductCommission:
:
getOpenId
,
openId
);
lqw
.
eq
(
SharerProductCommission:
:
getOpenId
,
openId
);
...
@@ -512,14 +512,6 @@ public class DrmSharerConfig {
...
@@ -512,14 +512,6 @@ public class DrmSharerConfig {
return
sharerInfo
;
return
sharerInfo
;
}
}
/**
* 根据 openId 获取推客的 SharerAppid
*/
private
String
getSharerAppidByOpenId
(
String
openId
)
{
SharerInfo
sharerInfo
=
getSharerInfoByOpenId
(
openId
);
return
null
!=
sharerInfo
?
sharerInfo
.
getSharerAppid
()
:
null
;
}
private
void
updateSharerInfo
(
SharerInfo
sharerInfo
,
String
commissionRatio
)
{
private
void
updateSharerInfo
(
SharerInfo
sharerInfo
,
String
commissionRatio
)
{
LambdaUpdateWrapper
<
SharerInfo
>
sharerInfoLuw
=
Wrappers
.
lambdaUpdate
();
LambdaUpdateWrapper
<
SharerInfo
>
sharerInfoLuw
=
Wrappers
.
lambdaUpdate
();
sharerInfoLuw
.
set
(
SharerInfo:
:
getCommissionRatio
,
commissionRatio
);
sharerInfoLuw
.
set
(
SharerInfo:
:
getCommissionRatio
,
commissionRatio
);
...
@@ -578,4 +570,9 @@ public class DrmSharerConfig {
...
@@ -578,4 +570,9 @@ public class DrmSharerConfig {
.
filter
(
item
->
null
!=
item
.
getCommissionRatio
())
.
filter
(
item
->
null
!=
item
.
getCommissionRatio
())
.
collect
(
Collectors
.
toMap
(
CommissionSharerBO:
:
getOpenId
,
item
->
item
,
(
key1
,
key2
)
->
key2
));
.
collect
(
Collectors
.
toMap
(
CommissionSharerBO:
:
getOpenId
,
item
->
item
,
(
key1
,
key2
)
->
key2
));
}
}
public
Map
<
String
,
CommissionSharerBO
>
convertCommissionSharerMap
()
{
// 过滤禁用,转换成Map
return
convertCommissionSharerMap
(
getCommissionSharerList
());
}
}
}
\ No newline at end of file
yanxuan-wx-store-sharer-biz/src/main/java/com/netease/yanxuan/wx/store/sharer/biz/service/impl/UserServiceImpl.java
View file @
462b7721
...
@@ -45,12 +45,12 @@ import java.util.Date;
...
@@ -45,12 +45,12 @@ import java.util.Date;
public
class
UserServiceImpl
implements
IUserService
{
public
class
UserServiceImpl
implements
IUserService
{
private
final
SharerInfoMapper
sharerInfoMapper
;
private
final
SharerInfoMapper
sharerInfoMapper
;
private
final
DrmSharerConfig
drmSharerConfig
;
private
final
LoginUserHelper
loginUserHelper
;
private
final
LoginUserHelper
loginUserHelper
;
private
final
WeChatUserInfoRequest
weChatUserRequest
;
private
final
WeChatUserInfoRequest
weChatUserRequest
;
private
final
WeChatShopSharerRegisterBindRequest
weChatShopSharerRegisterBindRequest
;
private
final
WeChatShopSharerRegisterBindRequest
weChatShopSharerRegisterBindRequest
;
private
final
WeChatShopSharerListRequest
weChatShopSharerListRequest
;
private
final
WeChatShopSharerListRequest
weChatShopSharerListRequest
;
private
final
WeChatShopSetSharerCommissionRequest
weChatShopSetSharerCommissionRequest
;
private
final
WeChatShopSetSharerCommissionRequest
weChatShopSetSharerCommissionRequest
;
private
final
DrmSharerConfig
drmSharerConfig
;
@Override
@Override
...
@@ -95,6 +95,8 @@ public class UserServiceImpl implements IUserService {
...
@@ -95,6 +95,8 @@ public class UserServiceImpl implements IUserService {
}
}
WeChatSharerInfoVO
sharerInfoVO
;
WeChatSharerInfoVO
sharerInfoVO
;
Date
now
=
new
Date
();
Date
now
=
new
Date
();
// 用户分佣比例
BigDecimal
sharerCommissionRatio
=
drmSharerConfig
.
getSharerCommissionRatioOrDefault
(
loginUserInfo
.
getOpenId
());
// 已绑定
// 已绑定
if
(
SharerInfoVO
.
bindStatus
.
BIND
.
getCode
().
equals
(
result
.
getBindStatus
()))
{
if
(
SharerInfoVO
.
bindStatus
.
BIND
.
getCode
().
equals
(
result
.
getBindStatus
()))
{
// 获取绑定信息
// 获取绑定信息
...
@@ -102,6 +104,16 @@ public class UserServiceImpl implements IUserService {
...
@@ -102,6 +104,16 @@ public class UserServiceImpl implements IUserService {
if
(
null
!=
sharerListVO
&&
!
CollectionUtils
.
isEmpty
(
sharerListVO
.
getSharer_info_list
()))
{
if
(
null
!=
sharerListVO
&&
!
CollectionUtils
.
isEmpty
(
sharerListVO
.
getSharer_info_list
()))
{
sharerInfoVO
=
sharerListVO
.
getSharer_info_list
().
get
(
0
);
sharerInfoVO
=
sharerListVO
.
getSharer_info_list
().
get
(
0
);
if
(
null
!=
sharerInfoVO
)
{
if
(
null
!=
sharerInfoVO
)
{
// 判断默认分佣比例是否相同,不相同更新默认分佣比例
if
(
sharerCommissionRatio
.
compareTo
(
sharerInfoVO
.
getCommission_ratio
())
!=
0
)
{
// 更新默认分佣比例
BigDecimal
commissionRatio
=
sharerCommissionRatio
.
multiply
(
new
BigDecimal
(
WeChatApi
.
WECHAT_COMMISSION_RATIO_MULTIPLIER
))
.
setScale
(
0
,
RoundingMode
.
DOWN
);
// 设置推客分佣比例
weChatShopSetSharerCommissionRequest
.
handle
(
sharerInfoVO
.
getSharer_appid
(),
commissionRatio
.
longValue
());
}
result
.
setSharerAppId
(
sharerInfoVO
.
getSharer_appid
());
result
.
setSharerAppId
(
sharerInfoVO
.
getSharer_appid
());
sharerInfo
.
setSharerAppid
(
sharerInfoVO
.
getSharer_appid
());
sharerInfo
.
setSharerAppid
(
sharerInfoVO
.
getSharer_appid
());
Date
bindTime
=
null
!=
sharerInfoVO
.
getBind_time
()
?
new
Date
(
sharerInfoVO
.
getBind_time
())
:
now
;
Date
bindTime
=
null
!=
sharerInfoVO
.
getBind_time
()
?
new
Date
(
sharerInfoVO
.
getBind_time
())
:
now
;
...
@@ -122,7 +134,7 @@ public class UserServiceImpl implements IUserService {
...
@@ -122,7 +134,7 @@ public class UserServiceImpl implements IUserService {
// 初始化保存
// 初始化保存
if
(
null
==
sharerInfo
.
getId
())
{
if
(
null
==
sharerInfo
.
getId
())
{
// 默认佣金比例
// 默认佣金比例
sharerInfo
.
setCommissionRatio
(
drmSharerConfig
.
getDefaultCommissionRatio
()
.
toPlainString
());
sharerInfo
.
setCommissionRatio
(
sharerCommissionRatio
.
toPlainString
());
sharerInfo
.
setCommissionType
(
CommissionTypeEnum
.
PLATFORM
.
getCode
());
sharerInfo
.
setCommissionType
(
CommissionTypeEnum
.
PLATFORM
.
getCode
());
sharerInfo
.
setCreateTime
(
now
);
sharerInfo
.
setCreateTime
(
now
);
sharerInfo
.
setUpdateTime
(
now
);
sharerInfo
.
setUpdateTime
(
now
);
...
...
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