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
30b37f4f
Commit
30b37f4f
authored
Feb 01, 2024
by
陈健智
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
舆情列表新增关联标注标签展示
parent
da9a657b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
3 deletions
+36
-3
src/main/java/com/zhiwei/brandkbs2/service/impl/MarkDataServiceImpl.java
+0
-3
src/main/java/com/zhiwei/brandkbs2/service/impl/MarkFlowServiceImpl.java
+36
-0
No files found.
src/main/java/com/zhiwei/brandkbs2/service/impl/MarkDataServiceImpl.java
View file @
30b37f4f
...
...
@@ -2748,9 +2748,6 @@ public class MarkDataServiceImpl implements MarkDataService {
CompletableFuture
.
allOf
(
markTopTitleList
.
stream
().
map
(
json
->
CompletableFuture
.
supplyAsync
(()
->
{
try
{
BaseMap
firstArticle
=
getFirstArticle
(
startTime
,
endTime
,
json
.
getString
(
"title"
),
projectId
,
Constant
.
PRIMARY_CONTEND_ID
,
planId
,
include
);
if
(
Objects
.
isNull
(
firstArticle
)){
return
null
;
}
json
.
put
(
"content"
,
firstArticle
.
getContent
());
json
.
put
(
"url"
,
firstArticle
.
getUrl
());
json
.
put
(
"realSource"
,
firstArticle
.
getRealSource
());
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/MarkFlowServiceImpl.java
View file @
30b37f4f
...
...
@@ -15,7 +15,9 @@ import com.zhiwei.brandkbs2.enmus.ChannelEmotion;
import
com.zhiwei.brandkbs2.exception.ExceptionCast
;
import
com.zhiwei.brandkbs2.model.CommonCodeEnum
;
import
com.zhiwei.brandkbs2.pojo.MarkFlowEntity
;
import
com.zhiwei.brandkbs2.pojo.dto.TagFilterDTO
;
import
com.zhiwei.brandkbs2.service.MarkFlowService
;
import
com.zhiwei.brandkbs2.service.TagFilterService
;
import
com.zhiwei.brandkbs2.util.RedisUtil
;
import
com.zhiwei.brandkbs2.util.Tools
;
import
com.zhiwei.middleware.automaticmark.vo.Keyword
;
...
...
@@ -24,6 +26,7 @@ import com.zhiwei.middleware.mark.service.MarkerClient;
import
com.zhiwei.middleware.mark.vo.QueryResult
;
import
com.zhiwei.qbjc.bean.pojo.common.Tag
;
import
com.zhiwei.qbjc.bean.tools.BeanTools
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.springframework.stereotype.Service
;
...
...
@@ -62,10 +65,14 @@ public class MarkFlowServiceImpl implements MarkFlowService {
@Resource
(
name
=
"highlightWordDao"
)
HighlightWordDao
highlightWordDao
;
@Resource
(
name
=
"tagFilterServiceImpl"
)
TagFilterService
tagFilterService
;
@Override
public
JSONObject
createMarkFlowInfo
(
MarkInfoSource
markInfoSource
)
{
JSONObject
resultInfo
=
createInfoWithEmotion
(
markInfoSource
.
getJson
());
resultInfo
.
put
(
"sourceDetails"
,
getSourceDetails
(
markInfoSource
));
resultInfo
.
put
(
"customTags"
,
getCustomTagsInfo
(
markInfoSource
));
return
resultInfo
;
}
...
...
@@ -85,6 +92,7 @@ public class MarkFlowServiceImpl implements MarkFlowService {
JSONObject
json
=
markInfoSource
.
getJson
();
JSONObject
resultInfo
=
createInfoWithEmotion
(
json
);
resultInfo
.
put
(
"sourceDetails"
,
getSourceDetails
(
markInfoSource
));
resultInfo
.
put
(
"customTags"
,
getCustomTagsInfo
(
markInfoSource
));
String
zip
=
Tools
.
gzip
(
JSON
.
toJSONString
(
json
));
resultInfo
.
put
(
"zip"
,
zip
);
// 每条数据高亮词
...
...
@@ -196,6 +204,34 @@ public class MarkFlowServiceImpl implements MarkFlowService {
return
JSON
.
parseObject
(
data
,
MarkFlowEntity
.
class
);
}
/**
* 获取自定义标签
* @param markInfoSource
* @return
*/
private
List
<
JSONObject
>
getCustomTagsInfo
(
MarkInfoSource
markInfoSource
){
List
<
JSONObject
>
res
=
new
ArrayList
<>();
JSONObject
json
=
markInfoSource
.
getJson
();
List
<
JSONObject
>
markCacheMaps
=
json
.
getJSONArray
(
GenericAttribute
.
ES_MARK_CACHE_MAPS
).
toJavaList
(
JSONObject
.
class
);
if
(
CollectionUtils
.
isEmpty
(
markCacheMaps
)){
return
null
;
}
// 已配置的标签筛选
List
<
TagFilterDTO
>
tagFilter
=
tagFilterService
.
getTagFilter
();
List
<
String
>
groupNames
=
tagFilter
.
stream
().
map
(
TagFilterDTO:
:
getGroupName
).
collect
(
Collectors
.
toList
());
for
(
JSONObject
markCacheMap
:
markCacheMaps
)
{
String
groupName
=
markCacheMap
.
getString
(
"group_name"
);
if
(!
groupNames
.
contains
(
groupName
)
||
Objects
.
equals
(
Constant
.
EMOTION_LABEL_KEY
,
groupName
)){
continue
;
}
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"uniqueId"
,
markCacheMap
.
getString
(
"unique_id"
));
jsonObject
.
put
(
"name"
,
markCacheMap
.
getString
(
"name"
));
res
.
add
(
jsonObject
);
}
return
res
;
}
private
JSONObject
createInfoWithEmotion
(
JSONObject
json
)
{
JSONObject
info
=
new
JSONObject
();
String
emotion
=
Tools
.
getEmotion
(
json
);
...
...
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