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
973ce022
Commit
973ce022
authored
Aug 05, 2022
by
shentao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2022/8/5 事件详情热门文章分析补全
parent
b993b864
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
6 deletions
+15
-6
src/main/java/com/zhiwei/brandkbs2/service/EventService.java
+1
-1
src/main/java/com/zhiwei/brandkbs2/service/impl/EventServiceImpl.java
+14
-5
No files found.
src/main/java/com/zhiwei/brandkbs2/service/EventService.java
View file @
973ce022
...
...
@@ -267,5 +267,5 @@ public interface EventService {
* @param aggTitle
* @return
*/
Map
<
String
,
List
<
EventTopArticlesAnalysisVO
>>
getEventTopArticlesAnalysis
(
String
id
,
String
type
,
String
emotion
,
String
aggTitle
);
JSONObject
getEventTopArticlesAnalysis
(
String
id
,
String
type
,
String
emotion
,
String
aggTitle
);
}
src/main/java/com/zhiwei/brandkbs2/service/impl/EventServiceImpl.java
View file @
973ce022
...
...
@@ -601,23 +601,32 @@ public class EventServiceImpl implements EventService {
}
@Override
public
Map
<
String
,
List
<
EventTopArticlesAnalysisVO
>>
getEventTopArticlesAnalysis
(
String
eventId
,
String
type
,
String
emotion
,
String
aggTitle
)
{
public
JSONObject
getEventTopArticlesAnalysis
(
String
eventId
,
String
type
,
String
emotion
,
String
aggTitle
)
{
JSONObject
res
=
new
JSONObject
();
// 传播方向
Event
event
=
getEventById
(
eventId
);
res
.
put
(
"detail"
,
event
.
getEventTopArticlesAnalysisDetail
());
// 分析结果
res
.
put
(
"type"
,
type
);
Query
query
=
new
Query
(
Criteria
.
where
(
"eventId"
).
is
(
eventId
).
and
(
"type"
).
is
(
type
));
if
(!
Objects
.
equals
(
"全部"
,
emotion
))
{
query
.
addCriteria
(
Criteria
.
where
(
"emotion"
).
is
(
emotion
));
}
List
<
EventTopArticlesAnalysis
>
eventTopArticlesAnalyses
=
eventTopArticlesAnalysisDao
.
findList
(
query
);
switch
(
type
){
switch
(
type
)
{
case
"按时间"
:
Map
<
String
,
List
<
EventTopArticlesAnalysisVO
>>
collect
=
eventTopArticlesAnalyses
.
stream
()
.
map
(
eventTopArticlesAnalysis
->
{
boolean
highLight
=
Objects
.
equals
(
aggTitle
,
eventTopArticlesAnalysis
.
getAggTitle
());
return
new
EventTopArticlesAnalysisVO
(
eventTopArticlesAnalysis
,
highLight
);
}).
collect
(
Collectors
.
groupingBy
(
EventTopArticlesAnalysisVO:
:
getTimePoint
));
return
collect
;
res
.
put
(
"dataDay"
,
collect
);
res
.
put
(
"dataAmount"
,
null
);
return
res
;
case
"按数量"
:
// TODO: 2022/8/4
return
null
;
res
.
put
(
"dataDay"
,
null
);
res
.
put
(
"dataAmount"
,
eventTopArticlesAnalyses
);
return
res
;
default
:
throw
new
IllegalStateException
(
"Unexpected value: "
+
type
);
}
...
...
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