Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
E
event
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
陈世强
event
Commits
af2be853
提交
af2be853
authored
1月 06, 2025
作者:
925993793@qq.com
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
自定义专题-逻辑调整
上级
07e846b3
隐藏空白字符变更
内嵌
并排
正在显示
13 个修改的文件
包含
144 行增加
和
85 行删除
+144
-85
FileController.java
src/main/java/com/zzsn/event/controller/FileController.java
+4
-4
SubjectManageController.java
...va/com/zzsn/event/controller/SubjectManageController.java
+52
-37
InformationController.java
...m/zzsn/event/controller/common/InformationController.java
+2
-3
RelationBindController.java
.../zzsn/event/controller/common/RelationBindController.java
+1
-1
StatisticalAnalysisController.java
...vent/controller/common/StatisticalAnalysisController.java
+5
-5
EsService.java
src/main/java/com/zzsn/event/es/EsService.java
+13
-13
InfoSourceMapper.java
src/main/java/com/zzsn/event/mapper/InfoSourceMapper.java
+18
-6
InfoSourceMapper.xml
src/main/java/com/zzsn/event/mapper/xml/InfoSourceMapper.xml
+21
-3
IInfoSourceService.java
src/main/java/com/zzsn/event/service/IInfoSourceService.java
+15
-3
InformationService.java
src/main/java/com/zzsn/event/service/InformationService.java
+2
-3
InfoSourceServiceImpl.java
...va/com/zzsn/event/service/impl/InfoSourceServiceImpl.java
+7
-1
InformationServiceImpl.java
...a/com/zzsn/event/service/impl/InformationServiceImpl.java
+3
-5
InfoDataSearchCondition.java
src/main/java/com/zzsn/event/vo/InfoDataSearchCondition.java
+1
-1
没有找到文件。
src/main/java/com/zzsn/event/controller/FileController.java
浏览文件 @
af2be853
...
...
@@ -16,7 +16,7 @@ import com.zzsn.event.service.*;
import
com.zzsn.event.util.*
;
import
com.zzsn.event.util.user.AuthUtil
;
import
com.zzsn.event.util.user.UserVo
;
import
com.zzsn.event.vo.
EventData
Condition
;
import
com.zzsn.event.vo.
InfoDataSearch
Condition
;
import
com.zzsn.event.vo.LabelModelVo
;
import
com.zzsn.event.vo.es.AttachmentInfo
;
import
com.zzsn.event.vo.es.Label
;
...
...
@@ -197,7 +197,7 @@ public class FileController {
* @date 2024/12/25
*/
@PostMapping
(
"/exportXls"
)
public
void
exportXls
(
@RequestBody
EventData
Condition
searchCondition
,
HttpServletResponse
response
)
{
public
void
exportXls
(
@RequestBody
InfoDataSearch
Condition
searchCondition
,
HttpServletResponse
response
)
{
int
count
=
esService
.
getCount
(
searchCondition
);
if
(
count
>
0
)
{
String
subjectId
=
searchCondition
.
getSubjectId
();
...
...
@@ -270,7 +270,7 @@ public class FileController {
* @date 2024/12/25
*/
@PostMapping
(
"/exportDoc"
)
public
void
exportDoc
(
@RequestBody
EventData
Condition
searchCondition
,
HttpServletResponse
response
)
{
public
void
exportDoc
(
@RequestBody
InfoDataSearch
Condition
searchCondition
,
HttpServletResponse
response
)
{
OutputStream
outputstream
=
null
;
ByteArrayOutputStream
bos
=
null
;
try
{
...
...
@@ -321,7 +321,7 @@ public class FileController {
}
private
byte
[]
getBytes
(
EventData
Condition
searchCondition
,
Integer
pageSize
)
{
private
byte
[]
getBytes
(
InfoDataSearch
Condition
searchCondition
,
Integer
pageSize
)
{
String
[]
fetchFields
=
new
String
[]{
"score"
,
"title"
,
"titleRaw"
,
"summary"
,
"summaryRaw"
,
"content"
,
"contentRaw"
,
"author"
,
"origin"
,
"publishDate"
,
"sourceAddress"
,
"classificationType"
,
"hitWords"
,
"labels"
};
searchCondition
.
setFetchFields
(
fetchFields
);
searchCondition
.
setPageSize
(
pageSize
);
...
...
src/main/java/com/zzsn/event/controller/SubjectManageController.java
浏览文件 @
af2be853
package
com
.
zzsn
.
event
.
controller
;
import
cn.hutool.core.io.FileUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.json.JSONUtil
;
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.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.Assert
;
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.*
;
import
com.zzsn.event.es.EsService
;
...
...
@@ -22,7 +16,6 @@ import com.zzsn.event.util.*;
import
com.zzsn.event.util.user.AuthUtil
;
import
com.zzsn.event.util.user.UserVo
;
import
com.zzsn.event.vo.*
;
import
com.zzsn.event.vo.es.DisplayInfo
;
import
com.zzsn.event.vo.es.SpecialInformation
;
import
com.zzsn.event.xxljob.entity.XxlJobInfo
;
import
com.zzsn.event.xxljob.service.IXxlJobInfoService
;
...
...
@@ -31,13 +24,6 @@ import org.apache.commons.collections4.CollectionUtils;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.poi.xwpf.usermodel.XWPFDocument
;
import
org.apache.poi.xwpf.usermodel.XWPFParagraph
;
import
org.elasticsearch.action.search.SearchRequest
;
import
org.elasticsearch.action.search.SearchResponse
;
import
org.elasticsearch.client.RequestOptions
;
import
org.elasticsearch.index.query.BoolQueryBuilder
;
import
org.elasticsearch.search.SearchHit
;
import
org.elasticsearch.search.builder.SearchSourceBuilder
;
import
org.jsoup.Jsoup
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
...
...
@@ -53,7 +39,6 @@ import java.time.format.DateTimeFormatter;
import
java.time.temporal.ChronoUnit
;
import
java.util.*
;
import
java.util.concurrent.CompletableFuture
;
import
java.util.stream.Collectors
;
/**
* 平台事件管理页
...
...
@@ -610,20 +595,33 @@ public class SubjectManageController {
*/
@PostMapping
(
"/bindInfoSourceLabel"
)
public
Result
<?>
bindInfoSourceLabel
(
@RequestBody
SubjectSourceTagVO
subjectSourceTagVO
)
{
if
(
StringUtils
.
isNotEmpty
(
subjectSourceTagVO
.
getSubjectId
()))
{
String
subjectId
=
subjectSourceTagVO
.
getSubjectId
();
if
(
StringUtils
.
isNotEmpty
(
subjectId
))
{
return
Result
.
FAIL
(
"专题id不能为空"
);
}
if
(
CollectionUtils
.
isEmpty
(
subjectSourceTagVO
.
getLabelCodes
())
&&
CollectionUtils
.
isEmpty
(
subjectSourceTagVO
.
getLabelItemCodes
()))
{
List
<
String
>
labelCodes
=
subjectSourceTagVO
.
getLabelCodes
();
List
<
String
>
labelItemCodes
=
subjectSourceTagVO
.
getLabelItemCodes
();
if
(
CollectionUtils
.
isEmpty
(
labelCodes
)
&&
CollectionUtils
.
isEmpty
(
labelItemCodes
))
{
return
Result
.
FAIL
(
"参数不全"
);
}
String
subjectId
=
subjectSourceTagVO
.
getSubjectId
();
List
<
String
>
sourceIds
=
CollectionUtils
.
isNotEmpty
(
subjectSourceTagVO
.
getLabelCodes
())
?
subjectSourceTagVO
.
getLabelCodes
()
:
subjectSourceTagVO
.
getLabelItemCodes
();
List
<
SubjectInfoSourceMap
>
dataList
=
new
ArrayList
<>();
for
(
String
sourceId
:
sourceIds
)
{
SubjectInfoSourceMap
subjectInfoSourceMap
=
new
SubjectInfoSourceMap
();
subjectInfoSourceMap
.
setSubjectId
(
subjectId
);
subjectInfoSourceMap
.
setSourceId
(
sourceId
);
dataList
.
add
(
subjectInfoSourceMap
);
if
(
CollectionUtils
.
isNotEmpty
(
labelCodes
))
{
for
(
String
labelCode
:
labelCodes
)
{
SubjectInfoSourceMap
subjectInfoSourceMap
=
new
SubjectInfoSourceMap
();
subjectInfoSourceMap
.
setSubjectId
(
subjectId
);
subjectInfoSourceMap
.
setSourceId
(
labelCode
);
subjectInfoSourceMap
.
setType
(
6
);
dataList
.
add
(
subjectInfoSourceMap
);
}
}
if
(
CollectionUtils
.
isNotEmpty
(
labelItemCodes
))
{
for
(
String
labelItemCode
:
labelItemCodes
)
{
SubjectInfoSourceMap
subjectInfoSourceMap
=
new
SubjectInfoSourceMap
();
subjectInfoSourceMap
.
setSubjectId
(
subjectId
);
subjectInfoSourceMap
.
setSourceId
(
labelItemCode
);
subjectInfoSourceMap
.
setType
(
7
);
dataList
.
add
(
subjectInfoSourceMap
);
}
}
subjectInfoSourceMapService
.
saveBatch
(
dataList
);
return
Result
.
OK
();
...
...
@@ -631,7 +629,24 @@ public class SubjectManageController {
/**
* 信息源分页列表(专题绑定定向信息源时使用)
* 专题绑定的定向信息源分页列表(专题绑定定向信息源时使用-研究中心)
*
* @param subjectId 专题id
* @param pageNo 当前页
* @param pageSize 返回条数
* @author lkg
* @date 2025/1/4
*/
@GetMapping
(
"/subjectBindDirectSourcePageList"
)
public
Result
<?>
subjectBindDirectSourcePageList
(
@RequestParam
String
subjectId
,
@RequestParam
(
defaultValue
=
"1"
)
Integer
pageNo
,
@RequestParam
(
defaultValue
=
"10"
)
Integer
pageSize
)
{
IPage
<
Map
<
String
,
Object
>>
page
=
infoSourceService
.
subjectBindDirectSourcePageList
(
subjectId
,
pageNo
,
pageSize
);
return
Result
.
OK
(
page
);
}
/**
* 信息源分页列表(专题绑定定向信息源时使用-研究中心)
*
* @param searchWord 搜索词
* @param pageNo 当前页
...
...
@@ -648,7 +663,7 @@ public class SubjectManageController {
}
/**
* 信息源下栏目分页列表(专题绑定定向信息源时使用)
* 信息源下栏目分页列表(专题绑定定向信息源时使用
-研究中心
)
*
* @param webSiteName 信息源名称
* @param pageNo 当前页
...
...
@@ -665,7 +680,7 @@ public class SubjectManageController {
}
/**
* 添加定向信息源(专题绑定定向信息源时使用)
* 添加定向信息源(专题绑定定向信息源时使用
-研究中心
)
*
* @param subjectSourceVO 参数
* @author lkg
...
...
@@ -690,7 +705,7 @@ public class SubjectManageController {
/**
* 新增信息源
* 新增信息源
-研究中心
*
* @param subjectInfoSourceMiddleMap 参数
* @author lkg
...
...
@@ -716,7 +731,7 @@ public class SubjectManageController {
}
/**
* 信息源导入模板下载
* 信息源导入模板下载
-研究中心
*
* @author lkg
* @date 2024/06/21
...
...
@@ -728,9 +743,9 @@ public class SubjectManageController {
}
/**
* 导入信息源
* 导入信息源
-研究中心
*
* @param file excel文件
* @param file
excel文件
* @param subjectId 专题id
* @author lkg
* @date 2025/1/4
...
...
@@ -800,14 +815,14 @@ public class SubjectManageController {
String
replace
=
siteUri
.
replace
(
"https://"
,
""
).
replace
(
"http://"
,
""
);
if
(
replace
.
equalsIgnoreCase
(
domain
)
||
replace
.
equalsIgnoreCase
(
domain
+
"/"
))
{
List
<
InfoSource
>
infoSources
=
matchInfoSourceByUri
(
domain
,
2
);
supplyData
(
subjectId
,
webSiteName
,
siteUri
,
mapDataSet
,
configDataSet
,
infoSources
);
supplyData
(
subjectId
,
webSiteName
,
siteUri
,
mapDataSet
,
configDataSet
,
infoSources
);
}
else
{
List
<
InfoSource
>
infoSources
=
matchInfoSourceByUri
(
siteUri
,
1
);
supplyData
(
subjectId
,
webSiteName
,
siteUri
,
mapDataSet
,
configDataSet
,
infoSources
);
supplyData
(
subjectId
,
webSiteName
,
siteUri
,
mapDataSet
,
configDataSet
,
infoSources
);
}
}
else
{
List
<
InfoSource
>
infoSources
=
matchInfoSourceByUri
(
siteUri
,
1
);
supplyData
(
subjectId
,
webSiteName
,
siteUri
,
mapDataSet
,
configDataSet
,
infoSources
);
supplyData
(
subjectId
,
webSiteName
,
siteUri
,
mapDataSet
,
configDataSet
,
infoSources
);
}
}
...
...
@@ -849,7 +864,7 @@ public class SubjectManageController {
* @date 2024/12/26
*/
@PostMapping
(
"/recommendSourceList"
)
public
Result
<?>
recommendSourceList
(
@RequestBody
EventData
Condition
searchCondition
)
{
public
Result
<?>
recommendSourceList
(
@RequestBody
InfoDataSearch
Condition
searchCondition
)
{
List
<
InfoSource
>
infoSources
=
new
ArrayList
<>();
String
[]
fetchFields
=
new
String
[]{
"id"
,
"sid"
};
searchCondition
.
setFetchFields
(
fetchFields
);
...
...
@@ -972,7 +987,7 @@ public class SubjectManageController {
private
List
<
StatisticsKeyWordVo
>
extractWords
(
String
words
)
{
List
<
StatisticsKeyWordVo
>
wordList
=
new
ArrayList
<>();
String
[]
fetchFields
=
new
String
[]{
"title"
,
"content"
};
EventDataCondition
searchCondition
=
new
EventData
Condition
();
InfoDataSearchCondition
searchCondition
=
new
InfoDataSearch
Condition
();
searchCondition
.
setFetchFields
(
fetchFields
);
List
<
SearchWordVO
>
searchWordList
=
new
ArrayList
<>();
SearchWordVO
searchWord
=
new
SearchWordVO
();
...
...
@@ -983,7 +998,7 @@ public class SubjectManageController {
searchWordList
.
add
(
searchWord
);
searchCondition
.
setSearchWordList
(
searchWordList
);
try
{
IPage
<
SpecialInformation
>
page
=
esService
.
pageListByCondtion
(
searchCondition
,
null
);
IPage
<
SpecialInformation
>
page
=
esService
.
pageListByCond
i
tion
(
searchCondition
,
null
);
if
(
page
.
getTotal
()
>
0
)
{
StringBuilder
text
=
new
StringBuilder
();
List
<
SpecialInformation
>
records
=
page
.
getRecords
();
...
...
src/main/java/com/zzsn/event/controller/common/InformationController.java
浏览文件 @
af2be853
...
...
@@ -22,7 +22,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
...
...
@@ -63,7 +62,7 @@ public class InformationController {
* @date 2024/5/6
*/
@PostMapping
(
"/collectPageList"
)
public
Result
<?>
collectPageList
(
@RequestBody
EventData
Condition
eventDataCondition
)
{
public
Result
<?>
collectPageList
(
@RequestBody
InfoDataSearch
Condition
eventDataCondition
)
{
IPage
<
EventDataVO
>
pageList
=
informationService
.
collectPageList
(
eventDataCondition
);
return
Result
.
OK
(
pageList
);
}
...
...
@@ -198,7 +197,7 @@ public class InformationController {
* @date 2024/5/6
*/
@PostMapping
(
"/subjectPageList"
)
public
Result
<?>
subjectPageList
(
@RequestBody
EventData
Condition
subjectInfoVo
)
{
public
Result
<?>
subjectPageList
(
@RequestBody
InfoDataSearch
Condition
subjectInfoVo
)
{
UserVo
userVo
=
AuthUtil
.
getLoginUser
();
IPage
<
DisplayInfo
>
pageList
=
informationService
.
subjectPageList
(
userVo
,
subjectInfoVo
);
return
Result
.
OK
(
pageList
);
...
...
src/main/java/com/zzsn/event/controller/common/RelationBindController.java
浏览文件 @
af2be853
...
...
@@ -167,7 +167,7 @@ public class RelationBindController {
* @author lkg
* @date 2024/12/18
*/
@GetMapping
(
value
=
"/bindInfoSourceGroup"
)
@GetMapping
(
value
=
"/bindInfoSourceGroup
List
"
)
public
Result
<?>
bindInfoSource
(
@RequestParam
(
name
=
"subjectId"
)
String
subjectId
)
{
JSONObject
infoSourceGroupPages
=
subjectInfoSourceMapService
.
bindInfoSource
(
subjectId
);
return
Result
.
OK
(
infoSourceGroupPages
);
...
...
src/main/java/com/zzsn/event/controller/common/StatisticalAnalysisController.java
浏览文件 @
af2be853
...
...
@@ -53,7 +53,7 @@ public class StatisticalAnalysisController {
* @date 2024/12/26
*/
@GetMapping
(
"overview"
)
public
Result
<
OverviewAnalysisVO
>
overviewAnalysis
(
@RequestBody
EventData
Condition
searchCondition
)
{
public
Result
<
OverviewAnalysisVO
>
overviewAnalysis
(
@RequestBody
InfoDataSearch
Condition
searchCondition
)
{
OverviewAnalysisVO
overviewAnalysisVO
=
new
OverviewAnalysisVO
();
Subject
subject
=
subjectService
.
getById
(
searchCondition
.
getSubjectId
());
overviewAnalysisVO
.
setSubjectName
(
subject
.
getSubjectName
());
...
...
@@ -98,7 +98,7 @@ public class StatisticalAnalysisController {
* @date 2024/12/25
*/
@PostMapping
(
"/dataTrend"
)
public
Result
<
List
<
CountVO
>>
dataTrend
(
@RequestBody
EventData
Condition
searchCondition
)
{
public
Result
<
List
<
CountVO
>>
dataTrend
(
@RequestBody
InfoDataSearch
Condition
searchCondition
)
{
List
<
CountVO
>
dataList
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isEmpty
(
searchCondition
.
getIds
())
&&
searchCondition
.
getNum
()
==
null
)
{
dataList
=
esService
.
groupByDate
(
searchCondition
);
...
...
@@ -140,7 +140,7 @@ public class StatisticalAnalysisController {
* @date 2024/12/26
*/
@PostMapping
(
"/dataType/distribution"
)
public
Result
<?>
dataTypeDistribution
(
@RequestBody
EventData
Condition
searchCondition
)
{
public
Result
<?>
dataTypeDistribution
(
@RequestBody
InfoDataSearch
Condition
searchCondition
)
{
List
<
CountVO
>
dataList
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isEmpty
(
searchCondition
.
getIds
())
&&
searchCondition
.
getNum
()
==
null
)
{
dataList
=
esService
.
groupByClassificationType
(
searchCondition
);
...
...
@@ -168,7 +168,7 @@ public class StatisticalAnalysisController {
* @date 2024/12/26
*/
@PostMapping
(
"/dataSource"
)
public
Result
<?>
dataSource
(
@RequestBody
EventData
Condition
searchCondition
)
{
public
Result
<?>
dataSource
(
@RequestBody
InfoDataSearch
Condition
searchCondition
)
{
List
<
CountVO
>
dataList
=
new
ArrayList
<>();
List
<
Label
>
bindLabelList
=
bindLabelList
(
searchCondition
.
getSubjectId
());
if
(
CollectionUtils
.
isEmpty
(
searchCondition
.
getIds
())
&&
searchCondition
.
getNum
()
==
null
)
{
...
...
@@ -200,7 +200,7 @@ public class StatisticalAnalysisController {
* @date 2024/12/26
*/
@PostMapping
(
"/infoSource/dataCount/top"
)
public
Result
<?>
infoSourceDataCountTop
(
@RequestBody
EventData
Condition
searchCondition
)
{
public
Result
<?>
infoSourceDataCountTop
(
@RequestBody
InfoDataSearch
Condition
searchCondition
)
{
List
<
CountVO
>
dataList
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isEmpty
(
searchCondition
.
getIds
())
&&
searchCondition
.
getNum
()
==
null
)
{
dataList
=
esService
.
groupBySourceId
(
searchCondition
);
...
...
src/main/java/com/zzsn/event/es/EsService.java
浏览文件 @
af2be853
...
...
@@ -592,7 +592,7 @@ public class EsService {
* @author lkg
* @date 2024/5/6
*/
public
IPage
<
EventDataVO
>
collectPageList
(
EventData
Condition
eventDataCondition
)
{
public
IPage
<
EventDataVO
>
collectPageList
(
InfoDataSearch
Condition
eventDataCondition
)
{
SearchRequest
searchRequest
=
new
SearchRequest
(
Constants
.
COLLECT_INDEX
);
SearchSourceBuilder
searchSourceBuilder
=
new
SearchSourceBuilder
();
//设置分页参数
...
...
@@ -713,7 +713,7 @@ public class EsService {
* @author lkg
* @date 2024/5/6
*/
public
IPage
<
SpecialInformation
>
pageListByCond
tion
(
EventDataCondition
searchCondition
,
List
<
String
>
subjectIdList
)
throws
IOException
{
public
IPage
<
SpecialInformation
>
pageListByCond
ition
(
InfoDataSearchCondition
searchCondition
,
List
<
String
>
subjectIdList
)
throws
IOException
{
SearchRequest
searchRequest
=
new
SearchRequest
(
Constants
.
SUBJECT_INDEX
);
SearchSourceBuilder
searchSourceBuilder
=
new
SearchSourceBuilder
();
//设置分页参数
...
...
@@ -1065,7 +1065,7 @@ public class EsService {
* @author lkg
* @date 2024/7/8
*/
public
int
getCount
(
EventData
Condition
searchCondition
)
{
public
int
getCount
(
InfoDataSearch
Condition
searchCondition
)
{
int
count
=
0
;
List
<
String
>
ids
=
searchCondition
.
getIds
();
if
(
CollectionUtils
.
isNotEmpty
(
ids
))
{
...
...
@@ -1098,7 +1098,7 @@ public class EsService {
*
* @param searchCondition 查询条件封装
*/
public
List
<
SpecialInformation
>
informationList
(
EventData
Condition
searchCondition
)
{
public
List
<
SpecialInformation
>
informationList
(
InfoDataSearch
Condition
searchCondition
)
{
String
[]
indexArr
=
EsIndexUtil
.
getIndexIntervalYear
(
Constants
.
SUBJECT_INDEX
,
searchCondition
.
getStartTime
(),
searchCondition
.
getEndTime
());
SearchRequest
searchRequest
=
new
SearchRequest
(
indexArr
);
SearchSourceBuilder
searchSourceBuilder
=
new
SearchSourceBuilder
();
...
...
@@ -1386,7 +1386,7 @@ public class EsService {
*/
public
List
<
CountVO
>
getSubjectDatabaseByTime
(
String
startDate
,
String
endDate
,
String
type
,
String
subjectId
,
Integer
isFreeCheck
,
Integer
checkStatus
)
{
//构建查询(聚合)条件
EventDataCondition
searchCondition
=
new
EventData
Condition
();
InfoDataSearchCondition
searchCondition
=
new
InfoDataSearch
Condition
();
searchCondition
.
setSubjectId
(
subjectId
);
searchCondition
.
setStartTime
(
startDate
);
searchCondition
.
setEndTime
(
endDate
);
...
...
@@ -1403,7 +1403,7 @@ public class EsService {
* @author lkg
* @date 2024/12/30
*/
public
List
<
CountVO
>
overView
(
EventData
Condition
searchCondition
)
{
public
List
<
CountVO
>
overView
(
InfoDataSearch
Condition
searchCondition
)
{
List
<
CountVO
>
list
=
new
ArrayList
<>();
SearchRequest
searchRequest
=
new
SearchRequest
(
Constants
.
SUBJECT_INDEX
);
SearchSourceBuilder
searchSourceBuilder
=
new
SearchSourceBuilder
();
...
...
@@ -1458,7 +1458,7 @@ public class EsService {
* @author lkg
* @date 2024/12/26
*/
public
List
<
CountVO
>
groupByDate
(
EventData
Condition
searchCondition
)
{
public
List
<
CountVO
>
groupByDate
(
InfoDataSearch
Condition
searchCondition
)
{
List
<
CountVO
>
list
=
new
ArrayList
<>();
SearchRequest
searchRequest
=
new
SearchRequest
(
Constants
.
SUBJECT_INDEX
);
SearchSourceBuilder
searchSourceBuilder
=
new
SearchSourceBuilder
();
...
...
@@ -1515,7 +1515,7 @@ public class EsService {
* @author lkg
* @date 2024/12/26
*/
public
List
<
CountVO
>
groupByClassificationType
(
EventData
Condition
searchCondition
)
{
public
List
<
CountVO
>
groupByClassificationType
(
InfoDataSearch
Condition
searchCondition
)
{
return
groupByTerm
(
searchCondition
,
"group"
,
"classificationType"
,
false
);
}
...
...
@@ -1526,7 +1526,7 @@ public class EsService {
* @author lkg
* @date 2024/12/26
*/
public
List
<
CountVO
>
groupBySourceId
(
EventData
Condition
searchCondition
)
{
public
List
<
CountVO
>
groupBySourceId
(
InfoDataSearch
Condition
searchCondition
)
{
return
groupByTerm
(
searchCondition
,
"groupSid"
,
"sid.keyword"
,
false
);
}
...
...
@@ -1537,7 +1537,7 @@ public class EsService {
* @author lkg
* @date 2024/12/26
*/
public
List
<
CountVO
>
groupByInfoSourceTag
(
EventData
Condition
searchCondition
)
{
public
List
<
CountVO
>
groupByInfoSourceTag
(
InfoDataSearch
Condition
searchCondition
)
{
List
<
CountVO
>
list
=
new
ArrayList
<>();
SearchRequest
searchRequest
=
new
SearchRequest
(
Constants
.
SUBJECT_INDEX
);
SearchSourceBuilder
searchSourceBuilder
=
new
SearchSourceBuilder
();
...
...
@@ -1592,7 +1592,7 @@ public class EsService {
//构建查询语句
List
<
String
>
subjectIds
=
new
ArrayList
<>();
subjectIds
.
add
(
subjectId
);
BoolQueryBuilder
boolQuery
=
buildQuery
(
new
EventData
Condition
(),
subjectIds
);
BoolQueryBuilder
boolQuery
=
buildQuery
(
new
InfoDataSearch
Condition
(),
subjectIds
);
searchSourceBuilder
.
query
(
boolQuery
);
TermsAggregationBuilder
aggregationBuilder
=
AggregationBuilders
.
terms
(
"groupKeywords"
)
.
field
(
"keyWordsList.keyword"
)
...
...
@@ -1630,7 +1630,7 @@ public class EsService {
* @author lkg
* @date 2024/12/27
*/
private
List
<
CountVO
>
groupByTerm
(
EventData
Condition
searchCondition
,
String
groupName
,
String
field
,
boolean
sort
)
{
private
List
<
CountVO
>
groupByTerm
(
InfoDataSearch
Condition
searchCondition
,
String
groupName
,
String
field
,
boolean
sort
)
{
List
<
CountVO
>
list
=
new
ArrayList
<>();
SearchRequest
searchRequest
=
new
SearchRequest
(
Constants
.
SUBJECT_INDEX
);
SearchSourceBuilder
searchSourceBuilder
=
new
SearchSourceBuilder
();
...
...
@@ -1677,7 +1677,7 @@ public class EsService {
* @author lkg
* @date 2024/12/25
*/
private
BoolQueryBuilder
buildQuery
(
EventData
Condition
searchCondition
,
List
<
String
>
subjectIdList
)
{
private
BoolQueryBuilder
buildQuery
(
InfoDataSearch
Condition
searchCondition
,
List
<
String
>
subjectIdList
)
{
//创建查询对象
BoolQueryBuilder
boolQuery
=
QueryBuilders
.
boolQuery
();
if
(
CollectionUtils
.
isNotEmpty
(
subjectIdList
))
{
...
...
src/main/java/com/zzsn/event/mapper/InfoSourceMapper.java
浏览文件 @
af2be853
...
...
@@ -9,6 +9,7 @@ import org.apache.ibatis.annotations.Mapper;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
/**
* @Description: 信息源表
...
...
@@ -71,26 +72,37 @@ public interface InfoSourceMapper extends BaseMapper<InfoSource> {
/**
* 信息源分页列表(专题绑定定向信息源时使用)
* 专题绑定的定向信息源分页列表(专题绑定定向信息源时使用-研究中心)
*
* @param subjectId 专题id
* @author lkg
* @date 2025/1/6
*/
Page
<
Map
<
String
,
Object
>>
subjectBindDirectInfoSourceList
(
@Param
(
"subjectId"
)
String
subjectId
,
Page
<
Map
<
String
,
Object
>>
page
);
/**
* 信息源分页列表(专题绑定定向信息源时使用-研究中心)
*
* @param searchWord 搜索词
* @param page 分页参数
* @param page
分页参数
* @author lkg
* @date 2025/1/4
*/
Page
<
String
>
directSourceList
(
@Param
(
"searchWord"
)
String
searchWord
,
Page
<
String
>
page
);
Page
<
String
>
infoSourcePageList
(
@Param
(
"searchWord"
)
String
searchWord
,
Page
<
String
>
page
);
/**
* 信息源下栏目分页列表(专题绑定定向信息源时使用)
* 信息源下栏目分页列表(专题绑定定向信息源时使用
-研究中心
)
*
* @param webSiteName 信息源名称
* @param page 分页参数
* @param page
分页参数
* @author lkg
* @date 2025/1/4
*/
Page
<
InfoSource
>
directSourceColumnList
(
@Param
(
"webSiteName"
)
String
webSiteName
,
Page
<
InfoSource
>
page
);
/**
* 信息源下栏目列表(专题绑定定向信息源时使用)
* 信息源下栏目列表(专题绑定定向信息源时使用
-研究中心
)
*
* @param webSiteName 信息源名称
* @author lkg
...
...
src/main/java/com/zzsn/event/mapper/xml/InfoSourceMapper.xml
浏览文件 @
af2be853
...
...
@@ -205,7 +205,24 @@
</select>
<select
id=
"directSourceList"
resultType=
"String"
>
<select
id=
"subjectBindDirectInfoSourceList"
resultType=
"Map"
>
select a.*
from (
select iso.web_site_name, 1 as `status`
from info_source iso
inner join subject_info_source_map sm on iso.id = sm.source_id and sm.type = #{subjectId}
where sm.subject_id = '1'
group by iso.web_site_name
union
select info_source_name as web_site_name, 0 as `status`
from subject_info_source_middle_map
where subject_id = #{subjectId}
group by info_source_name
) a
order by status desc ,web_site_name asc
</select>
<select
id=
"infoSourcePageList"
resultType=
"String"
>
select iso.web_site_name
from info_source iso where 1=1
<if
test=
"searchWord!=null and searchWord != ''"
>
...
...
@@ -219,8 +236,9 @@
</select>
<select
id=
"directSourceColumnList"
resultType=
"com.zzsn.event.entity.InfoSource"
>
select iso.site_name,iso.site_uri
from info_source iso where iso.web_site_name = #{webSiteName}
select iso.site_name, iso.site_uri
from info_source iso
where iso.web_site_name = #{webSiteName}
order by iso.create_time
</select>
</mapper>
src/main/java/com/zzsn/event/service/IInfoSourceService.java
浏览文件 @
af2be853
...
...
@@ -7,6 +7,7 @@ import com.zzsn.event.vo.InfoSourceVo;
import
com.zzsn.event.entity.InfoSource
;
import
java.util.List
;
import
java.util.Map
;
/**
* @Description: 信息源表
...
...
@@ -54,7 +55,18 @@ public interface IInfoSourceService extends IService<InfoSource> {
/**
* 信息源分页列表(专题绑定定向信息源时使用)
* 专题绑定的定向信息源分页列表(专题绑定定向信息源时使用-研究中心)
*
* @param subjectId 专题id
* @param pageNo 当前页
* @param pageSize 返回条数
* @author lkg
* @date 2025/1/4
*/
IPage
<
Map
<
String
,
Object
>>
subjectBindDirectSourcePageList
(
String
subjectId
,
Integer
pageNo
,
Integer
pageSize
);
/**
* 信息源分页列表(专题绑定定向信息源时使用-研究中心)
*
* @param searchWord 搜索词
* @param pageNo 当前页
...
...
@@ -65,7 +77,7 @@ public interface IInfoSourceService extends IService<InfoSource> {
IPage
<
String
>
directSourcePageList
(
String
searchWord
,
Integer
pageNo
,
Integer
pageSize
);
/**
* 信息源下栏目分页列表(专题绑定定向信息源时使用)
* 信息源下栏目分页列表(专题绑定定向信息源时使用
-研究中心
)
*
* @param webSiteName 信息源名称
* @param pageNo 当前页
...
...
@@ -76,7 +88,7 @@ public interface IInfoSourceService extends IService<InfoSource> {
IPage
<
InfoSource
>
directSourceColumnPageList
(
String
webSiteName
,
Integer
pageNo
,
Integer
pageSize
);
/**
* 信息源下栏目列表(专题绑定定向信息源时使用)
* 信息源下栏目列表(专题绑定定向信息源时使用
-研究中心
)
*
* @param webSiteName 信息源名称
* @author lkg
...
...
src/main/java/com/zzsn/event/service/InformationService.java
浏览文件 @
af2be853
...
...
@@ -6,7 +6,6 @@ import com.zzsn.event.entity.ClbFileOperationLog;
import
com.zzsn.event.util.user.UserVo
;
import
com.zzsn.event.vo.*
;
import
com.zzsn.event.vo.es.DisplayInfo
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -26,7 +25,7 @@ public interface InformationService {
* @author lkg
* @date 2024/5/6
*/
IPage
<
EventDataVO
>
collectPageList
(
EventData
Condition
eventDataCondition
);
IPage
<
EventDataVO
>
collectPageList
(
InfoDataSearch
Condition
eventDataCondition
);
/**
* 专题库资讯分页列表
...
...
@@ -36,7 +35,7 @@ public interface InformationService {
* @author lkg
* @date 2024/5/6
*/
IPage
<
DisplayInfo
>
subjectPageList
(
UserVo
userVo
,
EventData
Condition
subjectInfo
);
IPage
<
DisplayInfo
>
subjectPageList
(
UserVo
userVo
,
InfoDataSearch
Condition
subjectInfo
);
/**
* 资讯详情
...
...
src/main/java/com/zzsn/event/service/impl/InfoSourceServiceImpl.java
浏览文件 @
af2be853
...
...
@@ -108,9 +108,15 @@ public class InfoSourceServiceImpl extends ServiceImpl<InfoSourceMapper, InfoSou
}
@Override
public
IPage
<
Map
<
String
,
Object
>>
subjectBindDirectSourcePageList
(
String
subjectId
,
Integer
pageNo
,
Integer
pageSize
)
{
Page
<
Map
<
String
,
Object
>>
page
=
new
Page
<>(
pageNo
,
pageSize
);
return
baseMapper
.
subjectBindDirectInfoSourceList
(
subjectId
,
page
);
}
@Override
public
IPage
<
String
>
directSourcePageList
(
String
searchWord
,
Integer
pageNo
,
Integer
pageSize
)
{
Page
<
String
>
page
=
new
Page
<>(
pageNo
,
pageSize
);
return
baseMapper
.
directSourc
eList
(
searchWord
,
page
);
return
baseMapper
.
infoSourcePag
eList
(
searchWord
,
page
);
}
@Override
...
...
src/main/java/com/zzsn/event/service/impl/InformationServiceImpl.java
浏览文件 @
af2be853
...
...
@@ -37,8 +37,6 @@ import javax.annotation.Resource;
import
java.time.LocalDateTime
;
import
java.util.*
;
import
java.util.concurrent.CompletableFuture
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -88,12 +86,12 @@ public class InformationServiceImpl implements InformationService {
@Override
public
IPage
<
EventDataVO
>
collectPageList
(
EventData
Condition
eventDataCondition
)
{
public
IPage
<
EventDataVO
>
collectPageList
(
InfoDataSearch
Condition
eventDataCondition
)
{
return
esService
.
collectPageList
(
eventDataCondition
);
}
@Override
public
IPage
<
DisplayInfo
>
subjectPageList
(
UserVo
userVo
,
EventData
Condition
searchCondition
)
{
public
IPage
<
DisplayInfo
>
subjectPageList
(
UserVo
userVo
,
InfoDataSearch
Condition
searchCondition
)
{
IPage
<
DisplayInfo
>
page
=
new
Page
<>(
searchCondition
.
getPageNo
(),
searchCondition
.
getPageSize
());
List
<
String
>
subjectIdList
=
new
ArrayList
<>();
//判断是否是专题
...
...
@@ -121,7 +119,7 @@ public class InformationServiceImpl implements InformationService {
}
searchCondition
.
setLabelIds
(
relationIds
);
try
{
IPage
<
SpecialInformation
>
specialInformationIPage
=
esService
.
pageListByCondtion
(
searchCondition
,
subjectIdList
);
IPage
<
SpecialInformation
>
specialInformationIPage
=
esService
.
pageListByCond
i
tion
(
searchCondition
,
subjectIdList
);
long
total
=
specialInformationIPage
.
getTotal
();
if
(
total
>
0
)
{
List
<
DisplayInfo
>
dataList
=
new
ArrayList
<>();
...
...
src/main/java/com/zzsn/event/vo/
EventData
Condition.java
→
src/main/java/com/zzsn/event/vo/
InfoDataSearch
Condition.java
浏览文件 @
af2be853
...
...
@@ -5,7 +5,7 @@ import lombok.Data;
import
java.util.List
;
@Data
public
class
EventData
Condition
{
public
class
InfoDataSearch
Condition
{
//专题id/专题分类id
private
String
subjectId
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论