Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
E
event
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
陈世强
event
Commits
e5ceea00
提交
e5ceea00
authored
8月 08, 2025
作者:
925993793@qq.com
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
重新生成逻辑优化
上级
25b0bb27
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
17 行增加
和
21 行删除
+17
-21
EventManageController.java
...java/com/zzsn/event/controller/EventManageController.java
+13
-12
AnalysisServiceImpl.java
...java/com/zzsn/event/service/impl/AnalysisServiceImpl.java
+4
-9
没有找到文件。
src/main/java/com/zzsn/event/controller/EventManageController.java
浏览文件 @
e5ceea00
...
@@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
...
@@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
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.Result
;
import
com.zzsn.event.constant.Result
;
import
com.zzsn.event.entity.*
;
import
com.zzsn.event.entity.*
;
import
com.zzsn.event.enums.AnalysisColumnEnum
;
import
com.zzsn.event.enums.AnalysisColumnEnum
;
...
@@ -173,17 +172,19 @@ public class EventManageController {
...
@@ -173,17 +172,19 @@ public class EventManageController {
//新增关键词
//新增关键词
keyWordsService
.
saveBaseAndMap
(
event
,
keywordsVO
.
getKeyword
(),
keywordsVO
.
getExclusionWord
());
keyWordsService
.
saveBaseAndMap
(
event
,
keywordsVO
.
getKeyword
(),
keywordsVO
.
getExclusionWord
());
CompletableFuture
.
runAsync
(()
->
{
CompletableFuture
.
runAsync
(()
->
{
//插入xxlJob
try
{
log
.
info
(
"新增事件,插入xxlJob,事件id:{}"
,
event
.
getId
());
//插入xxlJob
iXxlJobInfoService
.
eventInsert
(
event
);
log
.
info
(
"新增事件,插入xxlJob,事件id:{}"
,
event
.
getId
());
//通知采集
iXxlJobInfoService
.
eventInsert
(
event
);
log
.
info
(
"新增事件,通知采集,事件id:{}"
,
event
.
getId
());
//通知采集
configurationMessageService
.
bindKeyWordsEventSend
(
event
.
getId
());
log
.
info
(
"新增事件,通知采集,事件id:{}"
,
event
.
getId
());
//事件分析
configurationMessageService
.
bindKeyWordsEventSend
(
event
.
getId
());
log
.
info
(
"新增事件,事件分析,事件id:{}"
,
event
.
getId
());
//事件分析
kafkaTemplate
.
send
(
EVENT_MODEL_KAFKA_CHANNEL
,
event
.
getEventCode
());
log
.
info
(
"新增事件,事件分析,事件id:{}"
,
event
.
getId
());
});
kafkaTemplate
.
send
(
EVENT_MODEL_KAFKA_CHANNEL
,
event
.
getEventCode
());
CompletableFuture
.
runAsync
(()
->
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
//立马执行一次事件分析
//立马执行一次事件分析
analysisService
.
regenerate
(
event
.
getId
());
analysisService
.
regenerate
(
event
.
getId
());
});
});
...
...
src/main/java/com/zzsn/event/service/impl/AnalysisServiceImpl.java
浏览文件 @
e5ceea00
...
@@ -24,12 +24,10 @@ import com.zzsn.event.util.ppt.ProgressResponse;
...
@@ -24,12 +24,10 @@ import com.zzsn.event.util.ppt.ProgressResponse;
import
com.zzsn.event.vo.*
;
import
com.zzsn.event.vo.*
;
import
com.zzsn.event.vo.es.SpecialInformation
;
import
com.zzsn.event.vo.es.SpecialInformation
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
net.bytebuddy.implementation.bytecode.Throw
;
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.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.InputStream
;
...
@@ -353,7 +351,6 @@ public class AnalysisServiceImpl implements AnalysisService {
...
@@ -353,7 +351,6 @@ public class AnalysisServiceImpl implements AnalysisService {
@Override
@Override
public
void
regenerate
(
String
eventId
)
{
public
void
regenerate
(
String
eventId
)
{
List
<
EventLlmConfig
>
configList
=
eventLlmConfigService
.
getConfigList
(
eventId
);
List
<
EventLlmConfig
>
configList
=
eventLlmConfigService
.
getConfigList
(
eventId
);
List
<
EventAnalysisVersionRecord
>
records
=
new
ArrayList
<>();
String
today
=
DateUtil
.
dateToString
(
new
Date
());
String
today
=
DateUtil
.
dateToString
(
new
Date
());
//保存版本信息
//保存版本信息
String
versionId
=
saveVersion
(
eventId
,
today
);
String
versionId
=
saveVersion
(
eventId
,
today
);
...
@@ -377,7 +374,7 @@ public class AnalysisServiceImpl implements AnalysisService {
...
@@ -377,7 +374,7 @@ public class AnalysisServiceImpl implements AnalysisService {
}
}
}
}
EventAnalysisVersionRecord
coreSummaryRecord
=
EventAnalysisVersionRecord
.
of
(
versionId
,
AnalysisColumnEnum
.
CORE_SUMMARY
,
eventDescribe
);
EventAnalysisVersionRecord
coreSummaryRecord
=
EventAnalysisVersionRecord
.
of
(
versionId
,
AnalysisColumnEnum
.
CORE_SUMMARY
,
eventDescribe
);
records
.
add
(
coreSummaryRecord
);
eventAnalysisVersionRecordService
.
save
(
coreSummaryRecord
);
log
.
info
(
"{}-事件分析【{}】重新生成逻辑完成。"
,
eventName
,
AnalysisColumnEnum
.
CORE_SUMMARY
.
getName
());
log
.
info
(
"{}-事件分析【{}】重新生成逻辑完成。"
,
eventName
,
AnalysisColumnEnum
.
CORE_SUMMARY
.
getName
());
//事件脉络
//事件脉络
//List<Map<String, Object>> eventContext = eventContextService.eventContext(eventId);
//List<Map<String, Object>> eventContext = eventContextService.eventContext(eventId);
...
@@ -390,14 +387,14 @@ public class AnalysisServiceImpl implements AnalysisService {
...
@@ -390,14 +387,14 @@ public class AnalysisServiceImpl implements AnalysisService {
List
<
CountVO
>
wordTrend
=
this
.
wordTrend
(
eventId
,
null
,
null
);
List
<
CountVO
>
wordTrend
=
this
.
wordTrend
(
eventId
,
null
,
null
);
if
(
CollectionUtils
.
isNotEmpty
(
wordTrend
))
{
if
(
CollectionUtils
.
isNotEmpty
(
wordTrend
))
{
EventAnalysisVersionRecord
record
=
EventAnalysisVersionRecord
.
of
(
versionId
,
AnalysisColumnEnum
.
KEYWORD_TREND
,
JSON
.
toJSONString
(
wordTrend
));
EventAnalysisVersionRecord
record
=
EventAnalysisVersionRecord
.
of
(
versionId
,
AnalysisColumnEnum
.
KEYWORD_TREND
,
JSON
.
toJSONString
(
wordTrend
));
records
.
add
(
record
);
eventAnalysisVersionRecordService
.
save
(
record
);
log
.
info
(
"{}-事件分析【{}】重新生成逻辑完成。"
,
eventName
,
AnalysisColumnEnum
.
KEYWORD_TREND
.
getName
());
log
.
info
(
"{}-事件分析【{}】重新生成逻辑完成。"
,
eventName
,
AnalysisColumnEnum
.
KEYWORD_TREND
.
getName
());
}
}
//关键词共现关系
//关键词共现关系
List
<
CoOccurrenceVO
>
coOccurrenceVOS
=
this
.
coOccurrence
(
eventId
,
null
,
null
);
List
<
CoOccurrenceVO
>
coOccurrenceVOS
=
this
.
coOccurrence
(
eventId
,
null
,
null
);
if
(
CollectionUtils
.
isNotEmpty
(
coOccurrenceVOS
))
{
if
(
CollectionUtils
.
isNotEmpty
(
coOccurrenceVOS
))
{
EventAnalysisVersionRecord
record
=
EventAnalysisVersionRecord
.
of
(
versionId
,
AnalysisColumnEnum
.
CO_OCCURRENCE
,
JSON
.
toJSONString
(
coOccurrenceVOS
));
EventAnalysisVersionRecord
record
=
EventAnalysisVersionRecord
.
of
(
versionId
,
AnalysisColumnEnum
.
CO_OCCURRENCE
,
JSON
.
toJSONString
(
coOccurrenceVOS
));
records
.
add
(
record
);
eventAnalysisVersionRecordService
.
save
(
record
);
log
.
info
(
"{}-事件分析【{}】重新生成逻辑完成。"
,
eventName
,
AnalysisColumnEnum
.
CO_OCCURRENCE
.
getName
());
log
.
info
(
"{}-事件分析【{}】重新生成逻辑完成。"
,
eventName
,
AnalysisColumnEnum
.
CO_OCCURRENCE
.
getName
());
}
}
//大模型相关逻辑生成的结果(影响评估,举措建议等)
//大模型相关逻辑生成的结果(影响评估,举措建议等)
...
@@ -405,11 +402,9 @@ public class AnalysisServiceImpl implements AnalysisService {
...
@@ -405,11 +402,9 @@ public class AnalysisServiceImpl implements AnalysisService {
for
(
EventLlmConfig
config
:
collect
)
{
for
(
EventLlmConfig
config
:
collect
)
{
String
llmResult
=
this
.
llmResult
(
eventName
,
content
,
null
,
null
,
config
);
String
llmResult
=
this
.
llmResult
(
eventName
,
content
,
null
,
null
,
config
);
EventAnalysisVersionRecord
record
=
EventAnalysisVersionRecord
.
of
(
versionId
,
Objects
.
requireNonNull
(
AnalysisColumnEnum
.
getByCode
(
config
.
getColumnCode
())),
llmResult
);
EventAnalysisVersionRecord
record
=
EventAnalysisVersionRecord
.
of
(
versionId
,
Objects
.
requireNonNull
(
AnalysisColumnEnum
.
getByCode
(
config
.
getColumnCode
())),
llmResult
);
records
.
add
(
record
);
eventAnalysisVersionRecordService
.
save
(
record
);
log
.
info
(
"{}-事件分析【{}】重新生成逻辑完成。"
,
eventName
,
config
.
getColumnName
());
log
.
info
(
"{}-事件分析【{}】重新生成逻辑完成。"
,
eventName
,
config
.
getColumnName
());
}
}
//保存版本记录信息
eventAnalysisVersionRecordService
.
saveBatch
(
records
);
log
.
info
(
"{}-事件分析重新生成逻辑完成。"
,
eventName
);
log
.
info
(
"{}-事件分析重新生成逻辑完成。"
,
eventName
);
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论