Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
E
event
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
陈世强
event
Commits
b7bd8c2f
提交
b7bd8c2f
authored
2月 27, 2025
作者:
yanxin
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/event_fusion' into event_fusion
上级
a59b0f72
0efb697b
显示空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
51 行增加
和
19 行删除
+51
-19
InformationController.java
...m/zzsn/event/controller/common/InformationController.java
+4
-2
EsService.java
src/main/java/com/zzsn/event/es/EsService.java
+5
-0
InformationService.java
src/main/java/com/zzsn/event/service/InformationService.java
+2
-1
InformationServiceImpl.java
...a/com/zzsn/event/service/impl/InformationServiceImpl.java
+25
-3
EventHotTask.java
src/main/java/com/zzsn/event/task/EventHotTask.java
+3
-3
SynClbEventDataTask.java
src/main/java/com/zzsn/event/task/SynClbEventDataTask.java
+9
-8
InfoDataSearchCondition.java
src/main/java/com/zzsn/event/vo/InfoDataSearchCondition.java
+3
-2
没有找到文件。
src/main/java/com/zzsn/event/controller/common/InformationController.java
浏览文件 @
b7bd8c2f
...
@@ -205,6 +205,9 @@ public class InformationController {
...
@@ -205,6 +205,9 @@ public class InformationController {
if
(
StringUtils
.
isEmpty
(
searchCondition
.
getSubjectId
()))
{
if
(
StringUtils
.
isEmpty
(
searchCondition
.
getSubjectId
()))
{
return
Result
.
FAIL
(
"专题id/专题分类id不能为空"
);
return
Result
.
FAIL
(
"专题id/专题分类id不能为空"
);
}
}
if
(
searchCondition
.
getCategory
()
==
null
)
{
return
Result
.
FAIL
(
"专题类型不能为空"
);
}
UserVo
userVo
=
UserUtil
.
getLoginUser
();
UserVo
userVo
=
UserUtil
.
getLoginUser
();
IPage
<
DisplayInfo
>
pageList
=
informationService
.
subjectPageList
(
userVo
,
searchCondition
);
IPage
<
DisplayInfo
>
pageList
=
informationService
.
subjectPageList
(
userVo
,
searchCondition
);
return
Result
.
OK
(
pageList
);
return
Result
.
OK
(
pageList
);
...
@@ -220,8 +223,7 @@ public class InformationController {
...
@@ -220,8 +223,7 @@ public class InformationController {
return
Result
.
FAIL
(
"专题id/专题分类id不能为空"
);
return
Result
.
FAIL
(
"专题id/专题分类id不能为空"
);
}
}
UserVo
userVo
=
UserUtil
.
getLoginUser
();
UserVo
userVo
=
UserUtil
.
getLoginUser
();
List
<
HashMap
>
pageList
=
informationService
.
subjectPageListGroupByLabel
(
userVo
,
searchCondition
);
return
informationService
.
subjectPageListGroupByLabel
(
userVo
,
searchCondition
);
return
Result
.
OK
(
pageList
);
}
}
/**
/**
...
...
src/main/java/com/zzsn/event/es/EsService.java
浏览文件 @
b7bd8c2f
...
@@ -1774,12 +1774,14 @@ public class EsService {
...
@@ -1774,12 +1774,14 @@ public class EsService {
if
(
CollectionUtils
.
isNotEmpty
(
subjectIdList
))
{
if
(
CollectionUtils
.
isNotEmpty
(
subjectIdList
))
{
Integer
category
=
searchCondition
.
getCategory
();
Integer
category
=
searchCondition
.
getCategory
();
boolQuery
.
must
(
QueryBuilders
.
termsQuery
(
"subjectId.keyword"
,
subjectIdList
));
boolQuery
.
must
(
QueryBuilders
.
termsQuery
(
"subjectId.keyword"
,
subjectIdList
));
//单个专题/事件,默认加上专题/事件的时间范围
if
(
subjectIdList
.
size
()
==
1
)
{
if
(
subjectIdList
.
size
()
==
1
)
{
String
configStartTime
=
null
;
String
configStartTime
=
null
;
String
configEndTime
=
null
;
String
configEndTime
=
null
;
String
id
=
subjectIdList
.
get
(
0
);
String
id
=
subjectIdList
.
get
(
0
);
if
(
category
==
1
)
{
if
(
category
==
1
)
{
Subject
subject
=
subjectService
.
getById
(
id
);
Subject
subject
=
subjectService
.
getById
(
id
);
if
(!
Objects
.
isNull
(
subject
))
{
Date
timeEnable
=
subject
.
getTimeEnable
();
Date
timeEnable
=
subject
.
getTimeEnable
();
if
(!
Objects
.
isNull
(
timeEnable
))
{
if
(!
Objects
.
isNull
(
timeEnable
))
{
configStartTime
=
DateUtil
.
dateToString
(
timeEnable
);
configStartTime
=
DateUtil
.
dateToString
(
timeEnable
);
...
@@ -1788,8 +1790,10 @@ public class EsService {
...
@@ -1788,8 +1790,10 @@ public class EsService {
if
(!
Objects
.
isNull
(
timeDisable
))
{
if
(!
Objects
.
isNull
(
timeDisable
))
{
configEndTime
=
DateUtil
.
dateToString
(
timeDisable
);
configEndTime
=
DateUtil
.
dateToString
(
timeDisable
);
}
}
}
}
else
if
(
category
==
2
)
{
}
else
if
(
category
==
2
)
{
Event
event
=
eventService
.
getById
(
id
);
Event
event
=
eventService
.
getById
(
id
);
if
(!
Objects
.
isNull
(
event
))
{
Date
startTime
=
event
.
getStartTime
();
Date
startTime
=
event
.
getStartTime
();
if
(!
Objects
.
isNull
(
startTime
))
{
if
(!
Objects
.
isNull
(
startTime
))
{
configStartTime
=
DateUtil
.
dateToString
(
startTime
);
configStartTime
=
DateUtil
.
dateToString
(
startTime
);
...
@@ -1799,6 +1803,7 @@ public class EsService {
...
@@ -1799,6 +1803,7 @@ public class EsService {
configEndTime
=
DateUtil
.
dateToString
(
endTime
);
configEndTime
=
DateUtil
.
dateToString
(
endTime
);
}
}
}
}
}
//时间过滤筛选-专题配置
//时间过滤筛选-专题配置
if
(
StringUtils
.
isNotBlank
(
configStartTime
))
{
if
(
StringUtils
.
isNotBlank
(
configStartTime
))
{
boolQuery
.
filter
(
QueryBuilders
.
rangeQuery
(
"publishDate"
).
gte
(
EsDateUtil
.
esFieldDateFormat
(
configStartTime
)));
boolQuery
.
filter
(
QueryBuilders
.
rangeQuery
(
"publishDate"
).
gte
(
EsDateUtil
.
esFieldDateFormat
(
configStartTime
)));
...
...
src/main/java/com/zzsn/event/service/InformationService.java
浏览文件 @
b7bd8c2f
...
@@ -2,6 +2,7 @@ package com.zzsn.event.service;
...
@@ -2,6 +2,7 @@ package com.zzsn.event.service;
import
com.alibaba.fastjson2.JSONObject
;
import
com.alibaba.fastjson2.JSONObject
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.zzsn.event.constant.Result
;
import
com.zzsn.event.entity.ClbFileOperationLog
;
import
com.zzsn.event.entity.ClbFileOperationLog
;
import
com.zzsn.event.util.user.UserVo
;
import
com.zzsn.event.util.user.UserVo
;
import
com.zzsn.event.vo.*
;
import
com.zzsn.event.vo.*
;
...
@@ -40,7 +41,7 @@ public interface InformationService {
...
@@ -40,7 +41,7 @@ public interface InformationService {
/**
/**
* 资讯分页列表(根据标签分类分组)
* 资讯分页列表(根据标签分类分组)
*/
*/
List
<
HashMap
>
subjectPageListGroupByLabel
(
UserVo
userVo
,
InfoDataSearchCondition
subjectInfo
);
Result
subjectPageListGroupByLabel
(
UserVo
userVo
,
InfoDataSearchCondition
subjectInfo
);
/**
/**
* 保存数据集-研究中心
* 保存数据集-研究中心
...
...
src/main/java/com/zzsn/event/service/impl/InformationServiceImpl.java
浏览文件 @
b7bd8c2f
...
@@ -12,6 +12,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
...
@@ -12,6 +12,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.zzsn.event.constant.Constants
;
import
com.zzsn.event.constant.Constants
;
import
com.zzsn.event.constant.Result
;
import
com.zzsn.event.entity.*
;
import
com.zzsn.event.entity.*
;
import
com.zzsn.event.enums.EnumHandlerStatus
;
import
com.zzsn.event.enums.EnumHandlerStatus
;
import
com.zzsn.event.enums.EnumOperateWay
;
import
com.zzsn.event.enums.EnumOperateWay
;
...
@@ -155,7 +156,7 @@ public class InformationServiceImpl implements InformationService {
...
@@ -155,7 +156,7 @@ public class InformationServiceImpl implements InformationService {
@Override
@Override
public
List
<
HashMap
>
subjectPageListGroupByLabel
(
UserVo
userVo
,
InfoDataSearchCondition
searchCondition
)
{
public
Result
subjectPageListGroupByLabel
(
UserVo
userVo
,
InfoDataSearchCondition
searchCondition
)
{
List
<
HashMap
>
list
=
new
ArrayList
<>();
List
<
HashMap
>
list
=
new
ArrayList
<>();
Integer
category
=
searchCondition
.
getCategory
();
Integer
category
=
searchCondition
.
getCategory
();
List
<
String
>
subjectIdList
=
new
ArrayList
<>();
List
<
String
>
subjectIdList
=
new
ArrayList
<>();
...
@@ -176,7 +177,7 @@ public class InformationServiceImpl implements InformationService {
...
@@ -176,7 +177,7 @@ public class InformationServiceImpl implements InformationService {
}
}
}
}
if
(
CollectionUtils
.
isEmpty
(
subjectIdList
))
{
if
(
CollectionUtils
.
isEmpty
(
subjectIdList
))
{
return
list
;
return
Result
.
OK
(
list
)
;
}
}
try
{
try
{
IPage
<
SpecialInformation
>
specialInformationIPage
=
esService
.
pageListByCondition
(
searchCondition
,
subjectIdList
);
IPage
<
SpecialInformation
>
specialInformationIPage
=
esService
.
pageListByCondition
(
searchCondition
,
subjectIdList
);
...
@@ -202,11 +203,32 @@ public class InformationServiceImpl implements InformationService {
...
@@ -202,11 +203,32 @@ public class InformationServiceImpl implements InformationService {
map
.
put
(
"infoList"
,
displayInfos
);
map
.
put
(
"infoList"
,
displayInfos
);
list
.
add
(
map
);
list
.
add
(
map
);
});
});
}
else
{
//不加标签获取列表数据
searchCondition
.
setLabelMark
(
null
);
specialInformationIPage
=
esService
.
pageListByCondition
(
searchCondition
,
subjectIdList
);
long
totalT
=
specialInformationIPage
.
getTotal
();
if
(
totalT
>
0
)
{
List
<
DisplayInfo
>
dataList
=
new
ArrayList
<>();
List
<
LabelModelVo
>
labelModelVos
=
commonService
.
subjectModelBindLabels
(
subjectIdList
);
Map
<
String
,
List
<
LabelModelVo
>>
modelMap
=
labelModelVos
.
stream
().
collect
(
Collectors
.
groupingBy
(
LabelModelVo:
:
getSubjectId
));
List
<
SpecialInformation
>
records
=
specialInformationIPage
.
getRecords
();
for
(
SpecialInformation
specialInformation
:
records
)
{
DisplayInfo
info
=
new
DisplayInfo
();
BeanUtils
.
copyProperties
(
specialInformation
,
info
);
info
.
setPublishDate
(
EsDateUtil
.
esFieldDateMapping
(
info
.
getPublishDate
()));
//标签处理
List
<
LabelModelVo
>
modelVoList
=
modelMap
.
get
(
info
.
getSubjectId
());
formatLabel
(
modelVoList
,
info
);
dataList
.
add
(
info
);
}
return
Result
.
OK
(
dataList
);
}
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
return
list
;
return
Result
.
OK
(
list
)
;
}
}
public
Map
<
String
,
List
<
DisplayInfo
>>
groupedByLabelMark
(
List
<
DisplayInfo
>
dataList
)
{
public
Map
<
String
,
List
<
DisplayInfo
>>
groupedByLabelMark
(
List
<
DisplayInfo
>
dataList
)
{
...
...
src/main/java/com/zzsn/event/task/EventHotTask.java
浏览文件 @
b7bd8c2f
...
@@ -55,9 +55,9 @@ public class EventHotTask {
...
@@ -55,9 +55,9 @@ public class EventHotTask {
*/
*/
@Scheduled
(
cron
=
"0 0 0/3 * * ?"
)
@Scheduled
(
cron
=
"0 0 0/3 * * ?"
)
public
void
hot
()
{
public
void
hot
()
{
LambdaQueryWrapper
<
Event
>
queryWrapper
=
Wrappers
.
lambdaQuery
();
//
LambdaQueryWrapper<Event> queryWrapper = Wrappers.lambdaQuery();
queryWrapper
.
eq
(
Event:
:
getFacePublic
,
1
).
eq
(
Event:
:
getPublishStatus
,
1
);
//
queryWrapper.eq(Event::getFacePublic,1).eq(Event::getPublishStatus,1);
List
<
Event
>
list
=
eventService
.
list
(
queryWrapper
);
List
<
Event
>
list
=
eventService
.
list
();
List
<
HotVO
>
countList
=
new
ArrayList
<>();
List
<
HotVO
>
countList
=
new
ArrayList
<>();
for
(
Event
event
:
list
)
{
for
(
Event
event
:
list
)
{
CompletableFuture
<
HotVO
>
async
=
CompletableFuture
.
supplyAsync
(()
->
{
CompletableFuture
<
HotVO
>
async
=
CompletableFuture
.
supplyAsync
(()
->
{
...
...
src/main/java/com/zzsn/event/task/SynClbEventDataTask.java
浏览文件 @
b7bd8c2f
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.zzsn.event.entity.Event
;
import
com.zzsn.event.entity.Event
;
import
com.zzsn.event.entity.EventClb
;
import
com.zzsn.event.entity.EventTag
;
import
com.zzsn.event.entity.EventTag
;
import
com.zzsn.event.entity.EventTagClb
;
import
com.zzsn.event.entity.EventTagClb
;
import
com.zzsn.event.mapper.EventClbMapper
;
import
com.zzsn.event.mapper.EventClbMapper
;
...
@@ -49,18 +50,18 @@ public class SynClbEventDataTask {
...
@@ -49,18 +50,18 @@ public class SynClbEventDataTask {
return
;
return
;
}
}
log
.
info
(
"同步克虏宝中事件信息到研究中心数据库开始"
);
log
.
info
(
"同步克虏宝中事件信息到研究中心数据库开始"
);
LambdaQueryWrapper
<
Event
>
queryWrapper
=
Wrappers
.
lambdaQuery
();
//
LambdaQueryWrapper<Event> queryWrapper = Wrappers.lambdaQuery();
queryWrapper
.
eq
(
Event:
:
getFacePublic
,
1
).
eq
(
Event:
:
getPublishStatus
,
1
);
//
queryWrapper.eq(Event::getFacePublic,1).eq(Event::getPublishStatus,1);
List
<
Event
>
list
=
eventService
.
list
(
queryWrapper
);
List
<
Event
>
list
=
eventService
.
list
();
for
(
Event
event
:
list
)
{
for
(
Event
event
:
list
)
{
try
{
try
{
// 克虏宝事件表
// 克虏宝事件表
String
eventId
=
event
.
getId
();
String
eventId
=
event
.
getId
();
Event
VO
eventVOClb
=
eventClbMapper
.
queryInfo
(
eventId
);
Event
Clb
eventClb
=
eventClbMapper
.
selectById
(
eventId
);
if
(
event
VO
Clb
!=
null
)
{
if
(
eventClb
!=
null
)
{
LambdaUpdateWrapper
<
Event
>
lambdaUpdateWrapper
=
Wrappers
.
lambdaUpdate
(
Event
.
class
).
eq
(
Event:
:
getId
,
eventId
)
LambdaUpdateWrapper
<
Event
>
lambdaUpdateWrapper
=
Wrappers
.
lambdaUpdate
(
Event
.
class
).
eq
(
Event:
:
getId
,
eventId
)
.
set
(
Event:
:
getRelationEvents
,
event
VO
Clb
.
getRelationEvents
())
// 事件关联事件
.
set
(
Event:
:
getRelationEvents
,
eventClb
.
getRelationEvents
())
// 事件关联事件
.
set
(
Event:
:
getEventLabel
,
event
VO
Clb
.
getEventLabel
())
// 事件表中打的标签
.
set
(
Event:
:
getEventLabel
,
eventClb
.
getEventLabel
())
// 事件表中打的标签
// total_hot根据所有事件定时统计,这个使用研究中心自己的
// total_hot根据所有事件定时统计,这个使用研究中心自己的
;
;
eventService
.
update
(
lambdaUpdateWrapper
);
eventService
.
update
(
lambdaUpdateWrapper
);
...
@@ -70,7 +71,7 @@ public class SynClbEventDataTask {
...
@@ -70,7 +71,7 @@ public class SynClbEventDataTask {
.
last
(
" limit 1"
));
.
last
(
" limit 1"
));
LambdaUpdateWrapper
<
EventTag
>
tagUpdateWrapper
=
Wrappers
.
lambdaUpdate
(
EventTag
.
class
)
LambdaUpdateWrapper
<
EventTag
>
tagUpdateWrapper
=
Wrappers
.
lambdaUpdate
(
EventTag
.
class
)
.
eq
(
EventTag:
:
getEventId
,
eventId
)
.
eq
(
EventTag:
:
getEventId
,
eventId
)
.
set
(
EventTag:
:
getExtractIndustryTag
,
eventTagClb
.
getExtractIndustryTag
())
// 事件关联事件
.
set
(
EventTag:
:
getExtractIndustryTag
,
eventTagClb
.
getExtractIndustryTag
())
.
set
(
EventTag:
:
getExtractCompanyTag
,
eventTagClb
.
getExtractCompanyTag
())
.
set
(
EventTag:
:
getExtractCompanyTag
,
eventTagClb
.
getExtractCompanyTag
())
.
set
(
EventTag:
:
getExtractPersonTag
,
eventTagClb
.
getExtractPersonTag
())
.
set
(
EventTag:
:
getExtractPersonTag
,
eventTagClb
.
getExtractPersonTag
())
.
set
(
EventTag:
:
getExtractSentimentTag
,
eventTagClb
.
getExtractSentimentTag
())
.
set
(
EventTag:
:
getExtractSentimentTag
,
eventTagClb
.
getExtractSentimentTag
())
...
...
src/main/java/com/zzsn/event/vo/InfoDataSearchCondition.java
浏览文件 @
b7bd8c2f
...
@@ -8,6 +8,8 @@ import java.util.List;
...
@@ -8,6 +8,8 @@ import java.util.List;
@Data
@Data
public
class
InfoDataSearchCondition
{
public
class
InfoDataSearchCondition
{
//subjectId是否专题id(1-是;0-否)
private
String
isSubject
=
"1"
;
//专题id/专题分类id
//专题id/专题分类id
private
String
subjectId
;
private
String
subjectId
;
...
@@ -64,8 +66,7 @@ public class InfoDataSearchCondition {
...
@@ -64,8 +66,7 @@ public class InfoDataSearchCondition {
private
Integer
category
;
private
Integer
category
;
//是否视频 "video"
//是否视频 "video"
private
String
video
;
private
String
video
;
//subjectId是否专题id(1-是;0-否)
private
String
isSubject
=
"1"
;
//爬虫类型
//爬虫类型
private
String
crawler
;
private
String
crawler
;
/**----企业类标签筛选----**/
/**----企业类标签筛选----**/
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论