Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
E
event
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
陈世强
event
Commits
cd86a093
提交
cd86a093
authored
5月 08, 2024
作者:
925993793@qq.com
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加专题库资讯详情接口
上级
30051a6e
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
62 行增加
和
11 行删除
+62
-11
PlatEventManageController.java
...zzsn/event/controller/plat/PlatEventManageController.java
+61
-10
EsOpUtil.java
src/main/java/com/zzsn/event/util/EsOpUtil.java
+1
-1
没有找到文件。
src/main/java/com/zzsn/event/controller/plat/PlatEventManageController.java
浏览文件 @
cd86a093
package
com
.
zzsn
.
event
.
controller
.
plat
;
package
com
.
zzsn
.
event
.
controller
.
plat
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
cn.hutool.core.bean.BeanUtil
;
import
com.alibaba.fastjson2.JSON
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.zzsn.event.constant.Constants
;
import
com.zzsn.event.constant.Constants
;
import
com.zzsn.event.constant.Result
;
import
com.zzsn.event.constant.Result
;
import
com.zzsn.event.entity.SubjectInfoSourceMap
;
import
com.zzsn.event.es.EsService
;
import
com.zzsn.event.es.EsService
;
import
com.zzsn.event.service.IEventService
;
import
com.zzsn.event.service.IEventService
;
import
com.zzsn.event.service.IInfoSourceService
;
import
com.zzsn.event.service.IInfoSourceService
;
import
com.zzsn.event.service.ISubjectInfoSourceMapService
;
import
com.zzsn.event.service.ISubjectTypeService
;
import
com.zzsn.event.service.ISubjectTypeService
;
import
com.zzsn.event.util.DateUtil
;
import
com.zzsn.event.util.*
;
import
com.zzsn.event.util.ExcelExportUtil
;
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
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
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.apache.poi.xssf.usermodel.XSSFWorkbook
;
import
org.apache.poi.xssf.usermodel.XSSFWorkbook
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -52,9 +49,9 @@ public class PlatEventManageController {
...
@@ -52,9 +49,9 @@ public class PlatEventManageController {
@Autowired
@Autowired
private
IInfoSourceService
infoSourceService
;
private
IInfoSourceService
infoSourceService
;
@Autowired
@Autowired
private
ISubjectInfoSourceMapService
subjectInfoSourceMapService
;
@Autowired
private
EsService
esService
;
private
EsService
esService
;
@Autowired
private
EsOpUtil
esOpUtil
;
/**
/**
* 事件页左侧树
* 事件页左侧树
...
@@ -245,7 +242,7 @@ public class PlatEventManageController {
...
@@ -245,7 +242,7 @@ public class PlatEventManageController {
*/
*/
@GetMapping
(
"/removeUnBindInfoSource"
)
@GetMapping
(
"/removeUnBindInfoSource"
)
public
Result
<?>
removeUnBindInfoSource
(
@RequestParam
String
subjectId
,
@RequestParam
String
sourceId
)
{
public
Result
<?>
removeUnBindInfoSource
(
@RequestParam
String
subjectId
,
@RequestParam
String
sourceId
)
{
eventService
.
removeUnBindInfoSource
(
subjectId
,
sourceId
);
eventService
.
removeUnBindInfoSource
(
subjectId
,
sourceId
);
return
Result
.
OK
();
return
Result
.
OK
();
}
}
...
@@ -411,6 +408,60 @@ public class PlatEventManageController {
...
@@ -411,6 +408,60 @@ public class PlatEventManageController {
}
}
/**
* 通过id查询(采集库)
*
* @param id 资讯id
* @param index 索引名称
* @author lkg
* @date 2024/5/8
*/
@GetMapping
(
value
=
"/collectionQueryById"
)
public
Result
<?>
collectionQueryById
(
@RequestParam
String
id
,
@RequestParam
String
index
)
{
DisplayInfo
info
=
(
DisplayInfo
)
esOpUtil
.
getInfoById
(
index
,
id
,
DisplayInfo
.
class
);
if
(
StringUtils
.
isNotEmpty
(
info
.
getContentWithTag
()))
{
String
contentNoTag
=
Utility
.
TransferHTML2TextWithImg
(
info
.
getContentWithTag
());
String
contentNoTag2
=
Utility
.
dealImg
(
contentNoTag
);
info
.
setContent
(
contentNoTag2
);
info
.
setContentWithTag
(
null
);
}
info
.
setPublishDate
(
EsDateUtil
.
esFieldDateMapping
(
info
.
getPublishDate
()));
return
Result
.
OK
(
info
);
}
/**
* 通过id查询(专题库)
*
* @param id 资讯id
* @param index 索引名称
* @author lkg
* @date 2024/5/8
*/
@GetMapping
(
value
=
"/queryById"
)
public
Result
<?>
queryById
(
@RequestParam
String
id
,
@RequestParam
String
index
)
{
DisplayInfo
displayInfo
=
(
DisplayInfo
)
esOpUtil
.
getInfoById
(
index
,
id
,
DisplayInfo
.
class
);
addReadNum
(
displayInfo
,
index
);
if
(
StringUtils
.
isNotEmpty
(
displayInfo
.
getContentWithTag
()))
{
String
contentNoTag
=
Utility
.
TransferHTML2TextWithImg
(
displayInfo
.
getContentWithTag
());
String
contentNoTag2
=
Utility
.
dealImg
(
contentNoTag
);
displayInfo
.
setContent
(
contentNoTag2
);
}
displayInfo
.
setPublishDate
(
EsDateUtil
.
esFieldDateMapping
(
displayInfo
.
getPublishDate
()));
return
Result
.
OK
(
displayInfo
);
}
private
void
addReadNum
(
DisplayInfo
displayInfo
,
String
index
){
if
(
displayInfo
!=
null
)
{
if
(
displayInfo
.
getReadNum
()
==
0
)
{
displayInfo
.
setReadNum
(
1L
);
}
else
{
displayInfo
.
setReadNum
(
displayInfo
.
getReadNum
()
+
1
);
}
esOpUtil
.
docUpdateById
(
index
,
displayInfo
.
getId
(),
JSON
.
toJSONString
(
displayInfo
));
}
}
private
void
setResponseHeader
(
HttpServletResponse
response
,
String
name
)
{
private
void
setResponseHeader
(
HttpServletResponse
response
,
String
name
)
{
try
{
try
{
try
{
try
{
...
...
src/main/java/com/zzsn/event/util/EsOpUtil.java
浏览文件 @
cd86a093
...
@@ -763,7 +763,7 @@ public class EsOpUtil<T> {
...
@@ -763,7 +763,7 @@ public class EsOpUtil<T> {
/**
/**
* 根据id查询各类资讯详情
* 根据id查询各类资讯详情
* */
* */
public
T
getInfoBy
i
d
(
String
index
,
String
id
,
Class
<
T
>
entry
){
public
T
getInfoBy
I
d
(
String
index
,
String
id
,
Class
<
T
>
entry
){
try
{
try
{
SearchRequest
searchRequest
=
new
SearchRequest
(
index
);
SearchRequest
searchRequest
=
new
SearchRequest
(
index
);
SearchSourceBuilder
searchSourceBuilder
=
new
SearchSourceBuilder
();
SearchSourceBuilder
searchSourceBuilder
=
new
SearchSourceBuilder
();
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论