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
921593b1
Commit
921593b1
authored
Jul 09, 2024
by
shentao
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature' into 'dev'
2024/07/09 定制舆情分析视频图文区分逻辑调整、互动量更新补充视频地址和图片地址更新 test See merge request
!557
parents
edee30e9
aefac40b
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
6 deletions
+30
-6
src/main/java/com/zhiwei/brandkbs2/pojo/dto/MarkSearchDTO.java
+5
-0
src/main/java/com/zhiwei/brandkbs2/service/impl/MarkDataServiceImpl.java
+12
-4
src/main/java/com/zhiwei/brandkbs2/service/impl/TaskServiceImpl.java
+13
-2
No files found.
src/main/java/com/zhiwei/brandkbs2/pojo/dto/MarkSearchDTO.java
View file @
921593b1
...
@@ -228,4 +228,9 @@ public class MarkSearchDTO {
...
@@ -228,4 +228,9 @@ public class MarkSearchDTO {
*/
*/
@ApiModelProperty
(
value
=
"聚合标题"
)
@ApiModelProperty
(
value
=
"聚合标题"
)
private
String
aggTitle
;
private
String
aggTitle
;
/**
* 定制舆情分析数据类型 视频/图文
*/
@ApiModelProperty
(
value
=
"数据类型:视频/图文"
)
private
Boolean
isVideo
;
}
}
src/main/java/com/zhiwei/brandkbs2/service/impl/MarkDataServiceImpl.java
View file @
921593b1
...
@@ -3081,7 +3081,7 @@ public class MarkDataServiceImpl implements MarkDataService {
...
@@ -3081,7 +3081,7 @@ public class MarkDataServiceImpl implements MarkDataService {
long
total
=
getYuqingAnalyzeCount
(
dto
,
null
);
long
total
=
getYuqingAnalyzeCount
(
dto
,
null
);
jsonObject
.
put
(
"total"
,
total
);
jsonObject
.
put
(
"total"
,
total
);
// 视频舆情总量
// 视频舆情总量
dto
.
set
DataType
(
Collections
.
singletonList
(
5
)
);
dto
.
set
IsVideo
(
true
);
long
videoTotal
=
getYuqingAnalyzeCount
(
dto
,
null
);
long
videoTotal
=
getYuqingAnalyzeCount
(
dto
,
null
);
jsonObject
.
put
(
"videoTotal"
,
videoTotal
);
jsonObject
.
put
(
"videoTotal"
,
videoTotal
);
// 图文舆情总量
// 图文舆情总量
...
@@ -3154,12 +3154,12 @@ public class MarkDataServiceImpl implements MarkDataService {
...
@@ -3154,12 +3154,12 @@ public class MarkDataServiceImpl implements MarkDataService {
// 负面趋势图
// 负面趋势图
Pair
<
String
,
List
<
LineVO
>>
negativeSpreadTendency
=
getEmotionSpreadTendency
(
dto
,
EmotionEnum
.
NEGATIVE
.
getName
());
Pair
<
String
,
List
<
LineVO
>>
negativeSpreadTendency
=
getEmotionSpreadTendency
(
dto
,
EmotionEnum
.
NEGATIVE
.
getName
());
// 视频趋势图
// 视频趋势图
dto
.
set
DataType
(
Collections
.
singletonList
(
5
)
);
dto
.
set
IsVideo
(
true
);
Pair
<
String
,
List
<
LineVO
>>
videoSpreadTendency
=
getEmotionSpreadTendency
(
dto
,
null
);
Pair
<
String
,
List
<
LineVO
>>
videoSpreadTendency
=
getEmotionSpreadTendency
(
dto
,
null
);
// 图文趋势图
// 图文趋势图
dto
.
set
DataType
(
Arrays
.
asList
(
1
,
2
,
3
)
);
dto
.
set
IsVideo
(
false
);
Pair
<
String
,
List
<
LineVO
>>
textSpreadTendency
=
getEmotionSpreadTendency
(
dto
,
null
);
Pair
<
String
,
List
<
LineVO
>>
textSpreadTendency
=
getEmotionSpreadTendency
(
dto
,
null
);
dto
.
set
DataType
(
null
);
dto
.
set
IsVideo
(
null
);
Map
<
String
,
BaseMap
>
baseMaps
=
new
HashMap
<>(
2
);
Map
<
String
,
BaseMap
>
baseMaps
=
new
HashMap
<>(
2
);
if
(
Objects
.
nonNull
(
negativeSpreadTendency
.
getLeft
())
||
Objects
.
nonNull
(
spreadTendency
.
getLeft
()))
{
if
(
Objects
.
nonNull
(
negativeSpreadTendency
.
getLeft
())
||
Objects
.
nonNull
(
spreadTendency
.
getLeft
()))
{
CompletableFuture
.
allOf
(
Stream
.
of
(
spreadTendency
.
getLeft
(),
negativeSpreadTendency
.
getLeft
())
CompletableFuture
.
allOf
(
Stream
.
of
(
spreadTendency
.
getLeft
(),
negativeSpreadTendency
.
getLeft
())
...
@@ -4207,6 +4207,14 @@ public class MarkDataServiceImpl implements MarkDataService {
...
@@ -4207,6 +4207,14 @@ public class MarkDataServiceImpl implements MarkDataService {
String
planKeyword
=
xiaohongshuWordDao
.
findOneById
(
dto
.
getCustomPlanId
()).
getKeyword
();
String
planKeyword
=
xiaohongshuWordDao
.
findOneById
(
dto
.
getCustomPlanId
()).
getKeyword
();
postFilter
.
must
(
EsQueryTools
.
assembleNormalKeywordQuery
(
planKeyword
,
new
String
[]{
GenericAttribute
.
ES_IND_FULL_TEXT
}));
postFilter
.
must
(
EsQueryTools
.
assembleNormalKeywordQuery
(
planKeyword
,
new
String
[]{
GenericAttribute
.
ES_IND_FULL_TEXT
}));
}
}
// 视频/图文
if
(
Objects
.
nonNull
(
dto
.
getIsVideo
())){
if
(
dto
.
getIsVideo
()){
postFilter
.
must
(
QueryBuilders
.
existsQuery
(
GenericAttribute
.
ES_VIDEO_URLS
));
}
else
{
postFilter
.
mustNot
(
QueryBuilders
.
existsQuery
(
GenericAttribute
.
ES_VIDEO_URLS
));
}
}
return
postFilter
;
return
postFilter
;
}
}
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/TaskServiceImpl.java
View file @
921593b1
...
@@ -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