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
44eb4486
Commit
44eb4486
authored
Mar 01, 2024
by
陈健智
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
高频标题二级详情页面及页面跳转逻辑调整
parent
83e66793
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
161 additions
and
7 deletions
+161
-7
src/main/java/com/zhiwei/brandkbs2/common/GlobalPojo.java
+15
-2
src/main/java/com/zhiwei/brandkbs2/controller/app/AppArticleController.java
+39
-0
src/main/java/com/zhiwei/brandkbs2/dao/QbjcPojoDao.java
+12
-0
src/main/java/com/zhiwei/brandkbs2/dao/impl/QbjcPojoDaoImpl.java
+12
-0
src/main/java/com/zhiwei/brandkbs2/service/ChannelService.java
+2
-0
src/main/java/com/zhiwei/brandkbs2/service/MarkDataService.java
+42
-0
src/main/java/com/zhiwei/brandkbs2/service/SystemInfoService.java
+12
-0
src/main/java/com/zhiwei/brandkbs2/service/impl/ChannelServiceImpl.java
+8
-5
src/main/java/com/zhiwei/brandkbs2/service/impl/MarkDataServiceImpl.java
+0
-0
src/main/java/com/zhiwei/brandkbs2/service/impl/SystemInfoServiceImpl.java
+19
-0
No files found.
src/main/java/com/zhiwei/brandkbs2/common/GlobalPojo.java
View file @
44eb4486
...
...
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
import
com.zhiwei.brandkbs2.pojo.ChannelTag
;
import
com.zhiwei.brandkbs2.pojo.HighlightWord
;
import
com.zhiwei.brandkbs2.pojo.Project
;
import
com.zhiwei.brandkbs2.pojo.SensitiveChannel
;
import
com.zhiwei.brandkbs2.service.ChannelService
;
import
com.zhiwei.brandkbs2.service.SystemInfoService
;
import
com.zhiwei.brandkbs2.util.Tools
;
...
...
@@ -92,6 +93,16 @@ public class GlobalPojo {
public
static
final
String
ELSE_PLATFORM_NAME
=
"其他自媒体"
;
/**
* 舆情项目重要渠道
*/
public
static
Map
<
String
,
Map
<
String
,
SensitiveChannel
>>
PROJECT_SENSITIVE_CHANNEL
=
new
HashMap
<>();
/**
* 舆情通用重要渠道
*/
public
static
Map
<
String
,
SensitiveChannel
>
COMMON_SENSITIVE_CHANNEL
=
new
HashMap
<>();
@PostConstruct
public
void
start
()
{
try
{
...
...
@@ -126,9 +137,11 @@ public class GlobalPojo {
PROJECT_MAP
=
systemInfoService
.
getProjects
();
YU_QING_PROJECTS
=
systemInfoService
.
getYuQingProjects
();
PROJECT_EMOTION_CHANNEL_DATA
=
channelService
.
getProjectEmotionChannelListData
();
PROJECT_SENSITIVE_CHANNEL
=
systemInfoService
.
getProjectSensitiveChannel
();
COMMON_SENSITIVE_CHANNEL
=
systemInfoService
.
getCommonSensitiveChannel
();
updateHighlightGraphs
();
log
.
info
(
"{}-获取PLATFORMS-size:{},TAGS-size:{},LINKED_GROUP_ID_TAGS:{},CHANNEL_TAGS:{},MEDIA_TYPE:{},PROJECT_MAP:{},YUQING-PROJECTS-size:{},PROJECT_EMOTION_CHANNEL_DATA-size:{}"
,
logMsg
,
PLATFORMS
.
size
(),
TAGS
.
size
(),
LINKED_GROUP_ID_TAGS
.
size
(),
CHANNEL_TAGS
.
size
(),
MEDIA_TYPE
.
size
(),
PROJECT_MAP
.
size
(),
YU_QING_PROJECTS
.
size
(),
PROJECT_EMOTION_CHANNEL_DATA
.
size
());
log
.
info
(
"{}-获取PLATFORMS-size:{},TAGS-size:{},LINKED_GROUP_ID_TAGS:{},CHANNEL_TAGS:{},MEDIA_TYPE:{},PROJECT_MAP:{},YUQING-PROJECTS-size:{},PROJECT_EMOTION_CHANNEL_DATA-size:{}
,PROJECT_SENSITIVE_CHANNEL-size:{}, COMMON_SENSITIVE_CHANNEL-size:{}
"
,
logMsg
,
PLATFORMS
.
size
(),
TAGS
.
size
(),
LINKED_GROUP_ID_TAGS
.
size
(),
CHANNEL_TAGS
.
size
(),
MEDIA_TYPE
.
size
(),
PROJECT_MAP
.
size
(),
YU_QING_PROJECTS
.
size
(),
PROJECT_EMOTION_CHANNEL_DATA
.
size
()
,
PROJECT_SENSITIVE_CHANNEL
.
size
(),
COMMON_SENSITIVE_CHANNEL
.
size
()
);
}
catch
(
Exception
e
)
{
log
.
info
(
"{}-获取缓存值异常"
,
logMsg
,
e
);
}
...
...
src/main/java/com/zhiwei/brandkbs2/controller/app/AppArticleController.java
View file @
44eb4486
...
...
@@ -526,6 +526,45 @@ public class AppArticleController extends BaseController {
return
ResponseResult
.
success
(
markDataService
.
getYuqingAnalyzeDetail
(
markSearchDTO
));
}
@ApiOperation
(
"新-舆情分析-高频标题-基础信息"
)
@GetMapping
(
"/analyze/frequent-title/info"
)
public
ResponseResult
getAggTitleBaseInfo
(
@RequestParam
(
value
=
"startTime"
)
Long
startTime
,
@RequestParam
(
value
=
"endTime"
)
Long
endTime
,
@RequestParam
(
value
=
"aggTitle"
)
String
aggTitle
,
@RequestParam
(
value
=
"planId"
,
required
=
false
)
String
planId
)
{
return
ResponseResult
.
success
(
markDataService
.
getAggTitleBaseInfo
(
aggTitle
,
startTime
,
endTime
,
planId
));
}
@ApiOperation
(
"新-舆情分析-高频标题-发布节点"
)
@GetMapping
(
"/analyze/frequent-title/article-point"
)
public
ResponseResult
getArticlePoints
(
@RequestParam
(
value
=
"startTime"
)
Long
startTime
,
@RequestParam
(
value
=
"endTime"
)
Long
endTime
,
@RequestParam
(
value
=
"aggTitle"
)
String
aggTitle
,
@RequestParam
(
value
=
"planId"
,
required
=
false
)
String
planId
)
{
return
ResponseResult
.
success
(
markDataService
.
getAggTitleArticlePoints
(
aggTitle
,
startTime
,
endTime
,
planId
));
}
@ApiOperation
(
"新-舆情分析-高频标题-平台分布"
)
@GetMapping
(
"/analyze/frequent-title/platform-percent"
)
public
ResponseResult
getAggTitlePlatformPercentage
(
@RequestParam
(
value
=
"startTime"
)
Long
startTime
,
@RequestParam
(
value
=
"endTime"
)
Long
endTime
,
@RequestParam
(
value
=
"aggTitle"
)
String
aggTitle
,
@RequestParam
(
value
=
"planId"
,
required
=
false
)
String
planId
)
{
return
ResponseResult
.
success
(
markDataService
.
getAggTitlePlatformPercentage
(
aggTitle
,
startTime
,
endTime
,
planId
));
}
@ApiOperation
(
"新-舆情分析-高频标题-发文列表"
)
@GetMapping
(
"/analyze/frequent-title/articles"
)
public
ResponseResult
getArticleList
(
@RequestParam
(
value
=
"startTime"
)
Long
startTime
,
@RequestParam
(
value
=
"endTime"
)
Long
endTime
,
@RequestParam
(
value
=
"aggTitle"
)
String
aggTitle
,
@RequestParam
(
value
=
"platform"
)
String
platform
,
@RequestParam
(
value
=
"planId"
,
required
=
false
)
String
planId
,
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
)
Integer
page
,
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"10"
)
Integer
pageSize
)
{
return
ResponseResult
.
success
(
markDataService
.
getArticleList
(
aggTitle
,
startTime
,
endTime
,
planId
,
platform
,
page
,
pageSize
));
}
private
boolean
checkMTagIllegal
(
StringBuilder
mtag
)
{
List
<
MarkerTag
>
hitTags
=
projectService
.
getProjectById
(
UserThreadLocal
.
getProjectId
()).
getHitTags
();
if
(!
Tools
.
isEmpty
(
hitTags
))
{
...
...
src/main/java/com/zhiwei/brandkbs2/dao/QbjcPojoDao.java
View file @
44eb4486
...
...
@@ -51,4 +51,16 @@ public interface QbjcPojoDao {
* @return
*/
SensitiveChannel
findSensitiveChannelBySource
(
String
source
);
/**
* qbjc项目重要渠道
* @return
*/
List
<
SensitiveChannel
>
findProjectSensitiveChannel
();
/**
* qbjc通用重要渠道
* @return
*/
List
<
SensitiveChannel
>
findCommonSensitiveChannel
();
}
src/main/java/com/zhiwei/brandkbs2/dao/impl/QbjcPojoDaoImpl.java
View file @
44eb4486
...
...
@@ -55,5 +55,17 @@ public class QbjcPojoDaoImpl implements QbjcPojoDao {
query
.
addCriteria
(
Criteria
.
where
(
"name"
).
is
(
source
));
return
mongoTemplate
.
findOne
(
query
,
SensitiveChannel
.
class
,
"qbjc_sensitive_channel_system"
);
}
@Override
public
List
<
SensitiveChannel
>
findProjectSensitiveChannel
()
{
Query
query
=
new
Query
();
return
mongoTemplate
.
find
(
query
,
SensitiveChannel
.
class
,
"qbjc_sensitive_channel"
);
}
@Override
public
List
<
SensitiveChannel
>
findCommonSensitiveChannel
()
{
Query
query
=
new
Query
();
return
mongoTemplate
.
find
(
query
,
SensitiveChannel
.
class
,
"qbjc_sensitive_channel_system"
);
}
}
src/main/java/com/zhiwei/brandkbs2/service/ChannelService.java
View file @
44eb4486
...
...
@@ -308,4 +308,6 @@ public interface ChannelService {
* @throws IOException
*/
Map
<
String
,
JSONObject
>
getProjectEmotionChannelListData
()
throws
IOException
;
JSONObject
matchYuQingSensitiveChannel
(
String
linkedGroupId
,
String
source
);
}
src/main/java/com/zhiwei/brandkbs2/service/MarkDataService.java
View file @
44eb4486
...
...
@@ -634,4 +634,46 @@ public interface MarkDataService {
* @return
*/
List
<
JSONObject
>
getLastNews
(
Long
startTime
,
Long
endTime
,
String
planId
,
int
size
,
boolean
include
);
/**
* 舆情分析-高频标题详情页-基础信息
* @param aggTitle
* @param startTime
* @param endTime
* @param planId
* @return
*/
JSONObject
getAggTitleBaseInfo
(
String
aggTitle
,
Long
startTime
,
Long
endTime
,
String
planId
);
/**
* 舆情分析-高频标题详情页-发布节点
* @param aggTitle
* @param startTime
* @param endTime
* @param planId
* @return
*/
List
<
JSONObject
>
getAggTitleArticlePoints
(
String
aggTitle
,
Long
startTime
,
Long
endTime
,
String
planId
);
/**
* 舆情分析-高频标题详情页-平台分布
* @param aggTitle
* @param startTime
* @param endTime
* @param planId
* @return
*/
List
<
JSONObject
>
getAggTitlePlatformPercentage
(
String
aggTitle
,
Long
startTime
,
Long
endTime
,
String
planId
);
/**
* 舆情分析-高频标题详情页-发文列表
* @param aggTitle
* @param startTime
* @param endTime
* @param planId
* @param page
* @param pageSize
* @return
*/
PageVO
<
JSONObject
>
getArticleList
(
String
aggTitle
,
Long
startTime
,
Long
endTime
,
String
planId
,
String
platform
,
int
page
,
int
pageSize
);
}
src/main/java/com/zhiwei/brandkbs2/service/SystemInfoService.java
View file @
44eb4486
...
...
@@ -3,6 +3,7 @@ package com.zhiwei.brandkbs2.service;
import
com.alibaba.fastjson.JSONObject
;
import
com.zhiwei.brandkbs2.pojo.ChannelTag
;
import
com.zhiwei.brandkbs2.pojo.Project
;
import
com.zhiwei.brandkbs2.pojo.SensitiveChannel
;
import
com.zhiwei.qbjc.bean.pojo.common.MessagePlatform
;
import
com.zhiwei.qbjc.bean.pojo.common.Tag
;
...
...
@@ -58,4 +59,15 @@ public interface SystemInfoService {
List
<
JSONObject
>
getYuQingProjects
();
/**
* 从舆情系统获取项目重要渠道
* @return
*/
Map
<
String
,
Map
<
String
,
SensitiveChannel
>>
getProjectSensitiveChannel
();
/**
* 从舆情系统获取通用重要渠道
* @return
*/
Map
<
String
,
SensitiveChannel
>
getCommonSensitiveChannel
();
}
src/main/java/com/zhiwei/brandkbs2/service/impl/ChannelServiceImpl.java
View file @
44eb4486
...
...
@@ -731,15 +731,18 @@ public class ChannelServiceImpl implements ChannelService {
* @param source
* @return
*/
private
JSONObject
matchYuQingSensitiveChannel
(
String
linkedGroupId
,
String
source
){
@Override
public
JSONObject
matchYuQingSensitiveChannel
(
String
linkedGroupId
,
String
source
){
JSONObject
sensitiveChannelInfo
=
new
JSONObject
();
SensitiveChannel
sensitiveChannel
;
// 先匹配舆情项目重要渠道,未匹配上时转而匹配舆情通用重要渠道
SensitiveChannel
projectSensitiveChannel
=
qbjcPojoDao
.
findSensitiveChannelBySource
(
linkedGroupId
,
source
);
if
(
Objects
.
nonNull
(
projectSensitiveChannel
))
{
sensitiveChannel
=
projectSensitiveChannel
;
Map
<
String
,
SensitiveChannel
>
sensitiveChannelMap
=
GlobalPojo
.
PROJECT_SENSITIVE_CHANNEL
.
get
(
linkedGroupId
);
// SensitiveChannel projectSensitiveChannel = GlobalPojo.PROJECT_SENSITIVE_CHANNEL.get(linkedGroupId).get(source);
if
(
Objects
.
nonNull
(
sensitiveChannelMap
)
&&
Objects
.
nonNull
(
sensitiveChannelMap
.
get
(
source
)))
{
sensitiveChannel
=
sensitiveChannelMap
.
get
(
source
);
}
else
{
sensitiveChannel
=
qbjcPojoDao
.
findSensitiveChannelBySource
(
source
);
// sensitiveChannel = qbjcPojoDao.findSensitiveChannelBySource(source);
sensitiveChannel
=
GlobalPojo
.
COMMON_SENSITIVE_CHANNEL
.
get
(
source
);
}
if
(
Objects
.
nonNull
(
sensitiveChannel
)){
sensitiveChannelInfo
.
put
(
"mainBodyType"
,
sensitiveChannel
.
getMainBodyType
());
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/MarkDataServiceImpl.java
View file @
44eb4486
This diff is collapsed.
Click to expand it.
src/main/java/com/zhiwei/brandkbs2/service/impl/SystemInfoServiceImpl.java
View file @
44eb4486
...
...
@@ -10,6 +10,7 @@ import com.zhiwei.brandkbs2.dao.QbjcPojoDao;
import
com.zhiwei.brandkbs2.pojo.ChannelTag
;
import
com.zhiwei.brandkbs2.pojo.MediaType
;
import
com.zhiwei.brandkbs2.pojo.Project
;
import
com.zhiwei.brandkbs2.pojo.SensitiveChannel
;
import
com.zhiwei.brandkbs2.service.SystemInfoService
;
import
com.zhiwei.qbjc.bean.pojo.common.MessagePlatform
;
import
com.zhiwei.qbjc.bean.pojo.common.Tag
;
...
...
@@ -113,4 +114,22 @@ public class SystemInfoServiceImpl implements SystemInfoService {
return
res
;
}).
collect
(
Collectors
.
toList
());
}
@Override
public
Map
<
String
,
Map
<
String
,
SensitiveChannel
>>
getProjectSensitiveChannel
()
{
Map
<
String
,
Map
<
String
,
SensitiveChannel
>>
res
=
new
HashMap
<>();
List
<
SensitiveChannel
>
projectSensitiveChannel
=
qbjcPojoDao
.
findProjectSensitiveChannel
();
Map
<
String
,
List
<
SensitiveChannel
>>
projectMap
=
projectSensitiveChannel
.
stream
().
collect
(
Collectors
.
groupingBy
(
SensitiveChannel:
:
getProjectId
));
for
(
Map
.
Entry
<
String
,
List
<
SensitiveChannel
>>
entry
:
projectMap
.
entrySet
())
{
Map
<
String
,
SensitiveChannel
>
sourceMap
=
entry
.
getValue
().
stream
().
collect
(
Collectors
.
toMap
(
SensitiveChannel:
:
getName
,
o
->
o
,
(
k1
,
k2
)
->
k1
));
res
.
put
(
entry
.
getKey
(),
sourceMap
);
}
return
res
;
}
@Override
public
Map
<
String
,
SensitiveChannel
>
getCommonSensitiveChannel
()
{
List
<
SensitiveChannel
>
commonSensitiveChannel
=
qbjcPojoDao
.
findCommonSensitiveChannel
();
return
commonSensitiveChannel
.
stream
().
collect
(
Collectors
.
toMap
(
SensitiveChannel:
:
getName
,
o
->
o
,
(
k1
,
k2
)
->
k1
));
}
}
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