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
d9d671f3
Commit
d9d671f3
authored
Mar 17, 2025
by
fanjiaxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
分佣配置结构调整
parent
1197d02d
Pipeline
#71719
passed with stages
in 1 minute 7 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
4 deletions
+20
-4
DrmSharerConfig.java
...e/yanxuan/wx/store/sharer/biz/config/DrmSharerConfig.java
+20
-4
No files found.
yanxuan-wx-store-sharer-biz/src/main/java/com/netease/yanxuan/wx/store/sharer/biz/config/DrmSharerConfig.java
View file @
d9d671f3
...
...
@@ -282,8 +282,19 @@ public class DrmSharerConfig {
*/
private
void
sharerProductCommissionRatioChange
(
ConfigChange
change
)
{
log
.
info
(
"ProductCommissionConfig:sharerProductCommissionRatioChange, change = {}"
,
JSON
.
toJSONString
(
change
));
List
<
CommissionSharerProductListBO
>
oldCommissionSharerList
=
JSON
.
parseArray
(
change
.
getOldValue
(),
CommissionSharerProductListBO
.
class
);
List
<
CommissionSharerProductListBO
>
newCommissionSharerList
=
JSON
.
parseArray
(
change
.
getNewValue
(),
CommissionSharerProductListBO
.
class
);
boolean
isOldBlank
=
StringUtils
.
isBlank
(
change
.
getOldValue
());
boolean
isNewBlank
=
StringUtils
.
isBlank
(
change
.
getNewValue
());
if
(
isOldBlank
&&
isNewBlank
)
{
return
;
}
List
<
CommissionSharerProductListBO
>
oldCommissionSharerList
=
new
ArrayList
<>(
0
);
if
(!
isOldBlank
)
{
oldCommissionSharerList
=
JSON
.
parseArray
(
change
.
getOldValue
(),
CommissionSharerProductListBO
.
class
);
}
List
<
CommissionSharerProductListBO
>
newCommissionSharerList
=
new
ArrayList
<>(
0
);
if
(!
isNewBlank
)
{
newCommissionSharerList
=
JSON
.
parseArray
(
change
.
getNewValue
(),
CommissionSharerProductListBO
.
class
);
}
// 过滤禁用,转换成Map
Map
<
String
,
CommissionSharerProductBO
>
oldCommissionMap
=
convertCommissionSharerProductBO
(
oldCommissionSharerList
);
Map
<
String
,
CommissionSharerProductBO
>
newCommissionMap
=
convertCommissionSharerProductBO
(
newCommissionSharerList
);
...
...
@@ -405,7 +416,7 @@ public class DrmSharerConfig {
return
;
}
SharerInfo
sharerInfo
=
getSharerInfoByOpenId
(
oldBo
.
getOpenId
());
if
(
null
==
sharerInfo
)
{
if
(
null
==
sharerInfo
)
{
return
;
}
// 设置推客分佣比例
...
...
@@ -541,9 +552,12 @@ public class DrmSharerConfig {
private
Map
<
String
,
CommissionSharerProductBO
>
convertCommissionSharerProductBO
(
List
<
CommissionSharerProductListBO
>
list
)
{
// 过滤禁用,转换成Map
return
Optional
.
ofNullable
(
list
)
Map
<
String
,
CommissionSharerProductBO
>
resultMap
=
Optional
.
ofNullable
(
list
)
.
orElseGet
(
ArrayList:
:
new
).
stream
()
.
filter
(
CommissionSharerProductListBO:
:
getEnable
)
.
filter
(
item
->
StringUtils
.
isNotBlank
(
item
.
getOpenId
()))
.
filter
(
item
->
StringUtils
.
isNotBlank
(
item
.
getProductId
()))
.
filter
(
item
->
null
!=
item
.
getCommissionRatio
())
.
flatMap
(
item
->
Arrays
.
stream
(
item
.
getProductId
().
split
(
","
))
.
map
(
productId
->
{
CommissionSharerProductBO
result
=
new
CommissionSharerProductBO
();
...
...
@@ -554,5 +568,6 @@ public class DrmSharerConfig {
return
result
;
}))
.
collect
(
Collectors
.
toMap
(
this
::
getSharerProductCommissionMapKey
,
Function
.
identity
()));
return
CollectionUtils
.
isEmpty
(
resultMap
)
?
new
HashMap
<>(
0
)
:
resultMap
;
}
}
\ No newline at end of file
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