Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
E
event
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
陈世强
event
Commits
7775a8ba
提交
7775a8ba
authored
9月 16, 2025
作者:
刘凯歌
浏览文件
操作
浏览文件
下载
差异文件
合并分支 'event_fusion_dev' 到 'event_fusion'
事件分析优化以及bug修改 查看合并请求
!15
上级
64a6b75a
260fe6ce
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
25 行增加
和
67 行删除
+25
-67
EventAnalysisController.java
...va/com/zzsn/event/controller/EventAnalysisController.java
+22
-63
EventManageController.java
...java/com/zzsn/event/controller/EventManageController.java
+1
-1
NetWorkEventTask.java
src/main/java/com/zzsn/event/task/NetWorkEventTask.java
+2
-3
没有找到文件。
src/main/java/com/zzsn/event/controller/EventAnalysisController.java
浏览文件 @
7775a8ba
...
...
@@ -7,10 +7,10 @@ import cn.hutool.core.date.DateUtil;
import
com.alibaba.fastjson2.JSON
;
import
com.alibaba.fastjson2.JSONArray
;
import
com.alibaba.fastjson2.JSONObject
;
import
com.aspose.words.SaveFormat
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.obs.services.model.PutObjectResult
;
import
com.zzsn.event.constant.Constants
;
import
com.zzsn.event.constant.Result
;
import
com.zzsn.event.entity.*
;
...
...
@@ -19,30 +19,28 @@ import com.zzsn.event.es.EsService;
import
com.zzsn.event.service.*
;
import
com.zzsn.event.util.CalculateUtil
;
import
com.zzsn.event.util.DocUtil
;
import
com.zzsn.event.util.ObsUtil
;
import
com.zzsn.event.util.RedisUtil
;
import
com.zzsn.event.util.user.UserUtil
;
import
com.zzsn.event.util.user.UserVo
;
import
com.zzsn.event.vo.CoOccurrenceVO
;
import
com.zzsn.event.vo.CountVO
;
import
com.zzsn.event.vo.EventViewVO
;
import
com.zzsn.event.vo.es.Doc
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.MediaType
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.servlet.ServletInputStream
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.*
;
import
java.math.RoundingMode
;
import
java.util.*
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.concurrent.CompletableFuture
;
import
java.util.concurrent.atomic.AtomicLong
;
import
java.util.stream.Collectors
;
...
...
@@ -82,8 +80,6 @@ public class EventAnalysisController {
private
CommonService
commonService
;
@Autowired
private
IEventService
eventService
;
@Autowired
private
ObsUtil
obsUtil
;
/**
...
...
@@ -706,6 +702,7 @@ public class EventAnalysisController {
* @author lkg
* @date 2024/4/12
*/
@Deprecated
@GetMapping
(
"/domesticSimilarEvent"
)
public
Result
<?>
domesticSimilarEvent
(
@RequestParam
String
eventId
,
@RequestParam
(
required
=
false
)
String
startTime
,
...
...
@@ -737,6 +734,7 @@ public class EventAnalysisController {
* @author lkg
* @date 2024/4/12
*/
@Deprecated
@GetMapping
(
"/foreignSimilarEvent"
)
public
Result
<?>
foreignSimilarEvent
(
@RequestParam
String
eventId
,
@RequestParam
(
required
=
false
)
String
startTime
,
...
...
@@ -792,67 +790,21 @@ public class EventAnalysisController {
/**
* 导出
PDF
* 导出
pdf
*
* @param request
* @param response
* @param file 文件
* @author lkg
* @date 2025/8/1
9
* @date 2025/8/1
5
*/
@PostMapping
(
value
=
"/exportPDF"
,
consumes
=
MediaType
.
APPLICATION_OCTET_STREAM_VALUE
)
public
void
exportPdf
(
HttpServletRequest
request
,
HttpServletResponse
response
)
{
try
{
InputStream
inputStream
=
request
.
getInputStream
();
String
content
=
DocUtil
.
convertDocStream2Html
(
inputStream
);
byte
[]
pdfBytes
=
DocUtil
.
convertDocHtml2Pdf
(
content
);
BufferedInputStream
bis
=
null
;
BufferedOutputStream
bos
=
null
;
ByteArrayInputStream
byteInputStream
=
new
ByteArrayInputStream
(
pdfBytes
);
try
{
OutputStream
outs
=
response
.
getOutputStream
();
bos
=
new
BufferedOutputStream
(
outs
);
bis
=
new
BufferedInputStream
(
byteInputStream
);
int
i
;
while
((
i
=
bis
.
read
(
pdfBytes
))
!=
-
1
)
{
bos
.
write
(
pdfBytes
,
0
,
i
);
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
finally
{
try
{
if
(
bos
!=
null
)
{
bos
.
flush
();
bos
.
close
();
}
if
(
bis
!=
null
)
{
bis
.
close
();
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
@PostMapping
(
value
=
"/new_exportPDF"
)
@PostMapping
(
value
=
"/exportPDF"
)
public
void
new_exportPdf
(
MultipartFile
file
,
HttpServletResponse
response
)
{
try
{
InputStream
inputStream
=
file
.
getInputStream
();
String
content
=
DocUtil
.
convertDocStream2Html
(
inputStream
);
byte
[]
pdfBytes
=
DocUtil
.
convertDocHtml2Pdf
(
content
);
BufferedInputStream
bis
=
null
;
BufferedOutputStream
bos
=
null
;
ByteArrayInputStream
byteInputStream
=
new
ByteArrayInputStream
(
pdfBytes
);
try
{
OutputStream
outs
=
response
.
getOutputStream
();
bos
=
new
BufferedOutputStream
(
outs
);
bis
=
new
BufferedInputStream
(
byteInputStream
);
int
i
;
while
((
i
=
bis
.
read
(
pdfBytes
))
!=
-
1
)
{
bos
.
write
(
pdfBytes
,
0
,
i
);
}
DocUtil
.
convertWordTo
(
inputStream
,
bos
,
SaveFormat
.
PDF
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
finally
{
...
...
@@ -861,9 +813,6 @@ public class EventAnalysisController {
bos
.
flush
();
bos
.
close
();
}
if
(
bis
!=
null
)
{
bis
.
close
();
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
...
...
@@ -887,6 +836,16 @@ public class EventAnalysisController {
if
(
StringUtils
.
isEmpty
(
versionId
))
{
return
Result
.
FAIL
(
"请选择要导出的版本"
);
}
EventAnalysisVersion
eventAnalysisVersion
=
eventAnalysisVersionService
.
getById
(
versionId
);
String
pptPath
=
eventAnalysisVersion
.
getPptPath
();
if
(
StringUtils
.
isNotEmpty
(
pptPath
))
{
JSONObject
jsonObject
=
JSON
.
parseObject
(
pptPath
);
Integer
code
=
jsonObject
.
getInteger
(
"code"
);
if
(
code
==
500
)
{
eventAnalysisVersionService
.
update
(
Wrappers
.<
EventAnalysisVersion
>
lambdaUpdate
().
set
(
EventAnalysisVersion:
:
getPptPath
,
null
)
.
eq
(
EventAnalysisVersion:
:
getId
,
versionId
));
}
}
CompletableFuture
.
runAsync
(()
->
{
String
eventId
=
params
.
getString
(
"eventId"
);
JSONArray
content
=
params
.
getJSONArray
(
"content"
);
...
...
src/main/java/com/zzsn/event/controller/EventManageController.java
浏览文件 @
7775a8ba
...
...
@@ -145,7 +145,7 @@ public class EventManageController {
public
Result
<?>
queryById
(
@RequestParam
String
eventId
,
@RequestParam
(
required
=
false
)
String
versionId
)
{
EventVO
eventVO
=
eventService
.
queryInfo
(
eventId
);
if
(
StringUtils
.
isNotEmpty
(
versionId
))
{
if
(
StringUtils
.
isNotEmpty
(
versionId
)
&&
eventVO
.
getYnManualEdit
()
==
0
)
{
String
versionData
=
eventAnalysisVersionRecordService
.
getVersionData
(
versionId
,
AnalysisColumnEnum
.
CORE_SUMMARY
.
getCode
());
eventVO
.
setEventDescribe
(
versionData
);
}
...
...
src/main/java/com/zzsn/event/task/NetWorkEventTask.java
浏览文件 @
7775a8ba
...
...
@@ -37,8 +37,6 @@ public class NetWorkEventTask {
@Autowired
private
LlmService
llmService
;
@Value
(
"${scheduling.yjzxEnable:false}"
)
Boolean
yjzxEnable
;
@Value
(
"${python.hot-crawler:}"
)
private
String
hotCrawlerPath
;
...
...
@@ -48,7 +46,8 @@ public class NetWorkEventTask {
"2. 按照指定格式返回符合经济领域条件的网络事件集合,且无需额外解释。\n"
+
"3. 必须严格依据事件标题-【title】字段进行判断。\n"
+
"4. 禁止返回不符合经济领域条件的事件。\n"
+
"5. 严格按照以下json格式返回数据:\n"
+
"5. 最少返回10条。\n"
+
"6. 严格按照以下json格式返回数据:\n"
+
"[\n"
+
" {\n"
+
" \"title\": \"经济\"\n"
+
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论