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
86d9e539
Commit
86d9e539
authored
Mar 20, 2023
by
shenjunjie
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature' into 'release'
修复平台分布统计bug See merge request
!251
parents
5f262d04
3e8f2122
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
src/main/java/com/zhiwei/brandkbs2/service/impl/MarkDataServiceImpl.java
+4
-4
No files found.
src/main/java/com/zhiwei/brandkbs2/service/impl/MarkDataServiceImpl.java
View file @
86d9e539
...
...
@@ -427,7 +427,7 @@ public class MarkDataServiceImpl implements MarkDataService {
}
result
.
put
(
"negTopTitle"
,
topTitle
);
// 舆情库默认contendId为0
List
<
JSONObject
>
articlePlatformProportion
=
getMarkPlatformProportion
(
startTime
,
endTime
,
projectId
,
linkedGroupId
,
Constant
.
PRIMARY_CONTEND_ID
,
true
);
List
<
JSONObject
>
articlePlatformProportion
=
getMarkPlatformProportion
(
startTime
,
endTime
,
projectId
,
Constant
.
PRIMARY_CONTEND_ID
,
null
,
true
);
result
.
put
(
"platformRank"
,
articlePlatformProportion
.
stream
().
filter
(
articlePlatform
->
articlePlatform
.
getLongValue
(
"count"
)
>
0
).
sorted
((
o1
,
o2
)
->
o2
.
getLong
(
"count"
).
compareTo
(
o1
.
getLong
(
"count"
))).
collect
(
Collectors
.
toList
()));
redisUtil
.
setExpire
(
redisKey
,
JSON
.
toJSONString
(
result
));
return
result
;
...
...
@@ -1115,7 +1115,7 @@ public class MarkDataServiceImpl implements MarkDataService {
result
.
put
(
"days"
,
new
Period
(
dto
.
getStartTime
(),
dto
.
getEndTime
(),
PeriodType
.
days
()).
getDays
());
result
.
put
(
"priName"
,
project
.
getBrandName
());
// 获取时间段主品牌在每个平台传播量占比
List
<
JSONObject
>
primaryPlatformsProportion
=
getMarkPlatformProportion
(
dto
.
getStartTime
(),
dto
.
getEndTime
(),
dto
.
getProjectId
(),
dto
.
getLinkedGroupId
(),
Constant
.
PRIMARY_CONTEND_ID
,
true
);
List
<
JSONObject
>
primaryPlatformsProportion
=
getMarkPlatformProportion
(
dto
.
getStartTime
(),
dto
.
getEndTime
(),
dto
.
getProjectId
(),
Constant
.
PRIMARY_CONTEND_ID
,
null
,
true
);
// 获取时间段主品牌总传播量
long
primaryTotalCount
=
primaryPlatformsProportion
.
stream
().
mapToLong
(
platform
->
platform
.
getLongValue
(
"count"
)).
sum
();
result
.
put
(
"priNorTotal"
,
primaryTotalCount
);
...
...
@@ -1128,7 +1128,7 @@ public class MarkDataServiceImpl implements MarkDataService {
result
.
put
(
"conName"
,
brandName
);
// 获取时间段竞品在每个平台传播量
String
contendLinkedGroupId
=
projectService
.
getProjectByContendId
(
dto
.
getProjectId
(),
dto
.
getContendId
()).
getBrandLinkedGroupId
();
List
<
JSONObject
>
contendPlatformsProportion
=
getMarkPlatformProportion
(
dto
.
getStartTime
(),
dto
.
getEndTime
(),
dto
.
getProjectId
(),
contendLinkedGroupId
,
dto
.
getContendId
()
,
true
);
List
<
JSONObject
>
contendPlatformsProportion
=
getMarkPlatformProportion
(
dto
.
getStartTime
(),
dto
.
getEndTime
(),
dto
.
getProjectId
(),
dto
.
getContendId
(),
null
,
true
);
// 获取时间段竞品总传播量
long
contendTotalCount
=
contendPlatformsProportion
.
stream
().
mapToLong
(
platform
->
platform
.
getLongValue
(
"count"
)).
sum
();
result
.
put
(
"conNorTotal"
,
contendTotalCount
);
...
...
@@ -1793,7 +1793,7 @@ public class MarkDataServiceImpl implements MarkDataService {
}
private
List
<
JSONObject
>
getMarkPlatformProportion
(
Long
startTime
,
Long
endTime
,
String
projectId
,
String
contendId
,
String
emotion
,
boolean
cache
)
throws
IOException
{
String
redisKey
=
RedisKeyPrefix
.
MARK_PLATFORM_PROPORTION
+
Tools
.
concat
(
projectId
,
contendId
,
startTime
,
endTime
);
String
redisKey
=
RedisKeyPrefix
.
MARK_PLATFORM_PROPORTION
+
Tools
.
concat
(
projectId
,
contendId
,
emotion
,
startTime
,
endTime
);
String
resultStr
;
if
(
cache
&&
StringUtils
.
isNotEmpty
(
resultStr
=
redisUtil
.
get
(
redisKey
)))
{
return
JSON
.
parseArray
(
resultStr
,
JSONObject
.
class
);
...
...
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