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
d0ec777a
Commit
d0ec777a
authored
Mar 17, 2025
by
fanjiaxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
分佣配置加入状态
parent
d287b53b
Pipeline
#71702
passed with stages
in 1 minute 3 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
16 deletions
+44
-16
ProductServiceImpl.java
.../wx/store/sharer/biz/service/impl/ProductServiceImpl.java
+43
-15
WeChatShopSharerListRequest.java
...integration/handler/impl/WeChatShopSharerListRequest.java
+1
-1
No files found.
yanxuan-wx-store-sharer-biz/src/main/java/com/netease/yanxuan/wx/store/sharer/biz/service/impl/ProductServiceImpl.java
View file @
d0ec777a
...
...
@@ -92,21 +92,6 @@ public class ProductServiceImpl implements IProductService {
price
=
priceOpt
.
get
().
divide
(
new
BigDecimal
(
"100"
));
listVO
.
setPrice
(
price
.
setScale
(
2
,
RoundingMode
.
HALF_UP
));
}
// 推客分佣比例
BigDecimal
commissionRatio
=
drmSharerConfig
.
getDefaultCommissionRatio
();
log
.
info
(
"商品:{},默认佣金比例:{}"
,
item
.
getProduct_id
(),
commissionRatio
);
if
(
null
!=
loginUserInfo
&&
StringUtils
.
isNotBlank
(
loginUserInfo
.
getOpenId
()))
{
WeChatSharerListVO
sharerListVO
=
weChatShopSharerListRequest
.
handle
(
loginUserInfo
.
getOpenId
(),
""
,
1
);
if
(
null
!=
sharerListVO
&&
!
CollectionUtils
.
isEmpty
(
sharerListVO
.
getSharer_info_list
()))
{
WeChatSharerInfoVO
sharerInfoVO
=
sharerListVO
.
getSharer_info_list
().
get
(
0
);
if
(
null
!=
sharerInfoVO
&&
null
!=
sharerInfoVO
.
getCommission_ratio
())
{
log
.
info
(
"商品:{},微信佣金比例:{}"
,
item
.
getProduct_id
(),
sharerInfoVO
.
getCommission_ratio
());
// 微信分佣比例倍数
BigDecimal
wechatMultiplier
=
new
BigDecimal
(
WeChatApi
.
WECHAT_COMMISSION_RATIO_MULTIPLIER
);
commissionRatio
=
sharerInfoVO
.
getCommission_ratio
().
divide
(
wechatMultiplier
);
}
}
}
WeChatPromoteProductDetailVO
.
WeChatPromoteProductVO
.
WeChatPromoteProductCommissionInfoVO
commissionInfo
=
product
.
getCommission_info
();
// 服务费率
...
...
@@ -117,6 +102,8 @@ public class ProductServiceImpl implements IProductService {
}
// 佣金=商品价格*服务费率*推客分佣比例,四舍五入保留小数点后两位
BigDecimal
commission
=
BigDecimal
.
ZERO
;
// 推客分佣比例
BigDecimal
commissionRatio
=
getSharerCommissionRatio
(
loginUserInfo
,
item
.
getProduct_id
());
if
(
null
!=
price
&&
null
!=
commissionRatio
&&
null
!=
serviceRatio
)
{
commission
=
price
.
multiply
(
serviceRatio
).
multiply
(
commissionRatio
)
.
setScale
(
2
,
RoundingMode
.
HALF_UP
);
...
...
@@ -190,4 +177,45 @@ public class ProductServiceImpl implements IProductService {
}
return
detailVO
;
}
/**
* 获取推客分佣比例
*/
private
BigDecimal
getSharerCommissionRatio
(
LoginUserInfo
loginUserInfo
,
String
productId
)
{
// 默认佣金比例
BigDecimal
commissionRatio
=
drmSharerConfig
.
getDefaultCommissionRatio
();
log
.
info
(
"商品:{},默认佣金比例:{}"
,
productId
,
commissionRatio
);
if
(
null
!=
loginUserInfo
)
{
// 微信配置分佣比例
BigDecimal
weChatCommissionRatio
=
null
;
// 微信分佣比例倍数
BigDecimal
wechatMultiplier
=
new
BigDecimal
(
WeChatApi
.
WECHAT_COMMISSION_RATIO_MULTIPLIER
);
// 获取商品纬度分佣比例
if
(
StringUtils
.
isNotBlank
(
loginUserInfo
.
getSharerAppId
()))
{
WeChatGetSharerProductCommissionVO
sharerProductCommissionVO
=
weChatShopGetSharerProductCommissionRequest
.
handle
(
loginUserInfo
.
getSharerAppId
(),
Long
.
valueOf
(
productId
));
if
(
sharerProductCommissionVO
.
getIs_set
())
{
weChatCommissionRatio
=
new
BigDecimal
(
sharerProductCommissionVO
.
getCommission_ratio
());
log
.
info
(
"商品:{},微信商品纬度佣金比例:{}"
,
productId
,
weChatCommissionRatio
);
}
}
// 获取推客纬度分佣比例
if
(
null
==
weChatCommissionRatio
&&
StringUtils
.
isNotBlank
(
loginUserInfo
.
getOpenId
()))
{
WeChatSharerListVO
sharerListVO
=
weChatShopSharerListRequest
.
handle
(
loginUserInfo
.
getOpenId
(),
""
,
1
);
if
(
null
!=
sharerListVO
&&
!
CollectionUtils
.
isEmpty
(
sharerListVO
.
getSharer_info_list
()))
{
WeChatSharerInfoVO
sharerInfoVO
=
sharerListVO
.
getSharer_info_list
().
get
(
0
);
if
(
null
!=
sharerInfoVO
&&
null
!=
sharerInfoVO
.
getCommission_ratio
())
{
weChatCommissionRatio
=
sharerInfoVO
.
getCommission_ratio
();
log
.
info
(
"商品:{},微信推客纬度佣金比例:{}"
,
productId
,
weChatCommissionRatio
);
}
}
}
if
(
null
!=
weChatCommissionRatio
)
{
commissionRatio
=
weChatCommissionRatio
.
divide
(
wechatMultiplier
)
.
setScale
(
2
,
RoundingMode
.
HALF_UP
);
}
}
return
commissionRatio
;
}
}
yanxuan-wx-store-sharer-integration/src/main/java/com/netease/yanxuan/wx/store/sharer/integration/handler/impl/WeChatShopSharerListRequest.java
View file @
d0ec777a
...
...
@@ -13,7 +13,7 @@ import org.springframework.http.HttpMethod;
import
org.springframework.stereotype.Service
;
/**
* @Description
微信凭证请求
* @Description
获取机构绑定的推客信息
* @Author fanjiaxin
* @Date 2025/3/11 17:33
*/
...
...
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