Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
brandkbs2
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
shenjunjie
brandkbs2
Commits
64f6f90d
Commit
64f6f90d
authored
Sep 09, 2024
by
陈健智
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
字节影响力渠道分和流量分给予最小值1
parent
3a2b9022
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
src/main/java/com/zhiwei/brandkbs2/service/impl/ToolsetServiceImpl.java
+9
-4
No files found.
src/main/java/com/zhiwei/brandkbs2/service/impl/ToolsetServiceImpl.java
View file @
64f6f90d
...
...
@@ -561,7 +561,7 @@ public class ToolsetServiceImpl implements ToolsetService {
List
<
BytedanceCustomEventUpdateTaskData
>
data
=
entry
.
getValue
();
BytedanceCustomEventUpdateTask
.
EventInfo
eventInfo
=
new
BytedanceCustomEventUpdateTask
.
EventInfo
();
eventInfo
.
setName
(
eventName
);
eventInfo
.
setDataCount
(
data
.
size
(
));
eventInfo
.
setDataCount
(
Math
.
max
(
data
.
size
(),
1
));
// 计算影响力指数
eventInfo
.
setInfluence
(
computeInf
(
data
,
levelInfoMap
));
eventInfoMap
.
put
(
eventName
,
eventInfo
);
...
...
@@ -717,7 +717,7 @@ public class ToolsetServiceImpl implements ToolsetService {
private
Double
computeInf
(
List
<
BytedanceCustomEventUpdateTaskData
>
datas
,
Map
<
String
,
BytedanceCustomChannelLevelInfo
>
levelInfoMap
){
Map
<
String
,
Double
>
levelSumH
=
new
HashMap
<>(
5
);
if
(
CollectionUtils
.
isEmpty
(
datas
)){
return
0
d
;
return
1
d
;
}
for
(
BytedanceCustomEventUpdateTaskData
data
:
datas
)
{
// 匹配渠道影响力,微博、微信以外的平台一律按照”网媒“处理
...
...
@@ -757,7 +757,8 @@ public class ToolsetServiceImpl implements ToolsetService {
// 3.各自乘以权重 结果相加
result
=
INF
.
multiply
(
BigDecimal
.
valueOf
(
levelInfo
.
getWeight
())).
add
(
BigDecimal
.
valueOf
(
result
)).
doubleValue
();
}
return
BigDecimal
.
valueOf
(
result
).
setScale
(
1
,
RoundingMode
.
HALF_UP
).
doubleValue
();
double
resVal
=
BigDecimal
.
valueOf
(
result
).
setScale
(
1
,
RoundingMode
.
HALF_UP
).
doubleValue
();
return
resVal
>
1
?
resVal
:
1
d
;
}
private
double
getMatchedDefaultChannelInf
(
String
level
){
...
...
@@ -781,6 +782,9 @@ public class ToolsetServiceImpl implements ToolsetService {
* @return
*/
private
Double
computeRMI
(
List
<
BytedanceCustomEventUpdateTaskData
>
data
){
if
(
CollectionUtils
.
isEmpty
(
data
)){
return
1
d
;
}
// 1、初始值
// 微信文章数
int
wechatArticle
=
(
int
)
data
.
stream
().
filter
(
article
->
Objects
.
equals
(
"微信"
,
article
.
getPlatformType
())).
count
();
...
...
@@ -875,7 +879,7 @@ public class ToolsetServiceImpl implements ToolsetService {
// 头条互动数:TI标= ln(TI+1)/ln(TI常+1)*100.0
BigDecimal
TI
=
BigDecimal
.
valueOf
(
Math
.
log
(
toutiaoInteraction
+
1
)).
divide
(
BigDecimal
.
valueOf
(
Math
.
log
(
toutiaoInteractionWeight
.
getConstant
()
+
1
)),
20
,
RoundingMode
.
HALF_UP
).
multiply
(
bigDecimal100
);
// 标准值与权重计算取和得RMI
return
NM
.
multiply
(
BigDecimal
.
valueOf
(
normalMediaArticleWeight
.
getWeight
()))
double
resVal
=
NM
.
multiply
(
BigDecimal
.
valueOf
(
normalMediaArticleWeight
.
getWeight
()))
.
add
(
OM
.
multiply
(
BigDecimal
.
valueOf
(
otherPlatformArticleWeight
.
getWeight
())))
.
add
(
WC
.
multiply
(
BigDecimal
.
valueOf
(
wechatArticleWeight
.
getWeight
())))
.
add
(
WCR
.
multiply
(
BigDecimal
.
valueOf
(
wechatReadWeight
.
getWeight
())))
...
...
@@ -887,6 +891,7 @@ public class ToolsetServiceImpl implements ToolsetService {
.
add
(
TI
.
multiply
(
BigDecimal
.
valueOf
(
toutiaoInteractionWeight
.
getWeight
())))
.
setScale
(
1
,
RoundingMode
.
HALF_UP
)
.
doubleValue
();
return
resVal
>
1
?
resVal
:
1
d
;
}
/**
...
...
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