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
cd53b006
Commit
cd53b006
authored
Jul 09, 2024
by
陈健智
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
互动量更新补充视频地址和图片地址更新
parent
c8b64f6d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
src/main/java/com/zhiwei/brandkbs2/service/impl/TaskServiceImpl.java
+13
-2
No files found.
src/main/java/com/zhiwei/brandkbs2/service/impl/TaskServiceImpl.java
View file @
cd53b006
...
@@ -498,7 +498,8 @@ public class TaskServiceImpl implements TaskService {
...
@@ -498,7 +498,8 @@ public class TaskServiceImpl implements TaskService {
if
(
CollectionUtils
.
isNotEmpty
(
platforms
))
{
if
(
CollectionUtils
.
isNotEmpty
(
platforms
))
{
postFilter
.
must
(
EsQueryTools
.
assemblePlatformQuery
(
Tools
.
getPlatformByIds
(
platforms
)));
postFilter
.
must
(
EsQueryTools
.
assemblePlatformQuery
(
Tools
.
getPlatformByIds
(
platforms
)));
}
}
List
<
JSONObject
>
list
=
esClientDao
.
searchScroll
(
postFilter
,
10000
,
new
String
[]{
"id"
,
"like_num"
,
"favourites_num"
,
"comment_num"
,
"share_num"
,
"time"
,
"url"
});
List
<
JSONObject
>
list
=
esClientDao
.
searchScroll
(
postFilter
,
10000
,
new
String
[]{
"id"
,
"like_num"
,
"favourites_num"
,
"comment_num"
,
"share_num"
,
"time"
,
"url"
,
"pic_urls"
,
"video_urls"
});
List
<
String
>
urls
=
list
.
stream
().
map
(
json
->
json
.
getString
(
"url"
)).
distinct
().
collect
(
Collectors
.
toList
());
List
<
String
>
urls
=
list
.
stream
().
map
(
json
->
json
.
getString
(
"url"
)).
distinct
().
collect
(
Collectors
.
toList
());
log
.
info
(
"项目:{}-定制化舆情分析-互动量更新-时间范围:{}-{},即将更新共{}条"
,
projectId
,
startTime
,
endTime
,
list
.
size
());
log
.
info
(
"项目:{}-定制化舆情分析-互动量更新-时间范围:{}-{},即将更新共{}条"
,
projectId
,
startTime
,
endTime
,
list
.
size
());
// 链接互动量更新
// 链接互动量更新
...
@@ -511,7 +512,7 @@ public class TaskServiceImpl implements TaskService {
...
@@ -511,7 +512,7 @@ public class TaskServiceImpl implements TaskService {
++
failedCount
;
++
failedCount
;
continue
;
continue
;
}
}
// 点赞、收藏、评论、分享
// 点赞、收藏、评论、分享
、图片地址、视频地址
int
likeNum
=
Objects
.
nonNull
(
updatedJson
.
getInteger
(
"likeCount"
))
?
updatedJson
.
getIntValue
(
"likeCount"
)
int
likeNum
=
Objects
.
nonNull
(
updatedJson
.
getInteger
(
"likeCount"
))
?
updatedJson
.
getIntValue
(
"likeCount"
)
:
Objects
.
nonNull
(
esJsonData
.
getInteger
(
"like_num"
))
?
esJsonData
.
getInteger
(
"like_num"
)
:
0
;
:
Objects
.
nonNull
(
esJsonData
.
getInteger
(
"like_num"
))
?
esJsonData
.
getInteger
(
"like_num"
)
:
0
;
int
favouritesNum
=
Objects
.
nonNull
(
updatedJson
.
getInteger
(
"collectCount"
))
?
updatedJson
.
getIntValue
(
"collectCount"
)
int
favouritesNum
=
Objects
.
nonNull
(
updatedJson
.
getInteger
(
"collectCount"
))
?
updatedJson
.
getIntValue
(
"collectCount"
)
...
@@ -520,11 +521,21 @@ public class TaskServiceImpl implements TaskService {
...
@@ -520,11 +521,21 @@ public class TaskServiceImpl implements TaskService {
:
Objects
.
nonNull
(
esJsonData
.
getInteger
(
"comment_num"
))
?
esJsonData
.
getInteger
(
"comment_num"
)
:
0
;
:
Objects
.
nonNull
(
esJsonData
.
getInteger
(
"comment_num"
))
?
esJsonData
.
getInteger
(
"comment_num"
)
:
0
;
int
shareNum
=
Objects
.
nonNull
(
updatedJson
.
getInteger
(
"shareCount"
))
?
updatedJson
.
getIntValue
(
"shareCount"
)
int
shareNum
=
Objects
.
nonNull
(
updatedJson
.
getInteger
(
"shareCount"
))
?
updatedJson
.
getIntValue
(
"shareCount"
)
:
Objects
.
nonNull
(
esJsonData
.
getInteger
(
"share_num"
))
?
esJsonData
.
getInteger
(
"share_num"
)
:
0
;
:
Objects
.
nonNull
(
esJsonData
.
getInteger
(
"share_num"
))
?
esJsonData
.
getInteger
(
"share_num"
)
:
0
;
List
<
String
>
picUrl
=
Objects
.
nonNull
(
updatedJson
.
getString
(
"picUrl"
))
?
Arrays
.
asList
(
updatedJson
.
getString
(
"picUrl"
).
split
(
","
))
:
CollectionUtils
.
isNotEmpty
(
esJsonData
.
getJSONArray
(
"pic_urls"
))
?
esJsonData
.
getJSONArray
(
"pic_urls"
).
toJavaList
(
String
.
class
)
:
null
;
List
<
String
>
videosUrl
=
Objects
.
nonNull
(
updatedJson
.
getString
(
"videoUrl"
))
?
Collections
.
singletonList
(
updatedJson
.
getString
(
"videoUrl"
))
:
CollectionUtils
.
isNotEmpty
(
esJsonData
.
getJSONArray
(
"video_urls"
))
?
esJsonData
.
getJSONArray
(
"video_urls"
).
toJavaList
(
String
.
class
)
:
null
;
resJson
.
put
(
"id"
,
esJsonData
.
getString
(
"id"
));
resJson
.
put
(
"id"
,
esJsonData
.
getString
(
"id"
));
resJson
.
put
(
"like_num"
,
likeNum
);
resJson
.
put
(
"like_num"
,
likeNum
);
resJson
.
put
(
"favourites_num"
,
favouritesNum
);
resJson
.
put
(
"favourites_num"
,
favouritesNum
);
resJson
.
put
(
"comment_num"
,
commentNum
);
resJson
.
put
(
"comment_num"
,
commentNum
);
resJson
.
put
(
"share_num"
,
shareNum
);
resJson
.
put
(
"share_num"
,
shareNum
);
if
(
Objects
.
nonNull
(
picUrl
))
{
resJson
.
put
(
"pic_urls"
,
picUrl
);
}
if
(
Objects
.
nonNull
(
videosUrl
))
{
resJson
.
put
(
"video_urls"
,
videosUrl
);
}
// 数据对应index
// 数据对应index
Calendar
date
=
Calendar
.
getInstance
();
Calendar
date
=
Calendar
.
getInstance
();
date
.
setTime
(
new
Date
(
esJsonData
.
getLongValue
(
"time"
)));
date
.
setTime
(
new
Date
(
esJsonData
.
getLongValue
(
"time"
)));
...
...
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