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
4ec30ea6
Commit
4ec30ea6
authored
Mar 18, 2025
by
fanjiaxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
分佣比例记录表,加入异常信息
parent
b774ecdf
Pipeline
#71796
passed with stages
in 1 minute 9 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
9 deletions
+20
-9
DrmSharerConfig.java
...e/yanxuan/wx/store/sharer/biz/config/DrmSharerConfig.java
+20
-9
No files found.
yanxuan-wx-store-sharer-biz/src/main/java/com/netease/yanxuan/wx/store/sharer/biz/config/DrmSharerConfig.java
View file @
4ec30ea6
...
@@ -152,6 +152,7 @@ public class DrmSharerConfig {
...
@@ -152,6 +152,7 @@ public class DrmSharerConfig {
.
setScale
(
0
,
RoundingMode
.
DOWN
);
.
setScale
(
0
,
RoundingMode
.
DOWN
);
// 设置推客分佣比例
// 设置推客分佣比例
boolean
isSuccess
=
false
;
boolean
isSuccess
=
false
;
String
errorMsg
=
null
;
try
{
try
{
// 设置推客分佣比例
// 设置推客分佣比例
if
(
StringUtils
.
isNotBlank
(
sharerInfo
.
getSharerAppid
()))
{
if
(
StringUtils
.
isNotBlank
(
sharerInfo
.
getSharerAppid
()))
{
...
@@ -161,11 +162,12 @@ public class DrmSharerConfig {
...
@@ -161,11 +162,12 @@ public class DrmSharerConfig {
isSuccess
=
true
;
isSuccess
=
true
;
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"设置推客的的分佣类型和比例信息失败"
,
e
);
log
.
error
(
"设置推客的的分佣类型和比例信息失败"
,
e
);
errorMsg
=
StringUtils
.
substring
(
e
.
getMessage
(),
0
,
1000
);
}
finally
{
}
finally
{
// 保存记录
// 保存记录
saveSharerProductCommissionRecord
(
sharerInfo
.
getOpenId
(),
sharerInfo
.
getSharerAppid
(),
null
,
saveSharerProductCommissionRecord
(
sharerInfo
.
getOpenId
(),
sharerInfo
.
getSharerAppid
(),
null
,
new
BigDecimal
(
change
.
getOldValue
()),
new
BigDecimal
(
change
.
getNewValue
()),
new
BigDecimal
(
change
.
getOldValue
()),
new
BigDecimal
(
change
.
getNewValue
()),
CommissionChangeOptTypeEnum
.
DEFAULT_CHANGE
,
isSuccess
);
CommissionChangeOptTypeEnum
.
DEFAULT_CHANGE
,
isSuccess
,
errorMsg
);
}
}
}
}
...
@@ -210,18 +212,20 @@ public class DrmSharerConfig {
...
@@ -210,18 +212,20 @@ public class DrmSharerConfig {
}
}
// 设置推客分佣比例
// 设置推客分佣比例
boolean
isSuccess
=
false
;
boolean
isSuccess
=
false
;
String
errorMsg
=
null
;
try
{
try
{
// 更新分佣比例,同步微信
// 更新分佣比例,同步微信
updateSharerOrProductCommissionRatio
(
sharerInfo
,
newCommissionSharer
.
getCommissionRatio
());
updateSharerOrProductCommissionRatio
(
sharerInfo
,
newCommissionSharer
.
getCommissionRatio
());
isSuccess
=
true
;
isSuccess
=
true
;
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"设置推客的的分佣类型和比例信息失败"
,
e
);
log
.
error
(
"设置推客的的分佣类型和比例信息失败"
,
e
);
errorMsg
=
StringUtils
.
substring
(
e
.
getMessage
(),
0
,
1000
);
}
finally
{
}
finally
{
// 保存记录
// 保存记录
saveSharerProductCommissionRecord
(
sharerInfo
.
getOpenId
(),
sharerInfo
.
getSharerAppid
(),
null
,
saveSharerProductCommissionRecord
(
sharerInfo
.
getOpenId
(),
sharerInfo
.
getSharerAppid
(),
null
,
null
!=
oldCommissionSharer
?
oldCommissionSharer
.
getCommissionRatio
()
:
null
,
null
!=
oldCommissionSharer
?
oldCommissionSharer
.
getCommissionRatio
()
:
null
,
newCommissionSharer
.
getCommissionRatio
(),
newCommissionSharer
.
getCommissionRatio
(),
CommissionChangeOptTypeEnum
.
SET
,
isSuccess
);
CommissionChangeOptTypeEnum
.
SET
,
isSuccess
,
errorMsg
);
}
}
}
}
...
@@ -240,17 +244,19 @@ public class DrmSharerConfig {
...
@@ -240,17 +244,19 @@ public class DrmSharerConfig {
BigDecimal
sharerCommissionRatio
=
getDefaultCommissionRatio
();
BigDecimal
sharerCommissionRatio
=
getDefaultCommissionRatio
();
// 设置推客分佣比例
// 设置推客分佣比例
boolean
isSuccess
=
false
;
boolean
isSuccess
=
false
;
String
errorMsg
=
null
;
try
{
try
{
// 更新分佣比例,同步微信
// 更新分佣比例,同步微信
updateSharerOrProductCommissionRatio
(
sharerInfo
,
sharerCommissionRatio
);
updateSharerOrProductCommissionRatio
(
sharerInfo
,
sharerCommissionRatio
);
isSuccess
=
true
;
isSuccess
=
true
;
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"设置推客的的分佣类型和比例信息失败"
,
e
);
log
.
error
(
"设置推客的的分佣类型和比例信息失败"
,
e
);
errorMsg
=
StringUtils
.
substring
(
e
.
getMessage
(),
0
,
1000
);
}
finally
{
}
finally
{
// 保存记录
// 保存记录
saveSharerProductCommissionRecord
(
sharerInfo
.
getOpenId
(),
sharerInfo
.
getSharerAppid
(),
null
,
saveSharerProductCommissionRecord
(
sharerInfo
.
getOpenId
(),
sharerInfo
.
getSharerAppid
(),
null
,
oldCommissionSharer
.
getCommissionRatio
(),
sharerCommissionRatio
,
oldCommissionSharer
.
getCommissionRatio
(),
sharerCommissionRatio
,
CommissionChangeOptTypeEnum
.
UNSET
,
isSuccess
);
CommissionChangeOptTypeEnum
.
UNSET
,
isSuccess
,
errorMsg
);
}
}
}
}
...
@@ -322,6 +328,7 @@ public class DrmSharerConfig {
...
@@ -322,6 +328,7 @@ public class DrmSharerConfig {
BigDecimal
sharerCommissionRatio
=
getSharerCommissionRatio
(
openId
);
BigDecimal
sharerCommissionRatio
=
getSharerCommissionRatio
(
openId
);
return
null
!=
sharerCommissionRatio
?
sharerCommissionRatio
:
defaultCommissionRatio
;
return
null
!=
sharerCommissionRatio
?
sharerCommissionRatio
:
defaultCommissionRatio
;
}
}
/**
/**
* 获取推客分佣比例
* 获取推客分佣比例
*/
*/
...
@@ -358,6 +365,7 @@ public class DrmSharerConfig {
...
@@ -358,6 +365,7 @@ public class DrmSharerConfig {
.
setScale
(
0
,
RoundingMode
.
DOWN
);
.
setScale
(
0
,
RoundingMode
.
DOWN
);
// 设置推客分佣比例
// 设置推客分佣比例
boolean
isSuccess
=
false
;
boolean
isSuccess
=
false
;
String
errorMsg
=
null
;
try
{
try
{
if
(
StringUtils
.
isNotBlank
(
sharerInfo
.
getSharerAppid
()))
{
if
(
StringUtils
.
isNotBlank
(
sharerInfo
.
getSharerAppid
()))
{
// 设置推客分佣比例
// 设置推客分佣比例
...
@@ -371,13 +379,14 @@ public class DrmSharerConfig {
...
@@ -371,13 +379,14 @@ public class DrmSharerConfig {
isSuccess
=
true
;
isSuccess
=
true
;
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"设置推客的的分佣类型和比例信息失败"
,
e
);
log
.
error
(
"设置推客的的分佣类型和比例信息失败"
,
e
);
errorMsg
=
StringUtils
.
substring
(
e
.
getMessage
(),
0
,
1000
);
}
finally
{
}
finally
{
// 保存记录
// 保存记录
saveSharerProductCommissionRecord
(
sharerInfo
.
getOpenId
(),
saveSharerProductCommissionRecord
(
sharerInfo
.
getOpenId
(),
sharerInfo
.
getSharerAppid
(),
newBo
.
getProductId
(),
sharerInfo
.
getSharerAppid
(),
newBo
.
getProductId
(),
null
!=
oldBo
?
oldBo
.
getCommissionRatio
()
:
null
,
null
!=
oldBo
?
oldBo
.
getCommissionRatio
()
:
null
,
newBo
.
getCommissionRatio
(),
newBo
.
getCommissionRatio
(),
CommissionChangeOptTypeEnum
.
SET
,
isSuccess
);
CommissionChangeOptTypeEnum
.
SET
,
isSuccess
,
errorMsg
);
}
}
}
}
...
@@ -394,6 +403,7 @@ public class DrmSharerConfig {
...
@@ -394,6 +403,7 @@ public class DrmSharerConfig {
}
}
// 设置推客分佣比例
// 设置推客分佣比例
boolean
isSuccess
=
false
;
boolean
isSuccess
=
false
;
String
errorMsg
=
null
;
try
{
try
{
// 获取推客的分佣比例
// 获取推客的分佣比例
BigDecimal
sharerCommissionRatio
=
new
BigDecimal
(
sharerInfo
.
getCommissionRatio
());
BigDecimal
sharerCommissionRatio
=
new
BigDecimal
(
sharerInfo
.
getCommissionRatio
());
...
@@ -412,22 +422,23 @@ public class DrmSharerConfig {
...
@@ -412,22 +422,23 @@ public class DrmSharerConfig {
isSuccess
=
true
;
isSuccess
=
true
;
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"设置推客的的分佣类型和比例信息失败"
,
e
);
log
.
error
(
"设置推客的的分佣类型和比例信息失败"
,
e
);
errorMsg
=
StringUtils
.
substring
(
e
.
getMessage
(),
0
,
1000
);
}
finally
{
}
finally
{
// 保存记录
// 保存记录
saveSharerProductCommissionRecord
(
sharerInfo
.
getOpenId
(),
saveSharerProductCommissionRecord
(
sharerInfo
.
getOpenId
(),
sharerInfo
.
getSharerAppid
(),
oldBo
.
getProductId
(),
sharerInfo
.
getSharerAppid
(),
oldBo
.
getProductId
(),
oldBo
.
getCommissionRatio
(),
null
,
oldBo
.
getCommissionRatio
(),
null
,
CommissionChangeOptTypeEnum
.
UNSET
,
isSuccess
);
CommissionChangeOptTypeEnum
.
UNSET
,
isSuccess
,
errorMsg
);
}
}
}
}
/**
/**
* 保存推客商品分佣记录
* 保存推客商品分佣记录
*/
*/
private
void
saveSharerProductCommissionRecord
(
String
openId
,
String
sharerAppid
,
String
productId
,
private
void
saveSharerProductCommissionRecord
(
String
openId
,
String
sharerAppid
,
String
productId
,
BigDecimal
oldCommissionRatio
,
BigDecimal
newCommissionRatio
,
BigDecimal
oldCommissionRatio
,
BigDecimal
newCommissionRatio
,
CommissionChangeOptTypeEnum
optTypeEnum
,
boolean
isSuccess
)
{
CommissionChangeOptTypeEnum
optTypeEnum
,
boolean
isSuccess
,
String
extInfo
)
{
Date
now
=
new
Date
();
Date
now
=
new
Date
();
SharerProductCommissionRecord
record
=
new
SharerProductCommissionRecord
();
SharerProductCommissionRecord
record
=
new
SharerProductCommissionRecord
();
record
.
setOpenId
(
openId
);
record
.
setOpenId
(
openId
);
...
@@ -438,7 +449,7 @@ public class DrmSharerConfig {
...
@@ -438,7 +449,7 @@ public class DrmSharerConfig {
+
(
null
==
newCommissionRatio
?
""
:
newCommissionRatio
.
toPlainString
()));
+
(
null
==
newCommissionRatio
?
""
:
newCommissionRatio
.
toPlainString
()));
record
.
setOptTime
(
now
);
record
.
setOptTime
(
now
);
record
.
setOptStatus
(
isSuccess
?
"1"
:
"2"
);
record
.
setOptStatus
(
isSuccess
?
"1"
:
"2"
);
record
.
setExtInfo
(
""
);
record
.
setExtInfo
(
extInfo
);
record
.
setCreateTime
(
now
);
record
.
setCreateTime
(
now
);
record
.
setUpdateTime
(
now
);
record
.
setUpdateTime
(
now
);
sharerProdutcCommissionRecordMapper
.
insert
(
record
);
sharerProdutcCommissionRecordMapper
.
insert
(
record
);
...
@@ -467,7 +478,7 @@ public class DrmSharerConfig {
...
@@ -467,7 +478,7 @@ public class DrmSharerConfig {
sharerProductCommission
.
setCreateTime
(
now
);
sharerProductCommission
.
setCreateTime
(
now
);
}
}
// 配置
// 配置
if
(
SharerProductCommission
.
UnsetEnum
.
SET
.
equals
(
unsetEnum
))
{
if
(
SharerProductCommission
.
UnsetEnum
.
SET
.
equals
(
unsetEnum
))
{
// 微信分佣比例倍数
// 微信分佣比例倍数
BigDecimal
wechatMultiplier
=
new
BigDecimal
(
WeChatApi
.
WECHAT_COMMISSION_RATIO_MULTIPLIER
);
BigDecimal
wechatMultiplier
=
new
BigDecimal
(
WeChatApi
.
WECHAT_COMMISSION_RATIO_MULTIPLIER
);
commissionRatio
=
commissionRatio
commissionRatio
=
commissionRatio
...
...
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