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
f7b14568
Commit
f7b14568
authored
Mar 31, 2025
by
孙娇
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'hotfix-20250331-刷新用户信息' into 'master'
分支hotfix-20250331-刷新用户信息已上线,自动合并到master See merge request
!4
parents
9de611df
e4c6aa40
Pipeline
#75781
canceled with stages
Changes
3
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
38 deletions
+6
-38
IUserService.java
...ase/yanxuan/wx/store/sharer/biz/service/IUserService.java
+0
-5
UserServiceImpl.java
...uan/wx/store/sharer/biz/service/impl/UserServiceImpl.java
+6
-23
UserController.java
...anxuan/wx/store/sharer/web/controller/UserController.java
+0
-10
No files found.
yanxuan-wx-store-sharer-biz/src/main/java/com/netease/yanxuan/wx/store/sharer/biz/service/IUserService.java
View file @
f7b14568
...
...
@@ -30,9 +30,4 @@ public interface IUserService {
* 查询平台默认的分佣比例
*/
UserCommissionRatioVO
getCommissionRatioDefault
();
/**
* 绑定平台默认的分佣比例
*/
void
bindCommissionRatioDefault
();
}
yanxuan-wx-store-sharer-biz/src/main/java/com/netease/yanxuan/wx/store/sharer/biz/service/impl/UserServiceImpl.java
View file @
f7b14568
...
...
@@ -11,7 +11,6 @@ import com.netease.yanxuan.wx.store.sharer.biz.meta.model.vo.SharerInfoVO;
import
com.netease.yanxuan.wx.store.sharer.biz.meta.model.vo.UserCommissionRatioVO
;
import
com.netease.yanxuan.wx.store.sharer.biz.meta.model.vo.UserTokenVO
;
import
com.netease.yanxuan.wx.store.sharer.biz.service.IUserService
;
import
com.netease.yanxuan.wx.store.sharer.common.exception.NoBindSharerException
;
import
com.netease.yanxuan.wx.store.sharer.common.exception.WeChatException
;
import
com.netease.yanxuan.wx.store.sharer.dal.mapper.SharerInfoMapper
;
import
com.netease.yanxuan.wx.store.sharer.dal.meta.model.po.SharerInfo
;
...
...
@@ -114,8 +113,9 @@ public class UserServiceImpl implements IUserService {
Date
now
=
new
Date
();
// 用户分佣比例
BigDecimal
sharerCommissionRatio
=
drmSharerConfig
.
getSharerCommissionRatioOrDefault
(
loginUserInfo
.
getOpenId
());
// 已绑定
if
(
SharerInfoVO
.
bindStatus
.
BIND
.
getCode
().
equals
(
result
.
getBindStatus
()))
{
// 推客ID为空,则需要更新推客信息
if
(
StringUtils
.
isBlank
(
sharerInfo
.
getSharerAppid
())
&&
SharerInfoVO
.
bindStatus
.
BIND
.
getCode
().
equals
(
result
.
getBindStatus
()))
{
// 获取绑定信息
WeChatSharerListVO
sharerListVO
=
weChatShopSharerListRequest
.
handle
(
loginUserInfo
.
getOpenId
(),
""
,
1
);
if
(
null
!=
sharerListVO
&&
!
CollectionUtils
.
isEmpty
(
sharerListVO
.
getSharer_info_list
()))
{
...
...
@@ -134,15 +134,15 @@ public class UserServiceImpl implements IUserService {
}
result
.
setSharerAppId
(
sharerInfoVO
.
getSharer_appid
());
sharerInfo
.
setSharerAppid
(
sharerInfoVO
.
getSharer_appid
());
Date
bindTime
=
null
!=
sharerInfoVO
.
getBind_time
()
?
new
Date
(
sharerInfoVO
.
getBind_time
())
:
now
;
sharerInfo
.
setBindTime
(
bindTime
);
sharerInfo
.
setBindTime
(
now
);
// 微信分佣比例倍数
BigDecimal
wechatMultiplier
=
new
BigDecimal
(
WeChatApi
.
WECHAT_COMMISSION_RATIO_MULTIPLIER
);
BigDecimal
commissionRatio
=
sharerInfoVO
.
getCommission_ratio
()
.
divide
(
wechatMultiplier
)
.
setScale
(
2
,
RoundingMode
.
HALF_UP
);
sharerInfo
.
setCommissionRatio
(
commissionRatio
.
toPlainString
());
Integer
commissionType
=
null
!=
sharerInfoVO
.
getCommission_type
()
?
sharerInfoVO
.
getCommission_type
()
:
CommissionTypeEnum
.
PLATFORM
.
getCode
();
Integer
commissionType
=
null
!=
sharerInfoVO
.
getCommission_type
()
?
sharerInfoVO
.
getCommission_type
()
:
CommissionTypeEnum
.
PLATFORM
.
getCode
();
sharerInfo
.
setCommissionType
(
commissionType
);
// 刷新缓存
loginUserHelper
.
setLoginUserInfo
(
loginUserInfo
.
getAccessToken
(),
sharerInfoVO
.
getSharer_appid
());
...
...
@@ -185,23 +185,6 @@ public class UserServiceImpl implements IUserService {
return
UserCommissionRatioVO
.
builder
().
commissionRatio
(
defaultCommissionRatio
).
build
();
}
@Override
public
void
bindCommissionRatioDefault
()
{
// 获取用户信息
LoginUserInfo
loginUserInfo
=
LoginUserContextHolder
.
get
();
if
(
StringUtils
.
isBlank
(
loginUserInfo
.
getSharerAppId
()))
{
throw
new
NoBindSharerException
(
"未绑定推客"
);
}
log
.
info
(
"op:bindCommissionRatioDefault:setSharerCommission,openId:{}"
,
loginUserInfo
.
getOpenId
());
BigDecimal
sharerCommissionRatio
=
drmSharerConfig
.
getSharerCommissionRatioOrDefault
(
loginUserInfo
.
getOpenId
());
BigDecimal
commissionRatio
=
sharerCommissionRatio
.
multiply
(
new
BigDecimal
(
WeChatApi
.
WECHAT_COMMISSION_RATIO_MULTIPLIER
))
.
setScale
(
0
,
RoundingMode
.
DOWN
);
// 设置推客分佣比例
weChatShopSetSharerCommissionRequest
.
handle
(
loginUserInfo
.
getSharerAppId
(),
commissionRatio
.
longValue
());
}
private
SharerInfoVO
getSharerRegisterBindInfo
(
String
openId
)
{
// 获取推客注册与绑定信息
WeChatSharerRegisterBindVO
sharerRegisterBindVO
=
weChatShopSharerRegisterBindRequest
.
handle
(
openId
);
...
...
yanxuan-wx-store-sharer-web/src/main/java/com/netease/yanxuan/wx/store/sharer/web/controller/UserController.java
View file @
f7b14568
...
...
@@ -63,14 +63,4 @@ public class UserController extends BaseController {
UserCommissionRatioVO
result
=
iUserService
.
getCommissionRatioDefault
();
return
Result
.
ok
(
result
);
}
/**
* 绑定平台默认的分佣比例
*/
@PostMapping
(
"/bindCommissionRatioDefault"
)
public
Result
<
UserCommissionRatioVO
>
bindCommissionRatioDefault
()
{
log
.
info
(
"[op:bindCommissionRatioDefault] bind ratioDefault bind"
);
iUserService
.
bindCommissionRatioDefault
();
return
Result
.
ok
();
}
}
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