Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
E
event
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
陈世强
event
Commits
6851fa2e
提交
6851fa2e
authored
2月 20, 2025
作者:
925993793@qq.com
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
自定义专题配置编辑/校验bug处理、代码优化
上级
211401d8
全部展开
显示空白字符变更
内嵌
并排
正在显示
15 个修改的文件
包含
207 行增加
和
87 行删除
+207
-87
Constants.java
src/main/java/com/zzsn/event/constant/Constants.java
+2
-2
PlatEventManageController.java
.../com/zzsn/event/controller/PlatEventManageController.java
+6
-3
InformationController.java
...m/zzsn/event/controller/common/InformationController.java
+5
-0
SubjectTypeController.java
...m/zzsn/event/controller/common/SubjectTypeController.java
+0
-1
EventApi.java
...ain/java/com/zzsn/event/controller/thirdApi/EventApi.java
+7
-3
EventDataController.java
...a/com/zzsn/event/controller/yjzx/EventDataController.java
+3
-4
EventManageController.java
...com/zzsn/event/controller/yjzx/EventManageController.java
+35
-26
Event.java
src/main/java/com/zzsn/event/entity/Event.java
+121
-45
EsService.java
src/main/java/com/zzsn/event/es/EsService.java
+3
-0
EventMapper.xml
src/main/java/com/zzsn/event/mapper/xml/EventMapper.xml
+1
-1
IEventService.java
src/main/java/com/zzsn/event/service/IEventService.java
+18
-0
EventServiceImpl.java
...in/java/com/zzsn/event/service/impl/EventServiceImpl.java
+0
-0
SubjectServiceImpl.java
.../java/com/zzsn/event/service/impl/SubjectServiceImpl.java
+2
-2
EventVO.java
src/main/java/com/zzsn/event/vo/EventVO.java
+2
-0
application-test.yml
src/main/resources/application-test.yml
+2
-0
没有找到文件。
src/main/java/com/zzsn/event/constant/Constants.java
浏览文件 @
6851fa2e
...
@@ -80,7 +80,6 @@ public class Constants {
...
@@ -80,7 +80,6 @@ public class Constants {
public
static
final
String
KEY_WORDS_TO_REDIS_PREFIX
=
"KEY_WORDS_TO_REDIS::"
;
public
static
final
String
KEY_WORDS_TO_REDIS_PREFIX
=
"KEY_WORDS_TO_REDIS::"
;
//关键词采集通道
//关键词采集通道
public
static
final
String
KEY_WORDS_COLLECT_TOPIC
=
"eventKeyWordsInfo"
;
public
static
final
String
KEY_WORDS_COLLECT_TOPIC
=
"eventKeyWordsInfo"
;
public
static
final
String
EVENT_SUBJECT_MODEL
=
"eventSubjectModel"
;
/**获取真正的来源*/
/**获取真正的来源*/
public
static
String
getRealOrigin
(
String
origin
){
public
static
String
getRealOrigin
(
String
origin
){
...
@@ -101,7 +100,8 @@ public class Constants {
...
@@ -101,7 +100,8 @@ public class Constants {
return
origin
;
return
origin
;
}
}
public
static
final
String
HISTORY_DATE_QUEUE
=
"HISTORY_DATE_QUEUE:"
;
public
static
final
String
HISTORY_SUBJECT_DATE_QUEUE
=
"HISTORY_DATE_QUEUE:"
;
public
static
final
String
HISTORY_EVENT_DATE_QUEUE
=
"HISTORY_EVENT_DATE_QUEUE:"
;
//obs 文件浏览地址 前部分
//obs 文件浏览地址 前部分
public
static
final
String
OBS_FILE_PATH_URL_PREFIX
=
"http://obs.ciglobal.cn/"
;
public
static
final
String
OBS_FILE_PATH_URL_PREFIX
=
"http://obs.ciglobal.cn/"
;
...
...
src/main/java/com/zzsn/event/controller/PlatEventManageController.java
浏览文件 @
6851fa2e
...
@@ -21,6 +21,7 @@ import com.zzsn.event.xxljob.service.IXxlJobInfoService;
...
@@ -21,6 +21,7 @@ import com.zzsn.event.xxljob.service.IXxlJobInfoService;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.kafka.core.KafkaTemplate
;
import
org.springframework.kafka.core.KafkaTemplate
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -37,7 +38,7 @@ import java.util.concurrent.CompletableFuture;
...
@@ -37,7 +38,7 @@ import java.util.concurrent.CompletableFuture;
* @date 2024/5/7
* @date 2024/5/7
*/
*/
@RestController
@RestController
@RequestMapping
(
"/manage"
)
@RequestMapping
(
"/
plat/
manage"
)
public
class
PlatEventManageController
{
public
class
PlatEventManageController
{
...
@@ -52,6 +53,8 @@ public class PlatEventManageController {
...
@@ -52,6 +53,8 @@ public class PlatEventManageController {
@Resource
@Resource
private
KafkaTemplate
<
String
,
String
>
kafkaTemplate
;
private
KafkaTemplate
<
String
,
String
>
kafkaTemplate
;
@Value
(
"${kafka.topic.event.run:}"
)
private
String
EVENT_MODEL_KAFKA_CHANNEL
;
/**
/**
* 分页列表-新平台管理
* 分页列表-新平台管理
...
@@ -99,7 +102,7 @@ public class PlatEventManageController {
...
@@ -99,7 +102,7 @@ public class PlatEventManageController {
iXxlJobInfoService
.
keyWordsInsert
(
redisKeywordDTO
);
iXxlJobInfoService
.
keyWordsInsert
(
redisKeywordDTO
);
//为了立即响应,关键词新增时放入消息队列
//为了立即响应,关键词新增时放入消息队列
kafkaTemplate
.
send
(
Constants
.
KEY_WORDS_COLLECT_TOPIC
,
JSON
.
toJSONString
(
redisKeywordDTO
));
kafkaTemplate
.
send
(
Constants
.
KEY_WORDS_COLLECT_TOPIC
,
JSON
.
toJSONString
(
redisKeywordDTO
));
kafkaTemplate
.
send
(
Constants
.
EVENT_SUBJECT_MOD
EL
,
event
.
getEventCode
());
kafkaTemplate
.
send
(
EVENT_MODEL_KAFKA_CHANN
EL
,
event
.
getEventCode
());
});
});
return
Result
.
OK
();
return
Result
.
OK
();
...
@@ -240,7 +243,7 @@ public class PlatEventManageController {
...
@@ -240,7 +243,7 @@ public class PlatEventManageController {
iXxlJobInfoService
.
update
(
Wrappers
.<
XxlJobInfo
>
lambdaUpdate
().
eq
(
XxlJobInfo:
:
getInfoSourceCode
,
keywordsVO
.
getWordsCode
())
iXxlJobInfoService
.
update
(
Wrappers
.<
XxlJobInfo
>
lambdaUpdate
().
eq
(
XxlJobInfo:
:
getInfoSourceCode
,
keywordsVO
.
getWordsCode
())
.
set
(
XxlJobInfo:
:
getTriggerStatus
,
status
));
.
set
(
XxlJobInfo:
:
getTriggerStatus
,
status
));
if
(
1
==
status
)
{
if
(
1
==
status
)
{
kafkaTemplate
.
send
(
Constants
.
EVENT_SUBJECT_MOD
EL
,
event
.
getEventCode
());
kafkaTemplate
.
send
(
EVENT_MODEL_KAFKA_CHANN
EL
,
event
.
getEventCode
());
}
}
});
});
}
}
...
...
src/main/java/com/zzsn/event/controller/common/InformationController.java
浏览文件 @
6851fa2e
...
@@ -20,6 +20,7 @@ import com.zzsn.event.util.user.UserVo;
...
@@ -20,6 +20,7 @@ import com.zzsn.event.util.user.UserVo;
import
com.zzsn.event.vo.*
;
import
com.zzsn.event.vo.*
;
import
com.zzsn.event.vo.es.DisplayInfo
;
import
com.zzsn.event.vo.es.DisplayInfo
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.jsoup.Jsoup
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -265,6 +266,10 @@ public class InformationController {
...
@@ -265,6 +266,10 @@ public class InformationController {
public
Result
<?>
add
(
@RequestBody
JSONObject
jsonObject
)
{
public
Result
<?>
add
(
@RequestBody
JSONObject
jsonObject
)
{
UserVo
userVo
=
UserUtil
.
getLoginUser
();
UserVo
userVo
=
UserUtil
.
getLoginUser
();
DisplayInfo
displayInfo
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
jsonObject
.
get
(
"data"
)),
DisplayInfo
.
class
);
DisplayInfo
displayInfo
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
jsonObject
.
get
(
"data"
)),
DisplayInfo
.
class
);
String
contentWithTag
=
displayInfo
.
getContentWithTag
();
if
(
StringUtils
.
isNotBlank
(
contentWithTag
))
{
displayInfo
.
setContent
(
Jsoup
.
parse
(
contentWithTag
).
text
());
}
Integer
category
=
(
Integer
)
jsonObject
.
get
(
"category"
);
Integer
category
=
(
Integer
)
jsonObject
.
get
(
"category"
);
boolean
modelFlag
=
pythonUtil
.
judgeDuplicate
(
displayInfo
.
getId
(),
displayInfo
.
getTitle
(),
displayInfo
.
getContent
(),
displayInfo
.
getSourceAddress
(),
displayInfo
.
getSubjectId
());
boolean
modelFlag
=
pythonUtil
.
judgeDuplicate
(
displayInfo
.
getId
(),
displayInfo
.
getTitle
(),
displayInfo
.
getContent
(),
displayInfo
.
getSourceAddress
(),
displayInfo
.
getSubjectId
());
if
(
modelFlag
)
{
if
(
modelFlag
)
{
...
...
src/main/java/com/zzsn/event/controller/common/SubjectTypeController.java
浏览文件 @
6851fa2e
...
@@ -8,7 +8,6 @@ import com.zzsn.event.service.ISubjectTypeMapService;
...
@@ -8,7 +8,6 @@ import com.zzsn.event.service.ISubjectTypeMapService;
import
com.zzsn.event.service.ISubjectTypeService
;
import
com.zzsn.event.service.ISubjectTypeService
;
import
com.zzsn.event.util.tree.Node
;
import
com.zzsn.event.util.tree.Node
;
import
com.zzsn.event.util.tree.TreeUtil
;
import
com.zzsn.event.util.tree.TreeUtil
;
import
com.zzsn.event.util.user.AuthUtil
;
import
com.zzsn.event.util.user.UserUtil
;
import
com.zzsn.event.util.user.UserUtil
;
import
com.zzsn.event.util.user.UserVo
;
import
com.zzsn.event.util.user.UserVo
;
import
com.zzsn.event.vo.SubjectTreeVO
;
import
com.zzsn.event.vo.SubjectTreeVO
;
...
...
src/main/java/com/zzsn/event/controller/thirdApi/EventApi.java
浏览文件 @
6851fa2e
...
@@ -21,6 +21,7 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -21,6 +21,7 @@ import lombok.extern.slf4j.Slf4j;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.kafka.core.KafkaTemplate
;
import
org.springframework.kafka.core.KafkaTemplate
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -32,7 +33,7 @@ import java.util.List;
...
@@ -32,7 +33,7 @@ import java.util.List;
import
java.util.concurrent.CompletableFuture
;
import
java.util.concurrent.CompletableFuture
;
/**
/**
*
*
第三方(研究中心)调用
*
*
* @author lkg
* @author lkg
* @date 2024/10/12
* @date 2024/10/12
...
@@ -63,8 +64,11 @@ public class EventApi {
...
@@ -63,8 +64,11 @@ public class EventApi {
@Autowired
@Autowired
private
EventRegionMapService
eventRegionMapService
;
private
EventRegionMapService
eventRegionMapService
;
@Value
(
"${kafka.topic.event.run:}"
)
private
String
EVENT_MODEL_KAFKA_CHANNEL
;
/**
/**
* 新增事件
(页面简化版)
* 新增事件
*
*
* @param addEventVO 事件信息
* @param addEventVO 事件信息
* @author lkg
* @author lkg
...
@@ -90,7 +94,7 @@ public class EventApi {
...
@@ -90,7 +94,7 @@ public class EventApi {
iXxlJobInfoService
.
keyWordsInsert
(
redisKeywordDTO
);
iXxlJobInfoService
.
keyWordsInsert
(
redisKeywordDTO
);
//为了立即响应,关键词新增时放入一个首次录入消息队列
//为了立即响应,关键词新增时放入一个首次录入消息队列
kafkaTemplate
.
send
(
Constants
.
KEY_WORDS_COLLECT_TOPIC
,
JSON
.
toJSONString
(
redisKeywordDTO
));
kafkaTemplate
.
send
(
Constants
.
KEY_WORDS_COLLECT_TOPIC
,
JSON
.
toJSONString
(
redisKeywordDTO
));
kafkaTemplate
.
send
(
Constants
.
EVENT_SUBJECT_MOD
EL
,
event
.
getEventCode
());
kafkaTemplate
.
send
(
EVENT_MODEL_KAFKA_CHANN
EL
,
event
.
getEventCode
());
});
});
return
Result
.
OK
(
event
);
return
Result
.
OK
(
event
);
}
else
{
}
else
{
...
...
src/main/java/com/zzsn/event/controller/yjzx/EventDataController.java
浏览文件 @
6851fa2e
...
@@ -75,6 +75,8 @@ public class EventDataController {
...
@@ -75,6 +75,8 @@ public class EventDataController {
@Value
(
"${translate.url:}"
)
@Value
(
"${translate.url:}"
)
private
String
TRANSLATE_URL
;
private
String
TRANSLATE_URL
;
@Value
(
"${kafka.topic.event.run:}"
)
private
String
EVENT_MODEL_KAFKA_CHANNEL
;
private
static
final
String
prefix
=
"http://obs.ciglobal.cn/"
;
private
static
final
String
prefix
=
"http://obs.ciglobal.cn/"
;
...
@@ -185,7 +187,7 @@ public class EventDataController {
...
@@ -185,7 +187,7 @@ public class EventDataController {
iXxlJobInfoService
.
keyWordsInsert
(
redisKeywordDTO
);
iXxlJobInfoService
.
keyWordsInsert
(
redisKeywordDTO
);
//为了立即响应,关键词新增时放入一个首次录入消息队列
//为了立即响应,关键词新增时放入一个首次录入消息队列
kafkaTemplate
.
send
(
Constants
.
KEY_WORDS_COLLECT_TOPIC
,
JSON
.
toJSONString
(
redisKeywordDTO
));
kafkaTemplate
.
send
(
Constants
.
KEY_WORDS_COLLECT_TOPIC
,
JSON
.
toJSONString
(
redisKeywordDTO
));
kafkaTemplate
.
send
(
Constants
.
EVENT_SUBJECT_MOD
EL
,
event
.
getEventCode
());
kafkaTemplate
.
send
(
EVENT_MODEL_KAFKA_CHANN
EL
,
event
.
getEventCode
());
});
});
return
Result
.
OK
();
return
Result
.
OK
();
}
else
{
}
else
{
...
@@ -300,9 +302,6 @@ public class EventDataController {
...
@@ -300,9 +302,6 @@ public class EventDataController {
*/
*/
@GetMapping
(
value
=
"/articleDetail"
)
@GetMapping
(
value
=
"/articleDetail"
)
public
Result
<?>
articleDetail
(
@RequestParam
(
required
=
false
)
String
index
,
@RequestParam
String
id
)
{
public
Result
<?>
articleDetail
(
@RequestParam
(
required
=
false
)
String
index
,
@RequestParam
String
id
)
{
if
(
StringUtils
.
isEmpty
(
index
))
{
index
=
Constants
.
SUBJECT_INDEX
;
}
SubjectDataVo
subjectDataVo
=
esService
.
queryInfo
(
index
,
id
);
SubjectDataVo
subjectDataVo
=
esService
.
queryInfo
(
index
,
id
);
return
Result
.
OK
(
subjectDataVo
);
return
Result
.
OK
(
subjectDataVo
);
}
}
...
...
src/main/java/com/zzsn/event/controller/yjzx/EventManageController.java
浏览文件 @
6851fa2e
...
@@ -10,14 +10,11 @@ import com.zzsn.event.entity.Event;
...
@@ -10,14 +10,11 @@ import com.zzsn.event.entity.Event;
import
com.zzsn.event.entity.KeyWords
;
import
com.zzsn.event.entity.KeyWords
;
import
com.zzsn.event.service.IEventService
;
import
com.zzsn.event.service.IEventService
;
import
com.zzsn.event.service.IKeyWordsService
;
import
com.zzsn.event.service.IKeyWordsService
;
import
com.zzsn.event.service.ISubjectInfoSourceMapService
;
import
com.zzsn.event.service.LabelEntityService
;
import
com.zzsn.event.service.LabelEntityService
;
import
com.zzsn.event.util.RedisUtil
;
import
com.zzsn.event.util.RedisUtil
;
import
com.zzsn.event.util.tree.Node
;
import
com.zzsn.event.util.user.UserUtil
;
import
com.zzsn.event.util.user.UserUtil
;
import
com.zzsn.event.util.user.UserVo
;
import
com.zzsn.event.util.user.UserVo
;
import
com.zzsn.event.vo.*
;
import
com.zzsn.event.vo.*
;
import
com.zzsn.event.xxljob.entity.XxlJobInfo
;
import
com.zzsn.event.xxljob.service.IXxlJobInfoService
;
import
com.zzsn.event.xxljob.service.IXxlJobInfoService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
...
@@ -43,7 +40,7 @@ import java.util.concurrent.CompletableFuture;
...
@@ -43,7 +40,7 @@ import java.util.concurrent.CompletableFuture;
@Slf4j
@Slf4j
@Api
(
tags
=
"事件后台管理"
)
@Api
(
tags
=
"事件后台管理"
)
@RestController
@RestController
@RequestMapping
(
"/
plat/
manage"
)
@RequestMapping
(
"/manage"
)
public
class
EventManageController
{
public
class
EventManageController
{
@Autowired
@Autowired
...
@@ -61,8 +58,9 @@ public class EventManageController {
...
@@ -61,8 +58,9 @@ public class EventManageController {
@Resource
@Resource
private
KafkaTemplate
<
String
,
String
>
kafkaTemplate
;
private
KafkaTemplate
<
String
,
String
>
kafkaTemplate
;
@Value
((
"${serviceProject.url:}"
))
private
String
SERVICE_PROJECT_URL
;
@Value
(
"${kafka.topic.event.run:}"
)
private
String
EVENT_MODEL_KAFKA_CHANNEL
;
/**
/**
* 分页列表-后台管理
* 分页列表-后台管理
...
@@ -142,6 +140,7 @@ public class EventManageController {
...
@@ -142,6 +140,7 @@ public class EventManageController {
CompletableFuture
.
runAsync
(()
->
{
CompletableFuture
.
runAsync
(()
->
{
//插入xxlJob
//插入xxlJob
iXxlJobInfoService
.
eventInsert
(
event
);
iXxlJobInfoService
.
eventInsert
(
event
);
//-------------关键词采集相关,需优化,采集那边说目前搜索引擎效果也不好,先这样。
//关键词入缓存
//关键词入缓存
KeyWordsDTO
redisKeywordDTO
=
new
KeyWordsDTO
();
KeyWordsDTO
redisKeywordDTO
=
new
KeyWordsDTO
();
BeanUtils
.
copyProperties
(
keyWords
,
redisKeywordDTO
);
BeanUtils
.
copyProperties
(
keyWords
,
redisKeywordDTO
);
...
@@ -153,8 +152,8 @@ public class EventManageController {
...
@@ -153,8 +152,8 @@ public class EventManageController {
iXxlJobInfoService
.
keyWordsInsert
(
redisKeywordDTO
);
iXxlJobInfoService
.
keyWordsInsert
(
redisKeywordDTO
);
//为了立即响应,关键词新增时放入消息队列
//为了立即响应,关键词新增时放入消息队列
kafkaTemplate
.
send
(
Constants
.
KEY_WORDS_COLLECT_TOPIC
,
JSON
.
toJSONString
(
redisKeywordDTO
));
kafkaTemplate
.
send
(
Constants
.
KEY_WORDS_COLLECT_TOPIC
,
JSON
.
toJSONString
(
redisKeywordDTO
));
kafkaTemplate
.
send
(
Constants
.
EVENT_SUBJECT_MODEL
,
event
.
getEventCode
());
//----------------------------------------------------------------------------------------------
kafkaTemplate
.
send
(
EVENT_MODEL_KAFKA_CHANNEL
,
event
.
getEventCode
());
});
});
return
Result
.
OK
();
return
Result
.
OK
();
}
else
{
}
else
{
...
@@ -163,6 +162,19 @@ public class EventManageController {
...
@@ -163,6 +162,19 @@ public class EventManageController {
}
}
/**
/**
* 事件配置校验
*
* @param addEventParam 参数
* @author lkg
* @date 2025/2/5
*/
@PostMapping
(
"/configVerification"
)
public
Result
<?>
configVerification
(
@RequestBody
AddEventParam
addEventParam
){
Boolean
verification
=
eventService
.
configVerification
(
addEventParam
);
return
Result
.
OK
(
verification
);
}
/**
* 1.3 编辑
* 1.3 编辑
*
*
* @param addEventParam
* @param addEventParam
...
@@ -207,12 +219,12 @@ public class EventManageController {
...
@@ -207,12 +219,12 @@ public class EventManageController {
*/
*/
@GetMapping
(
"/enable"
)
@GetMapping
(
"/enable"
)
public
Result
<?>
enable
(
@RequestParam
String
eventId
)
{
public
Result
<?>
enable
(
@RequestParam
String
eventId
)
{
updateStatus
(
eventId
,
1
);
eventService
.
updateStatus
(
eventId
,
1
);
return
Result
.
OK
();
return
Result
.
OK
();
}
}
/**
/**
*
启
用
*
禁
用
*
*
* @param eventId 事件id
* @param eventId 事件id
* @author lkg
* @author lkg
...
@@ -220,24 +232,22 @@ public class EventManageController {
...
@@ -220,24 +232,22 @@ public class EventManageController {
*/
*/
@GetMapping
(
"/disable"
)
@GetMapping
(
"/disable"
)
public
Result
<?>
disable
(
@RequestParam
String
eventId
)
{
public
Result
<?>
disable
(
@RequestParam
String
eventId
)
{
updateStatus
(
eventId
,
0
);
eventService
.
updateStatus
(
eventId
,
0
);
return
Result
.
OK
();
return
Result
.
OK
();
}
}
private
void
updateStatus
(
String
eventId
,
Integer
status
)
{
eventService
.
update
(
Wrappers
.<
Event
>
lambdaUpdate
().
eq
(
Event:
:
getId
,
eventId
).
set
(
Event:
:
getStatus
,
status
));
/**
CompletableFuture
.
runAsync
(()
->
{
* 清空专题数据
Event
event
=
eventService
.
getById
(
eventId
);
*
iXxlJobInfoService
.
update
(
Wrappers
.<
XxlJobInfo
>
lambdaUpdate
().
eq
(
XxlJobInfo:
:
getInfoSourceCode
,
event
.
getEventCode
())
* @param subjectId 专题id
.
set
(
XxlJobInfo:
:
getTriggerStatus
,
status
));
* @author lkg
//关键词
* @date 2025/2/6
KeywordsVO
keywordsVO
=
keyWordsService
.
keywordInfoByEventId
(
eventId
);
*/
iXxlJobInfoService
.
update
(
Wrappers
.<
XxlJobInfo
>
lambdaUpdate
().
eq
(
XxlJobInfo:
:
getInfoSourceCode
,
keywordsVO
.
getWordsCode
())
@GetMapping
(
"/clearData"
)
.
set
(
XxlJobInfo:
:
getTriggerStatus
,
status
));
public
Result
<?>
clearData
(
String
subjectId
){
if
(
1
==
status
){
eventService
.
clearSubjectData
(
subjectId
);
kafkaTemplate
.
send
(
Constants
.
EVENT_SUBJECT_MODEL
,
event
.
getEventCode
());
return
Result
.
OK
(
"正在清空数据"
);
}
});
}
}
/**
/**
...
@@ -321,5 +331,4 @@ public class EventManageController {
...
@@ -321,5 +331,4 @@ public class EventManageController {
List
<
ModelVO
>
modelVOS
=
eventService
.
modelList
();
List
<
ModelVO
>
modelVOS
=
eventService
.
modelList
();
return
Result
.
OK
(
modelVOS
);
return
Result
.
OK
(
modelVOS
);
}
}
}
}
src/main/java/com/zzsn/event/entity/Event.java
浏览文件 @
6851fa2e
...
@@ -26,129 +26,205 @@ import java.util.List;
...
@@ -26,129 +26,205 @@ import java.util.List;
@TableName
(
"event"
)
@TableName
(
"event"
)
@EqualsAndHashCode
(
callSuper
=
false
)
@EqualsAndHashCode
(
callSuper
=
false
)
@Accessors
(
chain
=
true
)
@Accessors
(
chain
=
true
)
@ApiModel
(
value
=
"event对象"
,
description
=
"事件"
)
@ApiModel
(
value
=
"event对象"
,
description
=
"事件"
)
public
class
Event
{
public
class
Event
{
/**ID*/
/**
* ID
*/
@TableId
(
type
=
IdType
.
ASSIGN_ID
)
@TableId
(
type
=
IdType
.
ASSIGN_ID
)
@ApiModelProperty
(
value
=
"ID"
)
@ApiModelProperty
(
value
=
"ID"
)
private
String
id
;
private
String
id
;
/**编码*/
/**
* 编码
*/
@Excel
(
name
=
"编码"
,
width
=
15
)
@Excel
(
name
=
"编码"
,
width
=
15
)
@ApiModelProperty
(
value
=
"编码"
)
@ApiModelProperty
(
value
=
"编码"
)
private
String
eventCode
;
private
String
eventCode
;
/**名称*/
/**
* 名称
*/
@Excel
(
name
=
"名称"
,
width
=
15
)
@Excel
(
name
=
"名称"
,
width
=
15
)
@ApiModelProperty
(
value
=
"名称"
)
@ApiModelProperty
(
value
=
"名称"
)
private
String
eventName
;
private
String
eventName
;
/**图标*/
/**
* 图标
*/
@Excel
(
name
=
"图标"
,
width
=
15
)
@Excel
(
name
=
"图标"
,
width
=
15
)
@ApiModelProperty
(
value
=
"图标"
)
@ApiModelProperty
(
value
=
"图标"
)
private
String
eventIcon
;
private
String
eventIcon
;
/**事件类型*/
/**
* 事件类型
*/
@Excel
(
name
=
"事件类型"
,
width
=
15
)
@Excel
(
name
=
"事件类型"
,
width
=
15
)
@ApiModelProperty
(
value
=
"事件类型"
)
@ApiModelProperty
(
value
=
"事件类型"
)
private
String
eventType
;
private
String
eventType
;
/**开始时间*/
/**
* 开始时间
*/
@Excel
(
name
=
"开始时间"
,
width
=
20
,
format
=
"yyyy-MM-dd HH:mm:ss"
)
@Excel
(
name
=
"开始时间"
,
width
=
20
,
format
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonFormat
(
timezone
=
"GMT+8"
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonFormat
(
timezone
=
"GMT+8"
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty
(
value
=
"开始时间"
)
@ApiModelProperty
(
value
=
"开始时间"
)
private
Date
startTime
;
private
Date
startTime
;
/**结束时间*/
/**
* 结束时间
*/
@Excel
(
name
=
"结束时间"
,
width
=
20
,
format
=
"yyyy-MM-dd HH:mm:ss"
)
@Excel
(
name
=
"结束时间"
,
width
=
20
,
format
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonFormat
(
timezone
=
"GMT+8"
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonFormat
(
timezone
=
"GMT+8"
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty
(
value
=
"结束时间"
)
@ApiModelProperty
(
value
=
"结束时间"
)
private
Date
endTime
;
private
Date
endTime
;
/**标签*/
/**
* 标签
*/
@Excel
(
name
=
"标签"
,
width
=
15
)
@Excel
(
name
=
"标签"
,
width
=
15
)
@ApiModelProperty
(
value
=
"标签"
)
@ApiModelProperty
(
value
=
"标签"
)
private
String
eventLabel
;
private
String
eventLabel
;
/**是否公开*/
/**
* 是否公开
*/
@Excel
(
name
=
"是否公开"
,
width
=
15
)
@Excel
(
name
=
"是否公开"
,
width
=
15
)
@ApiModelProperty
(
value
=
"是否公开"
)
@ApiModelProperty
(
value
=
"是否公开"
)
private
Integer
facePublic
;
private
Integer
facePublic
;
/**事件描述*/
/**
* 事件描述
*/
@Excel
(
name
=
"事件描述"
,
width
=
15
)
@Excel
(
name
=
"事件描述"
,
width
=
15
)
@ApiModelProperty
(
value
=
"事件描述"
)
@ApiModelProperty
(
value
=
"事件描述"
)
private
String
eventDescribe
;
private
String
eventDescribe
;
/**创建人id*/
/**
* 创建人id
*/
@Excel
(
name
=
"创建人id"
,
width
=
15
)
@Excel
(
name
=
"创建人id"
,
width
=
15
)
@ApiModelProperty
(
value
=
"创建人id"
)
@ApiModelProperty
(
value
=
"创建人id"
)
private
String
createBy
;
private
String
createBy
;
/**创建时间*/
/**
* 创建时间
*/
@Excel
(
name
=
"创建时间"
,
width
=
20
,
format
=
"yyyy-MM-dd HH:mm:ss"
)
@Excel
(
name
=
"创建时间"
,
width
=
20
,
format
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonFormat
(
timezone
=
"GMT+8"
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonFormat
(
timezone
=
"GMT+8"
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty
(
value
=
"创建时间"
)
@ApiModelProperty
(
value
=
"创建时间"
)
private
Date
createTime
;
private
Date
createTime
;
/**修改时间*/
/**
* 修改时间
*/
@Excel
(
name
=
"修改时间"
,
width
=
20
,
format
=
"yyyy-MM-dd HH:mm:ss"
)
@Excel
(
name
=
"修改时间"
,
width
=
20
,
format
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonFormat
(
timezone
=
"GMT+8"
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonFormat
(
timezone
=
"GMT+8"
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty
(
value
=
"修改时间"
)
@ApiModelProperty
(
value
=
"修改时间"
)
private
Date
updateTime
;
private
Date
updateTime
;
/**修改人id*/
/**
* 修改人id
*/
@Excel
(
name
=
"修改人id"
,
width
=
15
)
@Excel
(
name
=
"修改人id"
,
width
=
15
)
@ApiModelProperty
(
value
=
"修改人id"
)
@ApiModelProperty
(
value
=
"修改人id"
)
private
String
updateBy
;
private
String
updateBy
;
/**状态(0-禁用;1-启用)*/
/**
private
Integer
status
=
1
;
* 状态(0-禁用;1-启用)
*/
private
Integer
status
=
1
;
/**
/**
* 专题最近一次分析时间
* 专题最近一次分析时间
*/
*/
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
analysisTime
;
private
Date
analysisTime
;
/**
/**
* 分析事件脉络-最新资讯的时间
* 分析事件脉络-最新资讯的时间
*/
*/
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
eventTime
;
private
Date
eventTime
;
/**划分专题库*/
/**
* 划分专题库
*/
@ApiModelProperty
(
value
=
"划分专题库"
)
@ApiModelProperty
(
value
=
"划分专题库"
)
private
String
library
;
private
String
library
;
/**定时单位(1分;2小时;3日;4月)*/
/**
* 定时单位(1分;2小时;3日;4月)
*/
@ApiModelProperty
(
value
=
"定时单位"
)
@ApiModelProperty
(
value
=
"定时单位"
)
private
String
unit
;
private
String
unit
;
/**定时数值*/
/**
* 定时数值
*/
@ApiModelProperty
(
value
=
"定时数值"
)
@ApiModelProperty
(
value
=
"定时数值"
)
private
Integer
space
;
private
Integer
space
;
/**cron表达式*/
/**
* cron表达式
*/
@ApiModelProperty
(
value
=
"cron表达式"
)
@ApiModelProperty
(
value
=
"cron表达式"
)
private
String
cron
;
private
String
cron
;
/**是否提取热词*/
/**
* 是否提取热词
*/
@ApiModelProperty
(
value
=
"是否提取热词"
)
@ApiModelProperty
(
value
=
"是否提取热词"
)
private
String
ynExtractHotWords
;
private
String
ynExtractHotWords
;
/**事件专题增量分析规则*/
/**
* 事件专题增量分析规则
*/
@ApiModelProperty
(
value
=
"事件专题增量分析规则"
)
@ApiModelProperty
(
value
=
"事件专题增量分析规则"
)
private
Integer
increAnaRule
;
private
Integer
increAnaRule
;
/**事件专题总量分析规则*/
/**
* 事件专题总量分析规则
*/
@ApiModelProperty
(
value
=
"事件专题总量分析规则"
)
@ApiModelProperty
(
value
=
"事件专题总量分析规则"
)
private
Integer
totalAnaRule
;
private
Integer
totalAnaRule
;
/**事件专题时间间隔分析规则(天)*/
/**
* 事件专题时间间隔分析规则(天)
*/
@ApiModelProperty
(
value
=
"事件专题时间间隔分析规则(天)"
)
@ApiModelProperty
(
value
=
"事件专题时间间隔分析规则(天)"
)
private
Integer
timeAnaRule
;
private
Integer
timeAnaRule
;
/**总热度*/
/**
* 总热度
*/
private
Integer
totalHot
;
private
Integer
totalHot
;
/**媒体热度*/
/**
* 媒体热度
*/
private
Integer
mediaHot
;
private
Integer
mediaHot
;
/**微信热度*/
/**
* 微信热度
*/
private
Integer
wechatHot
;
private
Integer
wechatHot
;
/**其他热度*/
/**
* 其他热度
*/
private
Integer
otherHot
;
private
Integer
otherHot
;
/**发布状态(0-未发布;1-已发布)*/
/**
* 发布状态(0-未发布;1-已发布)
*/
private
Integer
publishStatus
;
private
Integer
publishStatus
;
/**关联事件*/
/**
* 关联事件
*/
private
String
relationEvents
;
private
String
relationEvents
;
/**发布时间*/
/**
* 发布时间
*/
private
String
publishDate
;
private
String
publishDate
;
/**排序号*/
/**
* 排序号
*/
private
Integer
sortOrder
;
private
Integer
sortOrder
;
/**事件创建方式(1-用户直接创建;2-基于挖掘的事件创建)*/
/**
* 事件创建方式(1-用户直接创建;2-基于挖掘的事件创建)
*/
private
Integer
category
;
private
Integer
category
;
/**
* 是否开启采集(1-是;0-否)
*/
private
Integer
ynCollect
;
/**
* 第一次开启时间
*/
@JsonFormat
(
timezone
=
"GMT+8"
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
firstOpenTime
;
/**关键词信息*/
/**
* 关键词信息
*/
@TableField
(
exist
=
false
)
@TableField
(
exist
=
false
)
private
KeyWords
keyWords
;
private
KeyWords
keyWords
;
...
...
src/main/java/com/zzsn/event/es/EsService.java
浏览文件 @
6851fa2e
...
@@ -299,6 +299,9 @@ public class EsService {
...
@@ -299,6 +299,9 @@ public class EsService {
public
SubjectDataVo
queryInfo
(
String
index
,
String
id
)
{
public
SubjectDataVo
queryInfo
(
String
index
,
String
id
)
{
SubjectDataVo
subjectDataVo
=
new
SubjectDataVo
();
SubjectDataVo
subjectDataVo
=
new
SubjectDataVo
();
try
{
try
{
if
(
StringUtils
.
isBlank
(
index
))
{
index
=
Constants
.
SUBJECT_INDEX
;
}
SearchRequest
searchRequest
=
new
SearchRequest
(
index
);
SearchRequest
searchRequest
=
new
SearchRequest
(
index
);
SearchSourceBuilder
searchSourceBuilder
=
new
SearchSourceBuilder
();
SearchSourceBuilder
searchSourceBuilder
=
new
SearchSourceBuilder
();
searchSourceBuilder
.
size
(
1
);
searchSourceBuilder
.
size
(
1
);
...
...
src/main/java/com/zzsn/event/mapper/xml/EventMapper.xml
浏览文件 @
6851fa2e
...
@@ -40,7 +40,7 @@
...
@@ -40,7 +40,7 @@
IFNULL(r.id, false) as hasReport
IFNULL(r.id, false) as hasReport
from event t
from event t
inner join event_category c on t.event_type = c.id
inner join event_category c on t.event_type = c.id
inner
join subject_type_map stm on t.id = stm.subject_id
left
join subject_type_map stm on t.id = stm.subject_id
inner join project_subject_map psm on t.id = psm.subject_id
inner join project_subject_map psm on t.id = psm.subject_id
left join event_analysis_report r on t.id = r.event_id
left join event_analysis_report r on t.id = r.event_id
where t.id = #{eventId}
where t.id = #{eventId}
...
...
src/main/java/com/zzsn/event/service/IEventService.java
浏览文件 @
6851fa2e
...
@@ -123,7 +123,25 @@ public interface IEventService extends IService<Event> {
...
@@ -123,7 +123,25 @@ public interface IEventService extends IService<Event> {
void
deleteMain
(
String
id
);
void
deleteMain
(
String
id
);
void
updateStatus
(
String
eventId
,
Integer
status
);
/**
* 事件配置校验
*
* @param addEventParam 参数
* @author lkg
* @date 2025/2/5
*/
Boolean
configVerification
(
AddEventParam
addEventParam
);
/**
* 清空事件数据
*
* @param eventId 事件id
* @author lkg
* @date 2025/2/6
*/
void
clearSubjectData
(
String
eventId
);
/**
/**
* 公开且发布的事件信息集合
* 公开且发布的事件信息集合
...
...
src/main/java/com/zzsn/event/service/impl/EventServiceImpl.java
浏览文件 @
6851fa2e
差异被折叠。
点击展开。
src/main/java/com/zzsn/event/service/impl/SubjectServiceImpl.java
浏览文件 @
6851fa2e
...
@@ -662,7 +662,7 @@ public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> impl
...
@@ -662,7 +662,7 @@ public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> impl
String
format
=
date
.
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
));
String
format
=
date
.
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
));
dateList
.
add
(
format
);
dateList
.
add
(
format
);
}
}
redisUtil
.
rpushMultipleValues
(
Constants
.
HISTORY_DATE_QUEUE
+
subject
.
getSubjectCode
(),
dateList
.
toArray
(
new
String
[
0
]));
redisUtil
.
rpushMultipleValues
(
Constants
.
HISTORY_
SUBJECT_
DATE_QUEUE
+
subject
.
getSubjectCode
(),
dateList
.
toArray
(
new
String
[
0
]));
}
}
/**
/**
...
@@ -717,7 +717,7 @@ public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> impl
...
@@ -717,7 +717,7 @@ public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> impl
}
}
}
}
if
(
CollectionUtils
.
isNotEmpty
(
newDateList
))
{
if
(
CollectionUtils
.
isNotEmpty
(
newDateList
))
{
redisUtil
.
rpushMultipleValues
(
Constants
.
HISTORY_DATE_QUEUE
+
subject
.
getSubjectCode
(),
newDateList
.
toArray
(
new
String
[
0
]));
redisUtil
.
rpushMultipleValues
(
Constants
.
HISTORY_
SUBJECT_
DATE_QUEUE
+
subject
.
getSubjectCode
(),
newDateList
.
toArray
(
new
String
[
0
]));
}
}
}
}
}
}
...
...
src/main/java/com/zzsn/event/vo/EventVO.java
浏览文件 @
6851fa2e
...
@@ -3,6 +3,7 @@ package com.zzsn.event.vo;
...
@@ -3,6 +3,7 @@ package com.zzsn.event.vo;
import
com.zzsn.event.entity.EventTag
;
import
com.zzsn.event.entity.EventTag
;
import
lombok.Data
;
import
lombok.Data
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -54,6 +55,7 @@ public class EventVO {
...
@@ -54,6 +55,7 @@ public class EventVO {
private
String
projectId
;
private
String
projectId
;
/**排序号*/
/**排序号*/
private
Integer
sortOrder
;
private
Integer
sortOrder
;
private
Date
firstOpenTime
;
/**是否生成分析报告*/
/**是否生成分析报告*/
...
...
src/main/resources/application-test.yml
浏览文件 @
6851fa2e
...
@@ -153,6 +153,8 @@ kafka:
...
@@ -153,6 +153,8 @@ kafka:
topic
:
topic
:
subject
:
subject
:
run
:
subjectModelTest
run
:
subjectModelTest
event
:
run
:
eventSubjectModelTest
clb
:
clb
:
subject
:
subject
:
default
:
default
:
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论