Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
E
event
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
陈世强
event
Commits
bf99fd94
提交
bf99fd94
authored
7月 28, 2025
作者:
925993793@qq.com
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
事件分析新版本功能开发
上级
7f3569c8
全部展开
显示空白字符变更
内嵌
并排
正在显示
18 个修改的文件
包含
311 行增加
和
161 行删除
+311
-161
EventAnalysisController.java
...va/com/zzsn/event/controller/EventAnalysisController.java
+0
-0
EventManageController.java
...java/com/zzsn/event/controller/EventManageController.java
+15
-26
KeywordController.java
...a/com/zzsn/event/controller/common/KeywordController.java
+17
-0
LLmConfigController.java
...com/zzsn/event/controller/common/LLmConfigController.java
+49
-0
KeywordConf.java
src/main/java/com/zzsn/event/entity/KeywordConf.java
+62
-0
AnalysisColumnEnum.java
src/main/java/com/zzsn/event/enums/AnalysisColumnEnum.java
+11
-17
KafkaConsumer.java
src/main/java/com/zzsn/event/kafka/KafkaConsumer.java
+0
-97
KeywordConfMapper.java
src/main/java/com/zzsn/event/mapper/KeywordConfMapper.java
+20
-0
EventAnalysisVersionRecordService.java
...zzsn/event/service/EventAnalysisVersionRecordService.java
+2
-0
EventAnalysisVersionService.java
...a/com/zzsn/event/service/EventAnalysisVersionService.java
+8
-0
EventLlmConfigService.java
...in/java/com/zzsn/event/service/EventLlmConfigService.java
+2
-0
AnalysisServiceImpl.java
...java/com/zzsn/event/service/impl/AnalysisServiceImpl.java
+37
-9
EventAnalysisVersionRecordServiceImpl.java
...t/service/impl/EventAnalysisVersionRecordServiceImpl.java
+14
-0
EventAnalysisVersionServiceImpl.java
...n/event/service/impl/EventAnalysisVersionServiceImpl.java
+15
-5
EventLlmConfigServiceImpl.java
...om/zzsn/event/service/impl/EventLlmConfigServiceImpl.java
+37
-0
EventServiceImpl.java
...in/java/com/zzsn/event/service/impl/EventServiceImpl.java
+19
-7
AnalysisTask.java
src/main/java/com/zzsn/event/task/AnalysisTask.java
+0
-0
EventVO.java
src/main/java/com/zzsn/event/vo/EventVO.java
+3
-0
没有找到文件。
src/main/java/com/zzsn/event/controller/EventAnalysisController.java
浏览文件 @
bf99fd94
差异被折叠。
点击展开。
src/main/java/com/zzsn/event/controller/EventManageController.java
浏览文件 @
bf99fd94
package
com
.
zzsn
.
event
.
controller
;
package
com
.
zzsn
.
event
.
controller
;
import
cn.hutool.json.JSONUtil
;
import
cn.hutool.json.JSONUtil
;
import
com.alibaba.fastjson2.JSON
;
import
com.alibaba.fastjson2.JSONObject
;
import
com.alibaba.fastjson2.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
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.clb.common.model.task.dto.titr.KeyWordsDTO
;
import
com.zzsn.event.constant.Constants
;
import
com.zzsn.event.constant.Result
;
import
com.zzsn.event.constant.Result
;
import
com.zzsn.event.entity.ClbModelArrangeSubjectMap
;
import
com.zzsn.event.entity.*
;
import
com.zzsn.event.entity.Event
;
import
com.zzsn.event.entity.EventAnalysisVersionRecord
;
import
com.zzsn.event.entity.KeyWords
;
import
com.zzsn.event.entity.SubjectInfoSourceMap
;
import
com.zzsn.event.enums.AnalysisColumnEnum
;
import
com.zzsn.event.enums.AnalysisColumnEnum
;
import
com.zzsn.event.service.*
;
import
com.zzsn.event.service.*
;
import
com.zzsn.event.service.*
;
import
com.zzsn.event.service.impl.CaiJiCenterHttpService
;
import
com.zzsn.event.service.impl.CaiJiCenterHttpService
;
import
com.zzsn.event.service.impl.ConfigurationMessageService
;
import
com.zzsn.event.service.impl.ConfigurationMessageService
;
import
com.zzsn.event.util.HttpUtil
;
import
com.zzsn.event.util.HttpUtil
;
import
com.zzsn.event.util.ObjectUtil
;
import
com.zzsn.event.util.ObjectUtil
;
import
com.zzsn.event.util.RedisUtil
;
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.*
;
...
@@ -32,14 +23,16 @@ import io.swagger.annotations.Api;
...
@@ -32,14 +23,16 @@ import io.swagger.annotations.Api;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
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.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.*
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.util.*
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.concurrent.CompletableFuture
;
import
java.util.concurrent.CompletableFuture
;
/**
/**
...
@@ -68,13 +61,12 @@ public class EventManageController {
...
@@ -68,13 +61,12 @@ public class EventManageController {
private
IKeyWordsService
keyWordsService
;
private
IKeyWordsService
keyWordsService
;
@Autowired
@Autowired
private
ClbModelArrangeSubjectMapService
clbModelArrangeSubjectMapService
;
private
ClbModelArrangeSubjectMapService
clbModelArrangeSubjectMapService
;
@Autowired
private
RedisUtil
redisUtil
;
@Resource
@Resource
private
KafkaTemplate
<
String
,
String
>
kafkaTemplate
;
private
KafkaTemplate
<
String
,
String
>
kafkaTemplate
;
@Autowired
@Autowired
private
EventAnalysisVersionRecordService
eventAnalysisVersionRecordService
;
private
EventAnalysisVersionRecordService
eventAnalysisVersionRecordService
;
@Autowired
private
EventAnalysisVersionService
eventAnalysisVersionService
;
@Value
((
"${serviceProject.url:}"
))
@Value
((
"${serviceProject.url:}"
))
private
String
SERVICE_PROJECT_URL
;
private
String
SERVICE_PROJECT_URL
;
...
@@ -133,22 +125,19 @@ public class EventManageController {
...
@@ -133,22 +125,19 @@ public class EventManageController {
/**
/**
* 通过id查询
* 通过id查询
*
*
* @param
i
d 事件id
* @param
eventI
d 事件id
* @return
* @return
*/
*/
@GetMapping
(
value
=
"/queryById"
)
@GetMapping
(
value
=
"/queryById"
)
public
Result
<?>
queryById
(
@RequestParam
(
name
=
"id"
)
String
i
d
,
public
Result
<?>
queryById
(
@RequestParam
String
eventI
d
,
@RequestParam
(
required
=
false
)
String
versionId
)
{
@RequestParam
(
required
=
false
)
String
versionId
)
{
EventVO
eventVO
=
eventService
.
queryInfo
(
id
);
EventVO
eventVO
=
eventService
.
queryInfo
(
eventId
);
if
(
StringUtils
.
isNotEmpty
(
versionId
))
{
if
(
StringUtils
.
isEmpty
(
versionId
))
{
LambdaQueryWrapper
<
EventAnalysisVersionRecord
>
queryWrapper
=
Wrappers
.
lambdaQuery
();
EventAnalysisVersion
eventAnalysisVersion
=
eventAnalysisVersionService
.
latestVersion
(
eventId
);
queryWrapper
.
eq
(
EventAnalysisVersionRecord:
:
getVersionId
,
versionId
)
versionId
=
eventAnalysisVersion
.
getId
();
.
eq
(
EventAnalysisVersionRecord:
:
getColumnCode
,
AnalysisColumnEnum
.
CORE_SUMMARY
.
getCode
());
EventAnalysisVersionRecord
eventAnalysisVersionRecord
=
eventAnalysisVersionRecordService
.
getOne
(
queryWrapper
);
if
(
eventAnalysisVersionRecord
!=
null
)
{
eventVO
.
setEventDescribe
(
eventAnalysisVersionRecord
.
getReturnData
());
}
}
}
String
versionData
=
eventAnalysisVersionRecordService
.
getVersionData
(
versionId
,
AnalysisColumnEnum
.
CORE_SUMMARY
.
getCode
());
eventVO
.
setEventDescribe
(
versionData
);
return
Result
.
OK
(
eventVO
);
return
Result
.
OK
(
eventVO
);
}
}
...
...
src/main/java/com/zzsn/event/controller/common/KeywordController.java
浏览文件 @
bf99fd94
...
@@ -4,9 +4,11 @@ import com.alibaba.fastjson2.JSONObject;
...
@@ -4,9 +4,11 @@ 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.constant.Result
;
import
com.zzsn.event.entity.KeyWords
;
import
com.zzsn.event.entity.KeyWords
;
import
com.zzsn.event.entity.KeywordConf
;
import
com.zzsn.event.entity.KeywordsType
;
import
com.zzsn.event.entity.KeywordsType
;
import
com.zzsn.event.service.IKeyWordsService
;
import
com.zzsn.event.service.IKeyWordsService
;
import
com.zzsn.event.service.IKeywordsTypeService
;
import
com.zzsn.event.service.IKeywordsTypeService
;
import
com.zzsn.event.service.KeywordConfService
;
import
com.zzsn.event.vo.KeyWordsPage
;
import
com.zzsn.event.vo.KeyWordsPage
;
import
com.zzsn.event.vo.KeywordsTypeVo
;
import
com.zzsn.event.vo.KeywordsTypeVo
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -28,6 +30,8 @@ public class KeywordController {
...
@@ -28,6 +30,8 @@ public class KeywordController {
private
IKeywordsTypeService
keywordsTypeService
;
private
IKeywordsTypeService
keywordsTypeService
;
@Autowired
@Autowired
private
IKeyWordsService
keyWordsService
;
private
IKeyWordsService
keyWordsService
;
@Autowired
private
KeywordConfService
keywordConfService
;
/**
/**
* 通过父级id列表查询
* 通过父级id列表查询
...
@@ -189,4 +193,17 @@ public class KeywordController {
...
@@ -189,4 +193,17 @@ public class KeywordController {
KeyWordsPage
keyWords
=
keyWordsService
.
getKeyWordsById
(
id
);
KeyWordsPage
keyWords
=
keyWordsService
.
getKeyWordsById
(
id
);
return
Result
.
OK
(
keyWords
);
return
Result
.
OK
(
keyWords
);
}
}
/**
* 添加关键词过滤配置
*
* @param keywordConf 过滤词信息
* @author lkg
* @date 2025/7/28
*/
@PostMapping
(
"/conf/add"
)
public
Result
<?>
configAdd
(
@RequestBody
List
<
KeywordConf
>
keywordConf
){
keywordConfService
.
saveBatch
(
keywordConf
);
return
Result
.
OK
();
}
}
}
src/main/java/com/zzsn/event/controller/common/LLmConfigController.java
0 → 100644
浏览文件 @
bf99fd94
package
com
.
zzsn
.
event
.
controller
.
common
;
import
com.zzsn.event.constant.Result
;
import
com.zzsn.event.entity.EventLlmConfig
;
import
com.zzsn.event.service.EventLlmConfigService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
/**
* 大模型配置
*
* @author lkg
* @date 2025/7/28
*/
@RestController
@RequestMapping
(
"/llm/config"
)
public
class
LLmConfigController
{
@Autowired
private
EventLlmConfigService
llmConfigService
;
/**
* 事件下大模型配置信息
*
* @param eventId 事件id
* @author lkg
* @date 2025/7/28
*/
@GetMapping
(
"/list"
)
public
Result
<?>
list
(
@RequestParam
String
eventId
)
{
List
<
EventLlmConfig
>
configList
=
llmConfigService
.
getConfigList
(
eventId
);
return
Result
.
OK
(
configList
);
}
/**
* 编辑事件的大模型配置信息
*
* @param eventLlmConfigList 大模型配置信息
* @author lkg
* @date 2025/7/28
*/
@PostMapping
(
"/modify"
)
public
Result
<?>
modify
(
@RequestBody
List
<
EventLlmConfig
>
eventLlmConfigList
)
{
llmConfigService
.
modify
(
eventLlmConfigList
);
return
Result
.
OK
();
}
}
src/main/java/com/zzsn/event/entity/KeywordConf.java
0 → 100644
浏览文件 @
bf99fd94
package
com
.
zzsn
.
event
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModel
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* 关键词过滤配置
* @TableName clb_keyword_conf
*/
@Data
@TableName
(
"clb_keyword_conf"
)
@Accessors
(
chain
=
true
)
@EqualsAndHashCode
(
callSuper
=
false
)
@ApiModel
(
value
=
"clb_keyword_conf对象"
,
description
=
"关键词过滤配置"
)
public
class
KeywordConf
implements
Serializable
{
/**
*
*/
@TableId
(
type
=
IdType
.
ASSIGN_ID
)
private
String
id
;
/**
* 分类id
*/
private
String
databaseId
;
/**
* 分类类型
*/
private
String
databaseType
;
/**
* 关键词
*/
private
String
keyword
;
/**
* 0:黑名单 1:白名单
*/
private
Integer
type
;
/**
* 作用范围 0:全库 1:本库
*/
private
Integer
rangeType
;
/**
* 创建人
*/
private
String
createBy
;
/**
* 创建时间
*/
@JsonFormat
(
timezone
=
"GMT+8"
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
createTime
;
}
src/main/java/com/zzsn/event/enums/AnalysisColumnEnum.java
浏览文件 @
bf99fd94
...
@@ -11,33 +11,27 @@ import java.util.List;
...
@@ -11,33 +11,27 @@ import java.util.List;
public
enum
AnalysisColumnEnum
{
public
enum
AnalysisColumnEnum
{
CORE_SUMMARY
(
1
,
"核心摘要"
,
"string"
,
1
),
CORE_SUMMARY
(
1
,
"核心摘要"
,
"string"
,
1
),
EVENT_CONTEXT
(
2
,
"事件脉络"
,
"array"
,
0
),
EVENT_CONTEXT
(
2
,
"事件脉络"
,
"array"
,
0
),
KEYWORD_TREND
(
3
,
"关键词趋势分析"
,
"array"
,
0
),
KEYWORD_TREND
(
3
,
"关键词趋势分析"
,
"array"
,
0
),
CO_OCCURRENCE
(
4
,
"关键词共现"
,
"array"
,
0
),
CO_OCCURRENCE
(
4
,
"关键词共现"
,
"array"
,
0
),
IMPACT_ASSESSMENT
(
5
,
"影响评估"
,
"array"
,
1
),
IMPACT_ASSESSMENT
(
5
,
"影响评估"
,
"array"
,
1
),
MEASURE_SUGGEST
(
6
,
"举措建议"
,
"array"
,
1
),
MEASURE_SUGGEST
(
6
,
"举措建议"
,
"array"
,
1
),
KNOWLEDGE_ENTRY
(
7
,
"知识词条"
,
"array"
,
1
),
KNOWLEDGE_ENTRY
(
7
,
"知识词条"
,
"array"
,
1
),
ENTERPRISE_CASE
(
8
,
"企业案例"
,
"array"
,
1
),
ENTERPRISE_CASE
(
8
,
"企业案例"
,
"array"
,
1
),
COUNTRY_POLICY
(
9
,
"各国政策"
,
"array"
,
1
),
COUNTRY_POLICY
(
9
,
"各国政策"
,
"array"
,
1
),
DOMESTIC_SIMILAR_EVENT
(
10
,
"本国类似事件"
,
"array"
,
1
),
DOMESTIC_SIMILAR_EVENT
(
10
,
"中国类似事件"
,
"array"
,
1
),
FOREIGN_SIMILAR_EVENT
(
11
,
"各国类似事件"
,
"array"
,
1
),
FOREIGN_SIMILAR_EVENT
(
11
,
"各国类似事件"
,
"array"
,
1
);
//GENERATE_OUTLINE(12,"生成大纲","array", 1),
//GENERATE_PPT(13,"生成ppt","array", 1),
;
//栏目编码
//栏目编码
private
final
Integer
code
;
private
final
Integer
code
;
...
...
src/main/java/com/zzsn/event/kafka/KafkaConsumer.java
浏览文件 @
bf99fd94
package
com
.
zzsn
.
event
.
kafka
;
package
com
.
zzsn
.
event
.
kafka
;
import
com.alibaba.fastjson2.JSON
;
import
com.alibaba.fastjson2.JSON
;
import
com.alibaba.fastjson2.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.zzsn.event.constant.Constants
;
import
com.zzsn.event.entity.EventAnalysisReport
;
import
com.zzsn.event.entity.EventContext
;
import
com.zzsn.event.entity.EventContext
;
import
com.zzsn.event.entity.SubjectAnalysis
;
import
com.zzsn.event.service.EventAnalysisReportService
;
import
com.zzsn.event.service.EventContextService
;
import
com.zzsn.event.service.EventContextService
;
import
com.zzsn.event.service.SubjectAnalysisService
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
@@ -31,10 +25,6 @@ import java.util.List;
...
@@ -31,10 +25,6 @@ import java.util.List;
@Component
@Component
public
class
KafkaConsumer
{
public
class
KafkaConsumer
{
@Autowired
@Autowired
private
SubjectAnalysisService
subjectAnalysisService
;
@Autowired
private
EventAnalysisReportService
eventAnalysisReportService
;
@Autowired
private
EventContextService
eventContextService
;
private
EventContextService
eventContextService
;
...
@@ -85,91 +75,4 @@ public class KafkaConsumer {
...
@@ -85,91 +75,4 @@ public class KafkaConsumer {
}
}
}
}
}
}
/**
* 获取-事件脉络-分析结果数据,并入库
*
* @param record 接收的kafka数据
*/
@KafkaListener
(
topics
=
{
Constants
.
EVENT_CONTEXT_RECEIVE_TOPIC
})
public
void
eventContext
(
ConsumerRecord
<
String
,
String
>
record
)
{
String
value
=
record
.
value
();
if
(
StringUtils
.
isNotEmpty
(
value
))
{
String
subjectId
;
Integer
category
=
2
;
try
{
List
<
SubjectAnalysis
>
subjectAnalyses
=
JSON
.
parseArray
(
value
,
SubjectAnalysis
.
class
);
subjectId
=
subjectAnalyses
.
get
(
0
).
getSubjectId
();
subjectAnalyses
.
forEach
(
e
->
{
e
.
setCategory
(
category
);
e
.
setTitle
(
removeNonBmpUniCodes
(
e
.
getTitle
()));
});
LambdaQueryWrapper
<
SubjectAnalysis
>
queryWrapper
=
Wrappers
.
lambdaQuery
();
queryWrapper
.
eq
(
SubjectAnalysis:
:
getSubjectId
,
subjectId
).
eq
(
SubjectAnalysis:
:
getCategory
,
category
);
int
count
=
subjectAnalysisService
.
count
(
queryWrapper
);
if
(
count
>
0
)
{
subjectAnalysisService
.
remove
(
queryWrapper
);
}
subjectAnalysisService
.
saveBatch
(
subjectAnalyses
);
log
.
info
(
"id为-{}-的专题,此次-事件脉络-数据更新完成"
,
subjectId
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
/**
* 获取-伪事件脉络-分析结果数据,并入库
*
* @param record 接收的kafka数据
*/
@KafkaListener
(
topics
=
{
Constants
.
FAKE_EVENT_CONTEXT_RECEIVE_TOPIC
})
public
void
eventContext_fake
(
ConsumerRecord
<
String
,
String
>
record
)
{
String
value
=
record
.
value
();
if
(
StringUtils
.
isNotEmpty
(
value
))
{
String
subjectId
;
Integer
category
=
3
;
try
{
List
<
SubjectAnalysis
>
subjectAnalyses
=
JSON
.
parseArray
(
value
,
SubjectAnalysis
.
class
);
subjectId
=
subjectAnalyses
.
get
(
0
).
getSubjectId
();
subjectAnalyses
.
forEach
(
e
->
{
e
.
setCategory
(
category
);
e
.
setTitle
(
removeNonBmpUniCodes
(
e
.
getTitle
()));
});
LambdaQueryWrapper
<
SubjectAnalysis
>
queryWrapper
=
Wrappers
.
lambdaQuery
();
queryWrapper
.
eq
(
SubjectAnalysis:
:
getSubjectId
,
subjectId
).
eq
(
SubjectAnalysis:
:
getCategory
,
category
);
int
count
=
subjectAnalysisService
.
count
(
queryWrapper
);
if
(
count
>
0
)
{
subjectAnalysisService
.
remove
(
queryWrapper
);
}
subjectAnalysisService
.
saveBatch
(
subjectAnalyses
);
log
.
info
(
"id为-{}-的专题,此次-伪事件脉络-数据更新完成"
,
subjectId
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
/**
* 获取事件的分析报告数据
*
* @param record 接收的kafka数据
* @author lkg
* @date 2024/4/12
*/
@KafkaListener
(
topics
=
{
Constants
.
EVENT_REPORT_RECEIVE_TOPIC
})
public
void
eventReport
(
ConsumerRecord
<
String
,
String
>
record
)
{
String
value
=
record
.
value
();
EventAnalysisReport
eventAnalysisReport
=
JSONObject
.
parseObject
(
value
,
EventAnalysisReport
.
class
);
eventAnalysisReportService
.
modify
(
eventAnalysisReport
.
getEventId
(),
eventAnalysisReport
.
getFilePath
());
log
.
info
(
"id为-{}-的事件,分析报告更新完成"
,
eventAnalysisReport
.
getEventId
());
}
//去除特殊的字符,例如表情符
private
String
removeNonBmpUniCodes
(
String
str
)
{
return
StringUtils
.
isEmpty
(
str
)
?
null
:
str
.
replaceAll
(
"[^\\u0000-\\uFFFF]"
,
""
);
}
}
}
src/main/java/com/zzsn/event/mapper/KeywordConfMapper.java
0 → 100644
浏览文件 @
bf99fd94
package
com
.
zzsn
.
event
.
mapper
;
import
com.zzsn.event.entity.KeywordConf
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Mapper
;
/**
* @author lenovo
* @description 针对表【clb_keyword_conf(关键词过滤配置)】的数据库操作Mapper
* @createDate 2025-07-28 10:25:56
* @Entity com.zzsn.event.entity.KeywordConf
*/
@Mapper
public
interface
KeywordConfMapper
extends
BaseMapper
<
KeywordConf
>
{
}
src/main/java/com/zzsn/event/service/EventAnalysisVersionRecordService.java
浏览文件 @
bf99fd94
...
@@ -10,4 +10,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
...
@@ -10,4 +10,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
*/
public
interface
EventAnalysisVersionRecordService
extends
IService
<
EventAnalysisVersionRecord
>
{
public
interface
EventAnalysisVersionRecordService
extends
IService
<
EventAnalysisVersionRecord
>
{
String
getVersionData
(
String
versionId
,
Integer
columnCode
);
}
}
src/main/java/com/zzsn/event/service/EventAnalysisVersionService.java
浏览文件 @
bf99fd94
...
@@ -10,4 +10,12 @@ import com.baomidou.mybatisplus.extension.service.IService;
...
@@ -10,4 +10,12 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
*/
public
interface
EventAnalysisVersionService
extends
IService
<
EventAnalysisVersion
>
{
public
interface
EventAnalysisVersionService
extends
IService
<
EventAnalysisVersion
>
{
/**
* 获取事件分析的最新版本
*
* @param eventId 事件id
* @author lkg
* @date 2025/7/28
*/
EventAnalysisVersion
latestVersion
(
String
eventId
);
}
}
src/main/java/com/zzsn/event/service/EventLlmConfigService.java
浏览文件 @
bf99fd94
...
@@ -15,4 +15,6 @@ public interface EventLlmConfigService extends IService<EventLlmConfig> {
...
@@ -15,4 +15,6 @@ public interface EventLlmConfigService extends IService<EventLlmConfig> {
List
<
EventLlmConfig
>
getConfigList
(
String
eventId
);
List
<
EventLlmConfig
>
getConfigList
(
String
eventId
);
EventLlmConfig
getConfig
(
String
eventId
,
Integer
columnCode
);
EventLlmConfig
getConfig
(
String
eventId
,
Integer
columnCode
);
void
modify
(
List
<
EventLlmConfig
>
eventLlmConfigList
);
}
}
src/main/java/com/zzsn/event/service/impl/AnalysisServiceImpl.java
浏览文件 @
bf99fd94
...
@@ -294,14 +294,42 @@ public class AnalysisServiceImpl implements AnalysisService {
...
@@ -294,14 +294,42 @@ public class AnalysisServiceImpl implements AnalysisService {
@Override
@Override
public
String
llmResult
(
String
eventName
,
String
startTime
,
String
endTime
,
EventLlmConfig
llmConfig
)
{
public
String
llmResult
(
String
eventName
,
String
startTime
,
String
endTime
,
EventLlmConfig
llmConfig
)
{
return
llmService
.
model
(
llmConfig
.
getLlmName
(),
llmConfig
.
getLlmPrompt
(),
eventName
);
String
result
=
llmService
.
model
(
llmConfig
.
getLlmName
(),
llmConfig
.
getLlmPrompt
(),
eventName
);
if
(
llmConfig
.
getColumnCode
().
equals
(
AnalysisColumnEnum
.
IMPACT_ASSESSMENT
.
getCode
()))
{
String
prompt
=
"根据提供的事件名称,以及其%s的概述,详细的描述下该事件的%s"
;
List
<
JSONObject
>
impactList
=
JSON
.
parseArray
(
result
,
JSONObject
.
class
);
for
(
JSONObject
impact
:
impactList
)
{
String
theme
=
impact
.
getString
(
"theme"
);
JSONObject
params
=
new
JSONObject
();
params
.
put
(
"eventName"
,
eventName
);
params
.
put
(
"impactOutline"
,
impact
);
String
impactDetail
=
llmService
.
model
(
llmConfig
.
getLlmName
(),
String
.
format
(
prompt
,
theme
,
theme
),
params
.
toJSONString
());
impact
.
put
(
"impactDetail"
,
impactDetail
);
}
result
=
JSON
.
toJSONString
(
impactList
);
}
return
result
;
}
}
@Override
@Override
public
String
llmResult
(
String
eventId
,
String
startTime
,
String
endTime
,
Integer
columnCode
)
{
public
String
llmResult
(
String
eventId
,
String
startTime
,
String
endTime
,
Integer
columnCode
)
{
Event
event
=
eventService
.
getById
(
eventId
);
Event
event
=
eventService
.
getById
(
eventId
);
EventLlmConfig
llmConfig
=
eventLlmConfigService
.
getConfig
(
eventId
,
columnCode
);
EventLlmConfig
llmConfig
=
eventLlmConfigService
.
getConfig
(
eventId
,
columnCode
);
return
llmService
.
model
(
llmConfig
.
getLlmName
(),
llmConfig
.
getLlmPrompt
(),
event
.
getEventName
());
String
result
=
llmService
.
model
(
llmConfig
.
getLlmName
(),
llmConfig
.
getLlmPrompt
(),
event
.
getEventName
());
if
(
columnCode
.
equals
(
AnalysisColumnEnum
.
IMPACT_ASSESSMENT
.
getCode
()))
{
String
prompt
=
"根据提供的事件名称,以及其%s的概述,详细的描述下该事件的%s"
;
List
<
JSONObject
>
impactList
=
JSON
.
parseArray
(
result
,
JSONObject
.
class
);
for
(
JSONObject
impact
:
impactList
)
{
String
theme
=
impact
.
getString
(
"theme"
);
JSONObject
params
=
new
JSONObject
();
params
.
put
(
"eventName"
,
event
.
getEventName
());
params
.
put
(
"impactOutline"
,
impact
);
String
impactDetail
=
llmService
.
model
(
llmConfig
.
getLlmName
(),
String
.
format
(
prompt
,
theme
,
theme
),
params
.
toJSONString
());
impact
.
put
(
"impactDetail"
,
impactDetail
);
}
result
=
JSON
.
toJSONString
(
impactList
);
}
return
result
;
}
}
@Override
@Override
...
@@ -333,33 +361,33 @@ public class AnalysisServiceImpl implements AnalysisService {
...
@@ -333,33 +361,33 @@ public class AnalysisServiceImpl implements AnalysisService {
if
(
CollectionUtils
.
isNotEmpty
(
eventContext
))
{
if
(
CollectionUtils
.
isNotEmpty
(
eventContext
))
{
EventAnalysisVersionRecord
record
=
EventAnalysisVersionRecord
.
of
(
versionId
,
AnalysisColumnEnum
.
EVENT_CONTEXT
,
JSON
.
toJSONString
(
eventContext
));
EventAnalysisVersionRecord
record
=
EventAnalysisVersionRecord
.
of
(
versionId
,
AnalysisColumnEnum
.
EVENT_CONTEXT
,
JSON
.
toJSONString
(
eventContext
));
records
.
add
(
record
);
records
.
add
(
record
);
log
.
info
(
"{}-事件分析【{}】重新生成逻辑完成。"
,
eventName
,
"事件脉络"
);
log
.
info
(
"{}-事件分析【{}】重新生成逻辑完成。"
,
eventName
,
"事件脉络"
);
}
}
//关键词趋势分析
//关键词趋势分析
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
);
records
.
add
(
record
);
log
.
info
(
"{}-事件分析【{}】重新生成逻辑完成。"
,
eventName
,
"关键词趋势分析"
);
log
.
info
(
"{}-事件分析【{}】重新生成逻辑完成。"
,
eventName
,
"关键词趋势分析"
);
}
}
//关键词共现关系
//关键词共现关系
/*
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
);
records
.
add
(
record
);
log
.
info
(
"{}-事件分析【{}】重新生成逻辑完成。"
,
eventName
,
"关键词共现关系"
);
log
.
info
(
"{}-事件分析【{}】重新生成逻辑完成。"
,
eventName
,
"关键词共现关系"
);
}
*/
}
//大模型相关逻辑生成的结果(影响评估,举措建议等)
//大模型相关逻辑生成的结果(影响评估,举措建议等)
List
<
EventLlmConfig
>
collect
=
configList
.
stream
().
filter
(
e
->
!
e
.
getColumnCode
().
equals
(
AnalysisColumnEnum
.
CORE_SUMMARY
.
getCode
())).
collect
(
Collectors
.
toList
());
List
<
EventLlmConfig
>
collect
=
configList
.
stream
().
filter
(
e
->
!
e
.
getColumnCode
().
equals
(
AnalysisColumnEnum
.
CORE_SUMMARY
.
getCode
())).
collect
(
Collectors
.
toList
());
for
(
EventLlmConfig
config
:
collect
)
{
for
(
EventLlmConfig
config
:
collect
)
{
String
llmResult
=
this
.
llmResult
(
eventName
,
null
,
null
,
config
);
String
llmResult
=
this
.
llmResult
(
eventName
,
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
);
records
.
add
(
record
);
log
.
info
(
"{}-事件分析【{}】重新生成逻辑完成。"
,
eventName
,
config
.
getColumnName
());
log
.
info
(
"{}-事件分析【{}】重新生成逻辑完成。"
,
eventName
,
config
.
getColumnName
());
}
}
//保存版本记录信息
//保存版本记录信息
eventAnalysisVersionRecordService
.
saveBatch
(
records
);
eventAnalysisVersionRecordService
.
saveBatch
(
records
);
log
.
info
(
"{}-事件分析重新生成逻辑完成。"
,
eventName
);
log
.
info
(
"{}-事件分析重新生成逻辑完成。"
,
eventName
);
}
}
@Override
@Override
...
...
src/main/java/com/zzsn/event/service/impl/EventAnalysisVersionRecordServiceImpl.java
浏览文件 @
bf99fd94
package
com
.
zzsn
.
event
.
service
.
impl
;
package
com
.
zzsn
.
event
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.zzsn.event.entity.EventAnalysisVersionRecord
;
import
com.zzsn.event.entity.EventAnalysisVersionRecord
;
import
com.zzsn.event.service.EventAnalysisVersionRecordService
;
import
com.zzsn.event.service.EventAnalysisVersionRecordService
;
...
@@ -15,6 +17,18 @@ import org.springframework.stereotype.Service;
...
@@ -15,6 +17,18 @@ import org.springframework.stereotype.Service;
public
class
EventAnalysisVersionRecordServiceImpl
extends
ServiceImpl
<
EventAnalysisVersionRecordMapper
,
EventAnalysisVersionRecord
>
public
class
EventAnalysisVersionRecordServiceImpl
extends
ServiceImpl
<
EventAnalysisVersionRecordMapper
,
EventAnalysisVersionRecord
>
implements
EventAnalysisVersionRecordService
{
implements
EventAnalysisVersionRecordService
{
@Override
public
String
getVersionData
(
String
versionId
,
Integer
columnCode
)
{
String
result
=
null
;
LambdaQueryWrapper
<
EventAnalysisVersionRecord
>
queryWrapper
=
Wrappers
.
lambdaQuery
();
queryWrapper
.
eq
(
EventAnalysisVersionRecord:
:
getVersionId
,
versionId
)
.
eq
(
EventAnalysisVersionRecord:
:
getColumnCode
,
columnCode
);
EventAnalysisVersionRecord
eventAnalysisVersionRecord
=
this
.
getOne
(
queryWrapper
);
if
(
eventAnalysisVersionRecord
!=
null
)
{
result
=
eventAnalysisVersionRecord
.
getReturnData
();
}
return
result
;
}
}
}
...
...
src/main/java/com/zzsn/event/service/impl/EventAnalysisVersionServiceImpl.java
浏览文件 @
bf99fd94
package
com
.
zzsn
.
event
.
service
.
impl
;
package
com
.
zzsn
.
event
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.zzsn.event.entity.EventAnalysisVersion
;
import
com.zzsn.event.entity.EventAnalysisVersion
;
import
com.zzsn.event.service.EventAnalysisVersionService
;
import
com.zzsn.event.service.EventAnalysisVersionService
;
...
@@ -7,14 +9,22 @@ import com.zzsn.event.mapper.EventAnalysisVersionMapper;
...
@@ -7,14 +9,22 @@ import com.zzsn.event.mapper.EventAnalysisVersionMapper;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
/**
/**
* @author lenovo
* @author lenovo
* @description 针对表【event_analysis_version(事件分析版本表)】的数据库操作Service实现
* @description 针对表【event_analysis_version(事件分析版本表)】的数据库操作Service实现
* @createDate 2025-07-16 16:34:46
* @createDate 2025-07-16 16:34:46
*/
*/
@Service
@Service
public
class
EventAnalysisVersionServiceImpl
extends
ServiceImpl
<
EventAnalysisVersionMapper
,
EventAnalysisVersion
>
public
class
EventAnalysisVersionServiceImpl
extends
ServiceImpl
<
EventAnalysisVersionMapper
,
EventAnalysisVersion
>
implements
EventAnalysisVersionService
{
implements
EventAnalysisVersionService
{
@Override
public
EventAnalysisVersion
latestVersion
(
String
eventId
)
{
LambdaQueryWrapper
<
EventAnalysisVersion
>
queryWrapper
=
Wrappers
.
lambdaQuery
();
queryWrapper
.
eq
(
EventAnalysisVersion:
:
getEventId
,
eventId
)
.
orderByDesc
(
EventAnalysisVersion:
:
getCreateTime
)
.
last
(
"limit 1"
);
return
this
.
getOne
(
queryWrapper
);
}
}
}
...
...
src/main/java/com/zzsn/event/service/impl/EventLlmConfigServiceImpl.java
浏览文件 @
bf99fd94
package
com
.
zzsn
.
event
.
service
.
impl
;
package
com
.
zzsn
.
event
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.ObjectUtils
;
import
com.baomidou.mybatisplus.core.toolkit.ObjectUtils
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
...
@@ -9,8 +10,10 @@ import com.zzsn.event.service.EventLlmConfigService;
...
@@ -9,8 +10,10 @@ import com.zzsn.event.service.EventLlmConfigService;
import
com.zzsn.event.mapper.EventLlmConfigMapper
;
import
com.zzsn.event.mapper.EventLlmConfigMapper
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.List
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
/**
* @author lenovo
* @author lenovo
...
@@ -45,6 +48,40 @@ public class EventLlmConfigServiceImpl extends ServiceImpl<EventLlmConfigMapper,
...
@@ -45,6 +48,40 @@ public class EventLlmConfigServiceImpl extends ServiceImpl<EventLlmConfigMapper,
}
}
return
config
;
return
config
;
}
}
@Override
@Transactional
public
void
modify
(
List
<
EventLlmConfig
>
eventLlmConfigList
)
{
if
(
CollectionUtils
.
isEmpty
(
eventLlmConfigList
))
{
return
;
}
String
eventId
=
eventLlmConfigList
.
get
(
0
).
getEventId
();
LambdaQueryWrapper
<
EventLlmConfig
>
queryWrapper
=
Wrappers
.
lambdaQuery
();
queryWrapper
.
eq
(
EventLlmConfig:
:
getEventId
,
eventId
);
List
<
EventLlmConfig
>
configList
=
this
.
list
(
queryWrapper
);
if
(
CollectionUtils
.
isEmpty
(
configList
))
{
List
<
Integer
>
configCodeList
=
eventLlmConfigList
.
stream
().
map
(
EventLlmConfig:
:
getColumnCode
).
collect
(
Collectors
.
toList
());
LambdaQueryWrapper
<
EventLlmConfig
>
query
=
Wrappers
.
lambdaQuery
();
query
.
eq
(
EventLlmConfig:
:
getYnDefault
,
1
).
orderByAsc
(
EventLlmConfig:
:
getColumnCode
);
List
<
EventLlmConfig
>
defaultConfigList
=
this
.
list
(
query
);
if
(
defaultConfigList
.
size
()
>
eventLlmConfigList
.
size
())
{
List
<
EventLlmConfig
>
collect
=
defaultConfigList
.
stream
().
filter
(
config
->
!
configCodeList
.
contains
(
config
.
getColumnCode
())).
collect
(
Collectors
.
toList
());
for
(
EventLlmConfig
config
:
collect
)
{
config
.
setId
(
null
);
config
.
setEventId
(
eventId
);
config
.
setYnDefault
(
0
);
}
eventLlmConfigList
.
addAll
(
collect
);
}
this
.
saveBatch
(
eventLlmConfigList
);
}
else
{
for
(
EventLlmConfig
eventLlmConfig
:
eventLlmConfigList
)
{
LambdaUpdateWrapper
<
EventLlmConfig
>
update
=
Wrappers
.
lambdaUpdate
();
update
.
eq
(
EventLlmConfig:
:
getEventId
,
eventId
).
eq
(
EventLlmConfig:
:
getColumnCode
,
eventLlmConfig
.
getColumnCode
());
this
.
update
(
eventLlmConfig
,
update
);
}
}
}
}
}
...
...
src/main/java/com/zzsn/event/service/impl/EventServiceImpl.java
浏览文件 @
bf99fd94
...
@@ -2,6 +2,7 @@ package com.zzsn.event.service.impl;
...
@@ -2,6 +2,7 @@ package com.zzsn.event.service.impl;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.date.DateTime
;
import
cn.hutool.core.map.MapUtil
;
import
cn.hutool.core.map.MapUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.core.util.StrUtil
;
...
@@ -102,8 +103,6 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements
...
@@ -102,8 +103,6 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements
@Autowired
@Autowired
private
EventAnalysisReportService
eventAnalysisReportService
;
private
EventAnalysisReportService
eventAnalysisReportService
;
@Autowired
@Autowired
private
IXxlJobInfoService
iXxlJobInfoService
;
@Autowired
private
CommonService
commonService
;
private
CommonService
commonService
;
@Resource
@Resource
private
RestHighLevelClient
client
;
private
RestHighLevelClient
client
;
...
@@ -121,6 +120,10 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements
...
@@ -121,6 +120,10 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements
private
IClbModelArrangeService
clbModelArrangeService
;
private
IClbModelArrangeService
clbModelArrangeService
;
@Autowired
@Autowired
private
ClbModelArrangeSubjectMapService
clbModelArrangeSubjectMapService
;
private
ClbModelArrangeSubjectMapService
clbModelArrangeSubjectMapService
;
@Autowired
private
EventCollectMapService
eventCollMapService
;
@Autowired
private
AnalysisService
analysisService
;
@Value
(
"${kafka.topic.event.run:}"
)
@Value
(
"${kafka.topic.event.run:}"
)
private
String
EVENT_MODEL_KAFKA_CHANNEL
;
private
String
EVENT_MODEL_KAFKA_CHANNEL
;
...
@@ -141,6 +144,11 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements
...
@@ -141,6 +144,11 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements
@Override
@Override
public
EventVO
queryInfo
(
String
eventId
)
{
public
EventVO
queryInfo
(
String
eventId
)
{
EventVO
eventVO
=
baseMapper
.
queryInfo
(
eventId
);
EventVO
eventVO
=
baseMapper
.
queryInfo
(
eventId
);
UserVo
loginUser
=
UserUtil
.
getLoginUser
();
LambdaQueryWrapper
<
EventCollectMap
>
queryWrapper
=
Wrappers
.
lambdaQuery
();
queryWrapper
.
eq
(
EventCollectMap:
:
getEventId
,
eventId
).
eq
(
EventCollectMap:
:
getUserId
,
loginUser
.
getId
());
int
count
=
eventCollMapService
.
count
(
queryWrapper
);
eventVO
.
setYnAttention
(
count
>
0
);
String
relationEvents
=
eventVO
.
getRelationEvents
();
String
relationEvents
=
eventVO
.
getRelationEvents
();
if
(
null
!=
relationEvents
)
{
if
(
null
!=
relationEvents
)
{
List
<
String
>
split
=
Arrays
.
asList
(
relationEvents
.
split
(
","
));
List
<
String
>
split
=
Arrays
.
asList
(
relationEvents
.
split
(
","
));
...
@@ -153,7 +161,7 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements
...
@@ -153,7 +161,7 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements
eventVO
.
setEventTag
(
one
);
eventVO
.
setEventTag
(
one
);
List
<
RegionVO
>
regionList
=
eventRegionMapService
.
regionList
(
eventId
);
List
<
RegionVO
>
regionList
=
eventRegionMapService
.
regionList
(
eventId
);
eventVO
.
setRegionList
(
regionList
);
eventVO
.
setRegionList
(
regionList
);
//
KeywordsVO keywordsVO = keyWordsService.keywordInfoByEventId(eventId);
//
KeywordsVO keywordsVO = keyWordsService.keywordInfoByEventId(eventId);
KeywordsVO
keywordsVO
=
new
KeywordsVO
();
KeywordsVO
keywordsVO
=
new
KeywordsVO
();
List
<
KeywordsVO
>
keywordsVOS
=
keyWordsService
.
keywordInfoByEventIdList
(
eventId
);
List
<
KeywordsVO
>
keywordsVOS
=
keyWordsService
.
keywordInfoByEventIdList
(
eventId
);
keywordsVOS
.
stream
().
filter
(
f
->
StrUtil
.
equals
(
f
.
getBindingType
(),
"1"
)).
findFirst
().
ifPresent
(
f
->
keywordsVO
.
setKeyword
(
f
.
getKeyword
()));
keywordsVOS
.
stream
().
filter
(
f
->
StrUtil
.
equals
(
f
.
getBindingType
(),
"1"
)).
findFirst
().
ifPresent
(
f
->
keywordsVO
.
setKeyword
(
f
.
getKeyword
()));
...
@@ -374,10 +382,11 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements
...
@@ -374,10 +382,11 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements
Event
event
=
new
Event
();
Event
event
=
new
Event
();
BeanUtils
.
copyProperties
(
addEventParam
,
event
);
BeanUtils
.
copyProperties
(
addEventParam
,
event
);
event
.
setStatus
(
1
);
event
.
setStatus
(
1
);
event
.
setFirstOpenTime
(
new
Date
());
Date
now
=
new
Date
();
event
.
setFirstOpenTime
(
now
);
Date
endTime
=
event
.
getEndTime
();
Date
endTime
=
event
.
getEndTime
();
if
(
endTime
==
null
)
{
if
(
endTime
==
null
)
{
endTime
=
DateUtil
.
addDate
(
new
Date
(),
15
);
endTime
=
cn
.
hutool
.
core
.
date
.
DateUtil
.
offsetWeek
(
now
,
3
);
}
}
event
.
setEndTime
(
endTime
);
event
.
setEndTime
(
endTime
);
//事件专题的默认分析规则参数-必填
//事件专题的默认分析规则参数-必填
...
@@ -388,14 +397,13 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements
...
@@ -388,14 +397,13 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements
event
.
setEventCode
(
subjectCode
);
event
.
setEventCode
(
subjectCode
);
//默认发布
//默认发布
event
.
setPublishStatus
(
1
);
event
.
setPublishStatus
(
1
);
event
.
setPublishDate
(
DateUtil
.
dateToString
(
n
ew
Date
()
));
event
.
setPublishDate
(
DateUtil
.
dateToString
(
n
ow
));
event
.
setUnit
(
"2"
);
event
.
setUnit
(
"2"
);
event
.
setSpace
(
1
);
event
.
setSpace
(
1
);
String
cron
=
CronUtil
.
generateCron
(
"2"
,
1
);
String
cron
=
CronUtil
.
generateCron
(
"2"
,
1
);
event
.
setCron
(
cron
);
event
.
setCron
(
cron
);
baseMapper
.
insert
(
event
);
baseMapper
.
insert
(
event
);
String
eventId
=
event
.
getId
();
String
eventId
=
event
.
getId
();
CompletableFuture
.
runAsync
(()
->
{
CompletableFuture
.
runAsync
(()
->
{
try
{
try
{
log
.
info
(
"开始补充redis日期缓存-{}"
,
event
.
getEventCode
());
log
.
info
(
"开始补充redis日期缓存-{}"
,
event
.
getEventCode
());
...
@@ -419,6 +427,10 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements
...
@@ -419,6 +427,10 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements
throw
new
RuntimeException
(
e
);
throw
new
RuntimeException
(
e
);
}
}
});
});
CompletableFuture
.
runAsync
(()
->
{
//立马执行一次事件分析
analysisService
.
regenerate
(
eventId
);
});
return
event
;
return
event
;
}
}
...
...
src/main/java/com/zzsn/event/task/AnalysisTask.java
浏览文件 @
bf99fd94
差异被折叠。
点击展开。
src/main/java/com/zzsn/event/vo/EventVO.java
浏览文件 @
bf99fd94
...
@@ -79,4 +79,7 @@ public class EventVO {
...
@@ -79,4 +79,7 @@ public class EventVO {
/**关键词*/
/**关键词*/
private
KeywordsVO
keywordsVO
;
private
KeywordsVO
keywordsVO
;
private
String
dataScope
;
private
String
dataScope
;
/**是否关注*/
private
Boolean
ynAttention
;
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论