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
b6330479
Commit
b6330479
authored
Aug 16, 2022
by
shenjunjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
恢复舆情数据聚合功能
parent
4e60b856
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
8 deletions
+3
-8
src/main/java/com/zhiwei/brandkbs2/service/impl/EventServiceImpl.java
+1
-2
src/main/java/com/zhiwei/brandkbs2/service/impl/MarkDataServiceImpl.java
+2
-6
No files found.
src/main/java/com/zhiwei/brandkbs2/service/impl/EventServiceImpl.java
View file @
b6330479
...
@@ -552,8 +552,7 @@ public class EventServiceImpl implements EventService {
...
@@ -552,8 +552,7 @@ public class EventServiceImpl implements EventService {
// 未保证排序
// 未保证排序
Map
<
String
,
EventListInfoVO
>
sortMap
=
eventList
.
stream
().
collect
(
Collectors
.
toConcurrentMap
(
Event:
:
getId
,
EventListInfoVO:
:
new
));
Map
<
String
,
EventListInfoVO
>
sortMap
=
eventList
.
stream
().
collect
(
Collectors
.
toConcurrentMap
(
Event:
:
getId
,
EventListInfoVO:
:
new
));
CompletableFuture
.
allOf
(
eventList
.
stream
().
map
(
event
->
eventDataDao
.
findFirstDataAsync
(
event
.
getId
(),
event
.
getCollectionName
()).
thenApply
((
r
)
->
{
CompletableFuture
.
allOf
(
eventList
.
stream
().
map
(
event
->
eventDataDao
.
findFirstDataAsync
(
event
.
getId
(),
event
.
getCollectionName
()).
thenApply
((
r
)
->
{
// 放入首发稿件
// 设置首发稿件
EventListInfoVO
vo
=
new
EventListInfoVO
(
event
);
sortMap
.
get
(
event
.
getId
()).
setFirstEventData
(
r
);
sortMap
.
get
(
event
.
getId
()).
setFirstEventData
(
r
);
return
null
;
return
null
;
})).
toArray
(
CompletableFuture
[]::
new
)).
join
();
})).
toArray
(
CompletableFuture
[]::
new
)).
join
();
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/MarkDataServiceImpl.java
View file @
b6330479
...
@@ -63,7 +63,6 @@ import org.springframework.stereotype.Service;
...
@@ -63,7 +63,6 @@ import org.springframework.stereotype.Service;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.*
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.TimeUnit
;
...
@@ -603,10 +602,8 @@ public class MarkDataServiceImpl implements MarkDataService {
...
@@ -603,10 +602,8 @@ public class MarkDataServiceImpl implements MarkDataService {
private
Pair
<
SearchHits
[],
Map
<
String
,
Long
>>
searchMarkHitsAndCount
(
MarkSearchDTO
dto
,
boolean
aggree
)
throws
IOException
{
private
Pair
<
SearchHits
[],
Map
<
String
,
Long
>>
searchMarkHitsAndCount
(
MarkSearchDTO
dto
,
boolean
aggree
)
throws
IOException
{
EsClientDao
.
SearchHelper
helper
=
createSearchHelperByMarkSearchDTO
(
dto
);
EsClientDao
.
SearchHelper
helper
=
createSearchHelperByMarkSearchDTO
(
dto
);
if
(
aggree
)
{
if
(
aggree
)
{
helper
.
setSize
(
0
);
List
<
SearchResponse
>
searchResponses
=
esClientDao
.
searchScrollResponse
(
helper
);
// TODO 本地调试不滚动查询
// <SearchResponse> searchResponses = Collections.singletonList(esClientDao.searchResponse(helper));
// List<SearchResponse> searchResponses = esClientDao.searchScrollResponse(helper);
List
<
SearchResponse
>
searchResponses
=
Collections
.
singletonList
(
esClientDao
.
searchResponse
(
helper
));
return
Pair
.
of
(
searchResponses
.
stream
().
map
(
SearchResponse:
:
getHits
).
toArray
(
SearchHits
[]::
new
),
null
);
return
Pair
.
of
(
searchResponses
.
stream
().
map
(
SearchResponse:
:
getHits
).
toArray
(
SearchHits
[]::
new
),
null
);
}
}
SearchHits
searchHits
=
esClientDao
.
searchHits
(
helper
);
SearchHits
searchHits
=
esClientDao
.
searchHits
(
helper
);
...
@@ -917,7 +914,6 @@ public class MarkDataServiceImpl implements MarkDataService {
...
@@ -917,7 +914,6 @@ public class MarkDataServiceImpl implements MarkDataService {
private
Pair
<
SearchHits
[],
Map
<
String
,
Long
>>
searchContendMarkHitsAndCount
(
MarkSearchDTO
dto
,
boolean
aggree
)
throws
IOException
{
private
Pair
<
SearchHits
[],
Map
<
String
,
Long
>>
searchContendMarkHitsAndCount
(
MarkSearchDTO
dto
,
boolean
aggree
)
throws
IOException
{
EsClientDao
.
SearchHelper
helper
=
createContendSearchHelper
(
dto
);
EsClientDao
.
SearchHelper
helper
=
createContendSearchHelper
(
dto
);
if
(
aggree
)
{
if
(
aggree
)
{
helper
.
setSize
(
0
);
// TODO 本地调试不滚动查询
// TODO 本地调试不滚动查询
// List<SearchResponse> searchResponses = esClientDao.searchScrollResponse(helper);
// List<SearchResponse> searchResponses = esClientDao.searchScrollResponse(helper);
List
<
SearchResponse
>
searchResponses
=
Collections
.
singletonList
(
esClientDao
.
searchResponse
(
helper
));
List
<
SearchResponse
>
searchResponses
=
Collections
.
singletonList
(
esClientDao
.
searchResponse
(
helper
));
...
...
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