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
f59a9f20
Commit
f59a9f20
authored
Mar 13, 2025
by
fanjiaxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
联调问题处理
parent
4bb14474
Pipeline
#71565
passed with stages
in 1 minute 6 seconds
Changes
12
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
77 additions
and
21 deletions
+77
-21
DrmSharerConfig.java
...e/yanxuan/wx/store/sharer/biz/config/DrmSharerConfig.java
+6
-5
CommissionSharerProductBO.java
...e/sharer/biz/meta/model/bo/CommissionSharerProductBO.java
+1
-1
ProductListVO.java
...xuan/wx/store/sharer/biz/meta/model/vo/ProductListVO.java
+1
-1
ProductServiceImpl.java
.../wx/store/sharer/biz/service/impl/ProductServiceImpl.java
+7
-6
WeChatShopPromoteProductDetailRequest.java
...n/handler/impl/WeChatShopPromoteProductDetailRequest.java
+1
-1
WeChatShopPromoteProductLinkRequest.java
...ion/handler/impl/WeChatShopPromoteProductLinkRequest.java
+2
-2
WeChatShopPromoteProductListRequest.java
...ion/handler/impl/WeChatShopPromoteProductListRequest.java
+54
-0
WeChatShopSetSharerProductCommissionRequest.java
...ler/impl/WeChatShopSetSharerProductCommissionRequest.java
+1
-1
WeChatPromoteProductDetailBO.java
...tegration/meta/model/bo/WeChatPromoteProductDetailBO.java
+1
-1
WeChatPromoteProductLinkBO.java
...integration/meta/model/bo/WeChatPromoteProductLinkBO.java
+1
-1
WeChatSetSharerProductCommissionBO.java
...ion/meta/model/bo/WeChatSetSharerProductCommissionBO.java
+1
-1
WeChatPromoteProductListVO.java
...integration/meta/model/vo/WeChatPromoteProductListVO.java
+1
-1
No files found.
yanxuan-wx-store-sharer-biz/src/main/java/com/netease/yanxuan/wx/store/sharer/biz/config/DrmSharerConfig.java
View file @
f59a9f20
...
...
@@ -390,7 +390,8 @@ public class DrmSharerConfig {
boolean
isSuccess
=
false
;
try
{
// 设置推客分佣比例
weChatShopSetSharerProductCommissionRequest
.
handle
(
sharerAppid
,
oldBo
.
getProductId
(),
null
);
weChatShopSetSharerProductCommissionRequest
.
handle
(
sharerAppid
,
oldBo
.
getProductId
(),
null
);
isSuccess
=
true
;
}
catch
(
Exception
e
)
{
log
.
error
(
"设置推客的的分佣类型和比例信息失败"
,
e
);
...
...
@@ -406,7 +407,7 @@ public class DrmSharerConfig {
/**
* 保存推客商品分佣记录
*/
private
void
saveSharerProductCommissionRecord
(
String
sharerAppid
,
Integer
productId
,
private
void
saveSharerProductCommissionRecord
(
String
sharerAppid
,
String
productId
,
BigDecimal
oldCommissionRatio
,
BigDecimal
newCommissionRatio
,
CommissionChangeOptTypeEnum
optTypeEnum
,
...
...
@@ -417,7 +418,7 @@ public class DrmSharerConfig {
SharerProductCommissionRecord
record
=
new
SharerProductCommissionRecord
();
record
.
setOpenId
(
loginUserInfo
.
getOpenId
());
record
.
setSharerAppid
(
sharerAppid
);
record
.
setProductId
(
null
!=
productId
?
productId
.
toString
()
:
""
);
record
.
setProductId
(
productId
);
record
.
setOptType
(
optTypeEnum
.
getCode
());
record
.
setOptInfo
(
oldCommissionRatio
.
toPlainString
()
+
"&"
+
(
null
==
newCommissionRatio
?
""
:
newCommissionRatio
.
toPlainString
()));
...
...
@@ -436,7 +437,7 @@ public class DrmSharerConfig {
* 保存推客商品分佣金表
*/
private
void
saveSharerProductCommissionInfo
(
String
openId
,
Integer
productId
,
String
productId
,
BigDecimal
commissionRatio
,
SharerProductCommission
.
UnsetEnum
unsetEnum
)
{
String
sharerAppid
=
getSharerAppidByOpenId
(
openId
);
...
...
@@ -454,7 +455,7 @@ public class DrmSharerConfig {
sharerProductCommission
=
new
SharerProductCommission
();
sharerProductCommission
.
setOpenId
(
openId
);
sharerProductCommission
.
setSharerAppid
(
sharerAppid
);
sharerProductCommission
.
setProductId
(
productId
.
toString
()
);
sharerProductCommission
.
setProductId
(
productId
);
sharerProductCommission
.
setCommissionRatio
(
commissionRatio
);
sharerProductCommission
.
setCommissionType
(
CommissionTypeEnum
.
PLATFORM
.
getCode
());
sharerProductCommission
.
setUnset
(
unsetEnum
.
getCode
());
...
...
yanxuan-wx-store-sharer-biz/src/main/java/com/netease/yanxuan/wx/store/sharer/biz/meta/model/bo/CommissionSharerProductBO.java
View file @
f59a9f20
...
...
@@ -21,7 +21,7 @@ public class CommissionSharerProductBO implements Serializable {
/**
* 商品ID
*/
private
Integer
productId
;
private
String
productId
;
/**
* 分佣比例
*/
...
...
yanxuan-wx-store-sharer-biz/src/main/java/com/netease/yanxuan/wx/store/sharer/biz/meta/model/vo/ProductListVO.java
View file @
f59a9f20
...
...
@@ -34,7 +34,7 @@ public class ProductListVO {
/**
* 商品ID
*/
private
Integer
productId
;
private
String
productId
;
/**
* 商品推广链接
*/
...
...
yanxuan-wx-store-sharer-biz/src/main/java/com/netease/yanxuan/wx/store/sharer/biz/service/impl/ProductServiceImpl.java
View file @
f59a9f20
...
...
@@ -55,15 +55,15 @@ public class ProductServiceImpl implements IProductService {
.
map
(
item
->
{
WeChatPromoteProductDetailVO
detailVO
=
weChatShopPromoteProductDetailRequest
.
handle
(
item
.
getShop_appid
(),
item
.
getProduct_id
());
if
(
null
==
detailVO
)
{
if
(
null
==
detailVO
)
{
return
null
;
}
WeChatPromoteProductDetailVO
.
WeChatPromoteProductVO
product
=
detailVO
.
getProduct
();
if
(
null
==
product
)
{
if
(
null
==
product
)
{
return
null
;
}
WeChatPromoteProductDetailVO
.
WeChatPromoteProductVO
.
WeChatPromoteProductInfoVO
productInfo
=
product
.
getProduct_info
();
if
(
null
==
productInfo
)
{
if
(
null
==
productInfo
)
{
return
null
;
}
ProductListVO
listVO
=
new
ProductListVO
();
...
...
@@ -80,7 +80,7 @@ public class ProductServiceImpl implements IProductService {
BigDecimal
commissionRatio
=
drmSharerConfig
.
getDefaultCommissionRatio
();
// 获取用户信息
LoginUserInfo
loginUserInfo
=
LoginUserContextHolder
.
get
();
if
(
null
!=
loginUserInfo
&&
StringUtils
.
isNotBlank
(
loginUserInfo
.
getOpenId
()))
{
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
);
...
...
@@ -94,7 +94,7 @@ public class ProductServiceImpl implements IProductService {
Integer
serviceRatio
=
null
!=
commissionInfo
?
commissionInfo
.
getService_ratio
()
:
null
;
// 佣金=商品价格*服务费率*推客分佣比例,四舍五入保留小数点后两位
BigDecimal
commission
=
null
;
if
(
null
!=
price
&&
null
!=
commissionRatio
&&
null
!=
serviceRatio
)
{
if
(
null
!=
price
&&
null
!=
commissionRatio
&&
null
!=
serviceRatio
)
{
commission
=
price
.
multiply
(
new
BigDecimal
(
serviceRatio
.
toString
()))
.
multiply
(
commissionRatio
).
setScale
(
2
,
RoundingMode
.
HALF_UP
);
}
...
...
@@ -102,7 +102,8 @@ public class ProductServiceImpl implements IProductService {
listVO
.
setShopAppid
(
item
.
getShop_appid
());
listVO
.
setProductId
(
item
.
getProduct_id
());
// 获取推广链接
WeChatPromoteProductLinkVO
promoteProductLinkVO
=
weChatShopPromoteProductLinkRequest
.
handle
(
item
.
getShop_appid
(),
item
.
getProduct_id
());
WeChatPromoteProductLinkVO
promoteProductLinkVO
=
weChatShopPromoteProductLinkRequest
.
handle
(
item
.
getProduct_id
(),
item
.
getShop_appid
());
listVO
.
setProductUrl
(
null
!=
promoteProductLinkVO
?
promoteProductLinkVO
.
getShort_link
()
:
null
);
return
listVO
;
})
...
...
yanxuan-wx-store-sharer-integration/src/main/java/com/netease/yanxuan/wx/store/sharer/integration/handler/impl/WeChatShopPromoteProductDetailRequest.java
View file @
f59a9f20
...
...
@@ -42,7 +42,7 @@ public class WeChatShopPromoteProductDetailRequest implements IWeChatRequest {
/**
* 处理
*/
public
WeChatPromoteProductDetailVO
handle
(
String
shopAppid
,
Integer
productId
)
{
public
WeChatPromoteProductDetailVO
handle
(
String
shopAppid
,
String
productId
)
{
WeChatPromoteProductDetailBO
params
=
WeChatPromoteProductDetailBO
.
builder
()
.
plan_type
(
ProductPlanTypeEnum
.
OPEN
.
getCode
())
.
shop_appid
(
shopAppid
)
...
...
yanxuan-wx-store-sharer-integration/src/main/java/com/netease/yanxuan/wx/store/sharer/integration/handler/impl/WeChatShopPromoteProductLinkRequest.java
View file @
f59a9f20
...
...
@@ -41,10 +41,10 @@ public class WeChatShopPromoteProductLinkRequest implements IWeChatRequest {
/**
* 处理
*/
public
WeChatPromoteProductLinkVO
handle
(
String
sharerAppid
,
Integer
productI
d
)
{
public
WeChatPromoteProductLinkVO
handle
(
String
productId
,
String
shopAppi
d
)
{
WeChatPromoteProductLinkBO
params
=
WeChatPromoteProductLinkBO
.
builder
()
.
sharer_appid
(
sharerAppid
)
.
product_id
(
productId
)
.
shop_appid
(
shopAppid
)
.
build
();
return
weChatRestTemplateHandler
.
execute
(
getRequestUrl
(),
getRequestMethod
(),
params
,
WeChatPromoteProductLinkVO
.
class
);
}
...
...
yanxuan-wx-store-sharer-integration/src/main/java/com/netease/yanxuan/wx/store/sharer/integration/handler/impl/WeChatShopPromoteProductListRequest.java
View file @
f59a9f20
package
com
.
netease
.
yanxuan
.
wx
.
store
.
sharer
.
integration
.
handler
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.netease.yanxuan.wx.store.sharer.integration.config.WeChatConfig
;
import
com.netease.yanxuan.wx.store.sharer.integration.constant.WeChatApi
;
import
com.netease.yanxuan.wx.store.sharer.integration.core.WeChatContextHolder
;
...
...
@@ -51,4 +52,57 @@ public class WeChatShopPromoteProductListRequest implements IWeChatRequest {
.
build
();
return
weChatRestTemplateHandler
.
execute
(
getRequestUrl
(),
getRequestMethod
(),
params
,
WeChatPromoteProductListVO
.
class
);
}
public
static
void
main
(
String
[]
args
)
{
String
resultJson
=
"{\n"
+
" \"errcode\": 0,\n"
+
" \"errmsg\": \"ok\",\n"
+
" \"product_list\": [\n"
+
" {\n"
+
" \"product_id\": \"10000032169520\",\n"
+
" \"shop_appid\": \"wxdad237db7677c305\"\n"
+
" },\n"
+
" {\n"
+
" \"product_id\": \"10000157865162\",\n"
+
" \"shop_appid\": \"wx015b4279a9e8f6fa\"\n"
+
" },\n"
+
" {\n"
+
" \"product_id\": \"10000018293357\",\n"
+
" \"shop_appid\": \"wxe0aa3c442f854635\"\n"
+
" },\n"
+
" {\n"
+
" \"product_id\": \"10000129786349\",\n"
+
" \"shop_appid\": \"wx55ea53cbc4855c21\"\n"
+
" },\n"
+
" {\n"
+
" \"product_id\": \"10000168454112\",\n"
+
" \"shop_appid\": \"wxf69920284f28bbe3\"\n"
+
" },\n"
+
" {\n"
+
" \"product_id\": \"10000029788412\",\n"
+
" \"shop_appid\": \"wx31f74421a0acf076\"\n"
+
" },\n"
+
" {\n"
+
" \"product_id\": \"10000143496444\",\n"
+
" \"shop_appid\": \"wx15aa8d178f9946ca\"\n"
+
" },\n"
+
" {\n"
+
" \"product_id\": \"10000134193908\",\n"
+
" \"shop_appid\": \"wx2e8388eeeea714de\"\n"
+
" },\n"
+
" {\n"
+
" \"product_id\": \"10000144234386\",\n"
+
" \"shop_appid\": \"wxd4c232e8fe49f909\"\n"
+
" },\n"
+
" {\n"
+
" \"product_id\": \"10000076193764\",\n"
+
" \"shop_appid\": \"wx66b0a1ddf47badf0\"\n"
+
" }\n"
+
" ],\n"
+
" \"next_key\": \"CAoQChoWChQxMDAwMDAzMjk3MjY4MzM3NDMzMw==\"\n"
+
"}"
;
WeChatPromoteProductListVO
productListVO
=
JSON
.
parseObject
(
resultJson
,
WeChatPromoteProductListVO
.
class
);
System
.
err
.
println
(
JSON
.
toJSONString
(
productListVO
));
}
}
yanxuan-wx-store-sharer-integration/src/main/java/com/netease/yanxuan/wx/store/sharer/integration/handler/impl/WeChatShopSetSharerProductCommissionRequest.java
View file @
f59a9f20
...
...
@@ -41,7 +41,7 @@ public class WeChatShopSetSharerProductCommissionRequest implements IWeChatReque
/**
* 处理
*/
public
WeChatCoreVO
handle
(
String
sharerAppid
,
Integer
productId
,
String
commissionRatio
)
{
public
WeChatCoreVO
handle
(
String
sharerAppid
,
String
productId
,
String
commissionRatio
)
{
WeChatSetSharerProductCommissionBO
params
=
WeChatSetSharerProductCommissionBO
.
builder
()
.
sharer_appid
(
sharerAppid
)
.
product_id
(
productId
)
...
...
yanxuan-wx-store-sharer-integration/src/main/java/com/netease/yanxuan/wx/store/sharer/integration/meta/model/bo/WeChatPromoteProductDetailBO.java
View file @
f59a9f20
...
...
@@ -22,7 +22,7 @@ public class WeChatPromoteProductDetailBO implements Serializable {
/**
* 商品id
*/
private
Integer
product_id
;
private
String
product_id
;
/**
* 商品的计划类型 1:定向计划 2:公开计划
*/
...
...
yanxuan-wx-store-sharer-integration/src/main/java/com/netease/yanxuan/wx/store/sharer/integration/meta/model/bo/WeChatPromoteProductLinkBO.java
View file @
f59a9f20
...
...
@@ -26,7 +26,7 @@ public class WeChatPromoteProductLinkBO implements Serializable {
/**
* 商品 id,如果使用该参数,需要传入shop_appid
*/
private
Integer
product_id
;
private
String
product_id
;
/**
* 商品所属店铺 appid
*/
...
...
yanxuan-wx-store-sharer-integration/src/main/java/com/netease/yanxuan/wx/store/sharer/integration/meta/model/bo/WeChatSetSharerProductCommissionBO.java
View file @
f59a9f20
...
...
@@ -22,7 +22,7 @@ public class WeChatSetSharerProductCommissionBO implements Serializable {
/**
* 商品列表
*/
private
Integer
product_id
;
private
String
product_id
;
/**
* 平台分佣时的分佣比例,范围为【100000 - 900000】,代表【10%-90%】
*/
...
...
yanxuan-wx-store-sharer-integration/src/main/java/com/netease/yanxuan/wx/store/sharer/integration/meta/model/vo/WeChatPromoteProductListVO.java
View file @
f59a9f20
...
...
@@ -29,7 +29,7 @@ public class WeChatPromoteProductListVO extends WeChatCoreVO {
/**
* 商品ID
*/
private
Integer
product_id
;
private
String
product_id
;
/**
* 商品所属店铺 appid
...
...
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