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
71ef5fff
Commit
71ef5fff
authored
Jun 27, 2024
by
shenjunjie
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature' into 'release'
工具集互动量更新-影响力计算逻辑调整 See merge request
!544
parents
5c3c6a63
0bd6a45b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
2 deletions
+22
-2
src/main/java/com/zhiwei/brandkbs2/service/impl/ToolsetServiceImpl.java
+22
-2
No files found.
src/main/java/com/zhiwei/brandkbs2/service/impl/ToolsetServiceImpl.java
View file @
71ef5fff
...
...
@@ -734,10 +734,14 @@ public class ToolsetServiceImpl implements ToolsetService {
?
data
.
getPlatformType
()
:
"网媒"
,
data
.
getChannel
()));
// 1.分别将等级为S,A,B,C的渠道各自加和
if
(
Objects
.
nonNull
(
channelInfluence
)){
// 2024/5/21修改:
无论表中是否
匹配,当类型为D,取值=1
// 2024/5/21修改:
即使表中
匹配,当类型为D,取值=1
if
(
Objects
.
equals
(
"D"
,
channelInfluence
.
getLevel
())){
channelInfluence
.
setInfluence
(
1
d
);
}
// 对于表中匹配上的非D级渠道:当表中的渠道影响力为0或1时,给予对应等级的默认值
if
(!
Objects
.
equals
(
"D"
,
channelInfluence
.
getLevel
())
&&
(
0
==
channelInfluence
.
getInfluence
()
||
1
==
channelInfluence
.
getInfluence
())){
channelInfluence
.
setInfluence
(
getMatchedDefaultChannelInf
(
channelInfluence
.
getLevel
()));
}
levelSumH
.
compute
(
channelInfluence
.
getLevel
(),
(
k
,
v
)
->
Objects
.
isNull
(
v
)
?
channelInfluence
.
getInfluence
()
:
BigDecimal
.
valueOf
(
v
).
add
(
BigDecimal
.
valueOf
(
channelInfluence
.
getInfluence
())).
doubleValue
());
...
...
@@ -764,6 +768,21 @@ public class ToolsetServiceImpl implements ToolsetService {
return
BigDecimal
.
valueOf
(
result
).
setScale
(
1
,
RoundingMode
.
HALF_UP
).
doubleValue
();
}
private
double
getMatchedDefaultChannelInf
(
String
level
){
switch
(
level
){
case
"A"
:
return
72.1
;
case
"B"
:
return
57.1
;
case
"C"
:
return
37.5
;
case
"S"
:
return
88.1
;
default
:
return
1
d
;
}
}
/**
* 计算实时传播力(RMI)
* @param data
...
...
@@ -885,7 +904,8 @@ public class ToolsetServiceImpl implements ToolsetService {
* @return
*/
private
double
computeFinalInf
(
double
inf
,
double
RMI
){
return
BigDecimal
.
valueOf
(
inf
).
add
(
BigDecimal
.
valueOf
(
RMI
)).
divide
(
BigDecimal
.
valueOf
(
2
),
1
,
RoundingMode
.
HALF_UP
).
doubleValue
();
double
finalInf
=
BigDecimal
.
valueOf
(
inf
).
add
(
BigDecimal
.
valueOf
(
RMI
)).
divide
(
BigDecimal
.
valueOf
(
2
),
1
,
RoundingMode
.
HALF_UP
).
doubleValue
();
return
finalInf
>
1
?
finalInf
:
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