Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
E
event
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
陈世强
event
Commits
c1bb8d09
提交
c1bb8d09
authored
7月 24, 2025
作者:
925993793@qq.com
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
调试bug修改
上级
7c581c80
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
41 行增加
和
32 行删除
+41
-32
EventAnalysisController.java
...va/com/zzsn/event/controller/EventAnalysisController.java
+8
-9
EventDataController.java
...a/com/zzsn/event/controller/yjzx/EventDataController.java
+0
-0
Event.java
src/main/java/com/zzsn/event/entity/Event.java
+0
-3
EsService.java
src/main/java/com/zzsn/event/es/EsService.java
+30
-16
LabelEntityMapper.java
src/main/java/com/zzsn/event/mapper/LabelEntityMapper.java
+0
-1
AnalysisServiceImpl.java
...java/com/zzsn/event/service/impl/AnalysisServiceImpl.java
+1
-1
NetWorkEventTask.java
src/main/java/com/zzsn/event/task/NetWorkEventTask.java
+2
-2
没有找到文件。
src/main/java/com/zzsn/event/controller/EventAnalysisController.java
浏览文件 @
c1bb8d09
...
...
@@ -14,7 +14,6 @@ import com.zzsn.event.constant.Result;
import
com.zzsn.event.entity.*
;
import
com.zzsn.event.enums.AnalysisColumnEnum
;
import
com.zzsn.event.es.EsService
;
import
com.zzsn.event.llm.LlmService
;
import
com.zzsn.event.service.*
;
import
com.zzsn.event.util.CalculateUtil
;
import
com.zzsn.event.util.RedisUtil
;
...
...
@@ -280,7 +279,7 @@ public class EventAnalysisController {
}
else
{
List
<
CoOccurrenceVO
>
coOccurrenceVOS
=
analysisService
.
coOccurrence
(
eventId
,
startTime
,
endTime
);
if
(
CollectionUtils
.
isNotEmpty
(
coOccurrenceVOS
))
{
redisUtil
.
set
(
key
,
coOccurrenceVOS
,
3600
*
24
);
redisUtil
.
set
(
key
,
coOccurrenceVOS
,
3600
*
24
);
}
return
Result
.
OK
(
coOccurrenceVOS
);
}
...
...
@@ -357,7 +356,7 @@ public class EventAnalysisController {
/**
* 3.6 信息传播走势
*
* @param
subjectId
专题id
* @param
eventId
专题id
* @param startTime 开始时间
* @param endTime 结束时间
* @param type 1-按小时;2-按天
...
...
@@ -365,11 +364,11 @@ public class EventAnalysisController {
* @date 2024/1/25
*/
@GetMapping
(
"/flowData"
)
public
Result
<?>
flowData
(
@RequestParam
String
subjec
tId
,
public
Result
<?>
flowData
(
@RequestParam
String
even
tId
,
@RequestParam
String
startTime
,
@RequestParam
(
required
=
false
)
String
endTime
,
@RequestParam
Integer
type
)
{
Map
<
String
,
String
>
map
=
esStatisticsService
.
totalAndMax
(
subjec
tId
,
null
,
null
,
type
);
Map
<
String
,
String
>
map
=
esStatisticsService
.
totalAndMax
(
even
tId
,
null
,
null
,
type
);
String
totalCount
=
map
.
get
(
"totalCount"
);
List
<
CountVO
>
list
=
new
ArrayList
<>();
if
(!
totalCount
.
equals
(
"0"
))
{
...
...
@@ -377,7 +376,7 @@ public class EventAnalysisController {
Map
<
String
,
String
>
timeRangeMap
=
getTimeRange
(
startTime
,
endTime
,
maxTime
,
type
);
startTime
=
timeRangeMap
.
get
(
"startTime"
);
endTime
=
timeRangeMap
.
get
(
"endTime"
);
List
<
CountVO
>
dataList
=
esStatisticsService
.
flowData
(
subjec
tId
,
startTime
,
endTime
,
type
);
List
<
CountVO
>
dataList
=
esStatisticsService
.
flowData
(
even
tId
,
startTime
,
endTime
,
type
);
list
=
supplyChildren
(
dataList
,
startTime
,
endTime
,
type
);
}
return
Result
.
OK
(
list
);
...
...
@@ -404,15 +403,15 @@ public class EventAnalysisController {
/**
* 按来源分析
*
* @param
subjectId 专题
id
* @param
eventId 事件
id
* @author lkg
* @date 2024/1/25
*/
@GetMapping
(
"/origin"
)
public
Result
<?>
origin
(
@RequestParam
String
subjec
tId
,
public
Result
<?>
origin
(
@RequestParam
String
even
tId
,
@RequestParam
(
required
=
false
)
String
startTime
,
@RequestParam
(
required
=
false
)
String
endTime
)
{
List
<
CountVO
>
list
=
esStatisticsService
.
origin
(
subjec
tId
,
startTime
,
endTime
);
List
<
CountVO
>
list
=
esStatisticsService
.
origin
(
even
tId
,
startTime
,
endTime
);
return
Result
.
OK
(
list
);
}
...
...
src/main/java/com/zzsn/event/controller/yjzx/EventDataController.java
浏览文件 @
c1bb8d09
差异被折叠。
点击展开。
src/main/java/com/zzsn/event/entity/Event.java
浏览文件 @
c1bb8d09
...
...
@@ -236,9 +236,6 @@ public class Event {
private
String
estimateStatus
;
/** 环境 1-测试 2-正式 */
private
String
environment
;
/**数据范围(是否是全库) - 采集库全库-1,企业库全库-2,政策库全库-3*/
@TableField
(
updateStrategy
=
FieldStrategy
.
IGNORED
)
// 忽略更新策略
private
String
dataScope
;
/**
* 关键词信息
*/
...
...
src/main/java/com/zzsn/event/es/EsService.java
浏览文件 @
c1bb8d09
...
...
@@ -239,6 +239,7 @@ public class EsService {
* @param searchWord 搜索词
* @param position 搜索位置(title-标题;content-内容)
* @param category 匹配度(1-模糊;2-精确)
* @param origin 来源
* @param column 排序字段
* @param order 排序方式(asc-正序;desc-倒序)
* @param pageNo 当前页
...
...
@@ -246,8 +247,8 @@ public class EsService {
* @author lkg
* @date 2024/4/10
*/
public
IPage
<
SubjectDataVo
>
frontListByPage
(
List
<
String
>
subjectIdList
,
String
searchWord
,
String
position
,
Integer
category
,
String
labelId
,
String
column
,
String
order
,
int
pageNo
,
int
pageSize
)
{
public
IPage
<
SubjectDataVo
>
frontListByPage
(
List
<
String
>
subjectIdList
,
String
searchWord
,
String
position
,
Integer
category
,
String
origin
,
String
labelId
,
String
startTime
,
String
endTime
,
String
column
,
String
order
,
int
pageNo
,
int
pageSize
)
{
SearchRequest
searchRequest
=
new
SearchRequest
(
Constants
.
SUBJECT_INDEX
);
SearchSourceBuilder
searchSourceBuilder
=
new
SearchSourceBuilder
();
//设置分页参数
...
...
@@ -284,9 +285,22 @@ public class EsService {
boolQuery
.
must
(
QueryBuilders
.
matchPhraseQuery
(
position
,
searchWord
));
}
}
if
(
StringUtils
.
isNotBlank
(
origin
))
{
boolQuery
.
must
(
QueryBuilders
.
matchPhraseQuery
(
"origin"
,
origin
));
}
if
(
StringUtils
.
isNotBlank
(
labelId
))
{
boolQuery
.
must
(
QueryBuilders
.
nestedQuery
(
"labels"
,
QueryBuilders
.
termQuery
(
"labels.relationId"
,
labelId
),
ScoreMode
.
None
));
}
if
(
StringUtils
.
isNotBlank
(
startTime
)
||
StringUtils
.
isNotBlank
(
endTime
))
{
RangeQueryBuilder
rangeQueryBuilder
=
QueryBuilders
.
rangeQuery
(
"publishDate"
);
if
(
StringUtils
.
isNotBlank
(
startTime
))
{
rangeQueryBuilder
.
gte
(
EsDateUtil
.
esFieldDateFormat
(
startTime
));
}
if
(
StringUtils
.
isNotBlank
(
endTime
))
{
rangeQueryBuilder
.
lte
(
EsDateUtil
.
esFieldDateFormat
(
endTime
));
}
boolQuery
.
filter
(
rangeQueryBuilder
);
}
boolQuery
.
mustNot
(
QueryBuilders
.
termQuery
(
"deleteFlag"
,
"1"
));
searchSourceBuilder
.
query
(
boolQuery
);
searchRequest
.
source
(
searchSourceBuilder
);
...
...
@@ -701,11 +715,11 @@ public class EsService {
infoSourceIdList
.
addAll
(
wordsIdList
);
}
//装配信息源的条件
if
(!
StrUtil
.
contains
(
byId
.
getDataScope
(),
"1"
)
&&
CollectionUtils
.
isNotEmpty
(
infoSourceIdList
))
{
if
(!
StrUtil
.
contains
(
byId
.
getDataScope
(),
"1"
)
&&
CollectionUtils
.
isNotEmpty
(
infoSourceIdList
))
{
boolQuery
.
must
(
QueryBuilders
.
termsQuery
(
"sid"
,
infoSourceIdList
.
stream
().
filter
(
StringUtils:
:
isNotEmpty
).
collect
(
Collectors
.
toList
())));
}
else
if
(
StrUtil
.
contains
(
byId
.
getDataScope
(),
"1"
))
{
}
else
if
(
StrUtil
.
contains
(
byId
.
getDataScope
(),
"1"
))
{
}
else
if
(!
Constants
.
COLLECT_INDEX
.
equals
(
index
))
{
}
else
if
(!
Constants
.
COLLECT_INDEX
.
equals
(
index
))
{
}
else
{
return
new
Page
<>();
...
...
@@ -714,7 +728,7 @@ public class EsService {
boolQuery
.
must
(
QueryBuilders
.
termQuery
(
"sid"
,
eventDataCondition
.
getSourceId
()));
}
//
specialQuery
(
byId
,
eventDataCondition
,
boolQuery
);
specialQuery
(
byId
,
eventDataCondition
,
boolQuery
);
//高级查询数据处理
BoolQueryBuilder
superQuery
=
buildSuperQuery
(
eventDataCondition
.
getSuperQueryMatchType
(),
eventDataCondition
.
getSuperQueryParams
());
if
(
superQuery
!=
null
)
{
...
...
@@ -776,8 +790,8 @@ public class EsService {
}
private
void
specialQuery
(
Subject
byId
,
InfoDataSearchCondition
eventDataCondition
,
BoolQueryBuilder
boolQuery
)
{
if
(
StrUtil
.
isNotBlank
(
byId
.
getEsIndex
())
&&
"researchreportdata"
.
equals
(
byId
.
getEsIndex
())
&&
StrUtil
.
equals
(
byId
.
getId
(),
"1662011688013963265"
))
{
//研报库数据,查询企业库的研报类型的数据
if
(
StrUtil
.
isNotBlank
(
byId
.
getEsIndex
())
&&
"researchreportdata"
.
equals
(
byId
.
getEsIndex
())
&&
StrUtil
.
equals
(
byId
.
getId
(),
"1662011688013963265"
))
{
//研报库数据,查询企业库的研报类型的数据
boolQuery
.
must
(
QueryBuilders
.
termQuery
(
"type.keyword"
,
"0"
));
}
}
...
...
@@ -2506,27 +2520,27 @@ public class EsService {
if
(
CollectionUtils
.
isNotEmpty
(
searchCondition
.
getSpecialLabelParams
()))
{
cn
.
hutool
.
json
.
JSONObject
params
=
searchCondition
.
getSpecialLabelParams
();
String
entityObjectId
=
params
.
getStr
(
"entityObjectId"
);
if
(
StrUtil
.
isNotBlank
(
entityObjectId
)
&&
(
"1892197364882550786"
.
equals
(
entityObjectId
)
||
"1874728877847257089"
.
equals
(
entityObjectId
))){
if
(
StrUtil
.
isNotBlank
(
entityObjectId
)
&&
(
"1892197364882550786"
.
equals
(
entityObjectId
)
||
"1874728877847257089"
.
equals
(
entityObjectId
)))
{
cn
.
hutool
.
json
.
JSONArray
jsonArray
=
params
.
getJSONArray
(
"labelCodeList"
);
if
(
ObjectUtil
.
isNotEmpty
(
jsonArray
)
&&
!
jsonArray
.
isEmpty
()){
if
(
ObjectUtil
.
isNotEmpty
(
jsonArray
)
&&
!
jsonArray
.
isEmpty
())
{
jsonArray
.
forEach
(
e
->
{
cn
.
hutool
.
json
.
JSONObject
jsonObject
=
(
cn
.
hutool
.
json
.
JSONObject
)
e
;
String
labelCode
=
jsonObject
.
getStr
(
"labelCode"
);
if
(
StrUtil
.
isNotBlank
(
labelCode
)){
if
(
StrUtil
.
isNotBlank
(
labelCode
))
{
cn
.
hutool
.
json
.
JSONArray
jsonArray1
=
jsonObject
.
getJSONArray
(
"children"
);
if
(
jsonArray1
!=
null
&&
!
jsonArray1
.
isEmpty
()){
if
(
jsonArray1
!=
null
&&
!
jsonArray1
.
isEmpty
())
{
List
<
String
>
reids
=
new
ArrayList
<>();
jsonArray1
.
forEach
(
f
->
{
cn
.
hutool
.
json
.
JSONObject
jsonObject1
=
(
cn
.
hutool
.
json
.
JSONObject
)
f
;
String
labelItemCode
=
jsonObject1
.
getStr
(
"labelItemCode"
);
if
(
StrUtil
.
isNotBlank
(
labelItemCode
)){
reids
.
add
(
labelCode
+
"-"
+
labelItemCode
);
if
(
StrUtil
.
isNotBlank
(
labelItemCode
))
{
reids
.
add
(
labelCode
+
"-"
+
labelItemCode
);
}
});
if
(
CollectionUtils
.
isNotEmpty
(
reids
)){
if
(
CollectionUtils
.
isNotEmpty
(
reids
))
{
BoolQueryBuilder
specialLabelQuery
=
QueryBuilders
.
boolQuery
();
specialLabelQuery
.
must
(
QueryBuilders
.
nestedQuery
(
"labels"
,
QueryBuilders
.
termsQuery
(
"labels.relationId"
,
reids
),
ScoreMode
.
None
));
specialLabelQuery
.
must
(
QueryBuilders
.
nestedQuery
(
"labels"
,
QueryBuilders
.
termsQuery
(
"labels.relationId"
,
reids
),
ScoreMode
.
None
));
boolQuery
.
must
(
specialLabelQuery
);
}
}
...
...
src/main/java/com/zzsn/event/mapper/LabelEntityMapper.java
浏览文件 @
c1bb8d09
...
...
@@ -3,7 +3,6 @@ package com.zzsn.event.mapper;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.zzsn.event.entity.LabelEntity
;
import
com.zzsn.event.util.tree.Node
;
import
com.zzsn.event.vo.LabelTypeVO
;
import
com.zzsn.event.vo.SysLabelVo
;
import
org.apache.ibatis.annotations.Mapper
;
...
...
src/main/java/com/zzsn/event/service/impl/AnalysisServiceImpl.java
浏览文件 @
c1bb8d09
...
...
@@ -197,7 +197,7 @@ public class AnalysisServiceImpl implements AnalysisService {
if
(
CollectionUtils
.
isNotEmpty
(
informationList
))
{
for
(
SpecialInformation
information
:
informationList
)
{
List
<
String
>
keyWordsList
=
information
.
getKeyWordsList
();
if
(
CollectionUtils
.
is
Not
Empty
(
keyWordsList
))
{
if
(
CollectionUtils
.
isEmpty
(
keyWordsList
))
{
continue
;
}
keyWordsList
=
keyWordsList
.
stream
().
filter
(
e
->
!
excludeKeywords
.
contains
(
e
)).
collect
(
Collectors
.
toList
());
...
...
src/main/java/com/zzsn/event/task/NetWor
d
EventTask.java
→
src/main/java/com/zzsn/event/task/NetWor
k
EventTask.java
浏览文件 @
c1bb8d09
...
...
@@ -30,7 +30,7 @@ import java.util.stream.Collectors;
*/
@Slf4j
@Component
public
class
NetWor
d
EventTask
{
public
class
NetWor
k
EventTask
{
@Autowired
private
EventNetworkService
eventNetworkService
;
...
...
@@ -108,7 +108,7 @@ public class NetWordEventTask {
}
eventNetworkService
.
saveOrUpdateBatch
(
finalList
);
}
log
.
info
(
"{}-数据采集更新完成"
,
type
==
1
?
"百度热榜"
:
"新浪热榜"
);
log
.
info
(
"{}-
网络事件
数据采集更新完成"
,
type
==
1
?
"百度热榜"
:
"新浪热榜"
);
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论