Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
E
event
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
陈世强
event
Commits
73fa1b20
提交
73fa1b20
authored
4月 27, 2025
作者:
obcy
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/event_fusion' into event_fusion
上级
d27fa86d
79bbafff
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
53 行增加
和
29 行删除
+53
-29
InformationController.java
...m/zzsn/event/controller/common/InformationController.java
+25
-23
StatisticalAnalysisController.java
...vent/controller/common/StatisticalAnalysisController.java
+3
-0
InformationServiceImpl.java
...a/com/zzsn/event/service/impl/InformationServiceImpl.java
+15
-0
EsOpUtil.java
src/main/java/com/zzsn/event/util/EsOpUtil.java
+10
-6
没有找到文件。
src/main/java/com/zzsn/event/controller/common/InformationController.java
浏览文件 @
73fa1b20
...
...
@@ -211,6 +211,7 @@ public class InformationController {
IPage
<
DisplayInfo
>
pageList
=
informationService
.
subjectPageList
(
searchCondition
);
return
Result
.
OK
(
pageList
);
}
/**
* 事件对应专题库的资讯分页列表
*
...
...
@@ -270,6 +271,7 @@ public class InformationController {
/**
* 删除指定标签
*
* @param id
* @param relationId
* @param index
...
...
@@ -279,9 +281,10 @@ public class InformationController {
public
Result
<?>
delLabel
(
@RequestParam
(
"id"
)
String
id
,
@RequestParam
(
"relationId"
)
String
relationId
,
@RequestParam
(
"index"
)
String
index
)
{
informationService
.
removeLabelById
(
index
,
id
,
relationId
);
informationService
.
removeLabelById
(
index
,
id
,
relationId
);
return
Result
.
OK
(
"删除成功"
);
}
/**
* 批量删除标签
*
...
...
@@ -303,7 +306,6 @@ public class InformationController {
}
/**
* 通过id查询(专题库)
*
...
...
@@ -394,11 +396,11 @@ public class InformationController {
*/
@PostMapping
(
value
=
"/modifyLabel"
)
public
Result
<?>
modifyLabel
(
@RequestBody
DataBindLabelFrom
bindLabelFrom
)
{
if
(
bindLabelFrom
.
getBindList
()==
null
||
bindLabelFrom
.
getBindList
().
isEmpty
())
{
if
(
bindLabelFrom
.
getBindList
()
==
null
||
bindLabelFrom
.
getBindList
().
isEmpty
())
{
List
<
DictVO
>
boundList
=
subjectDictMapService
.
boundList
(
bindLabelFrom
.
getSubjectId
());
bindLabelFrom
.
setBindList
(
boundList
);
}
if
(
bindLabelFrom
.
getBindList
()==
null
||
bindLabelFrom
.
getBindList
().
isEmpty
())
{
if
(
bindLabelFrom
.
getBindList
()
==
null
||
bindLabelFrom
.
getBindList
().
isEmpty
())
{
return
Result
.
FAIL
(
"专题未绑定标签,不可编辑"
);
}
informationService
.
modifyLabel
(
bindLabelFrom
);
...
...
@@ -503,7 +505,7 @@ public class InformationController {
* @date 2025/2/20
*/
@PostMapping
(
"/removeByCondition"
)
public
Result
<?>
removeByCondition
(
@RequestBody
JSONObject
params
){
public
Result
<?>
removeByCondition
(
@RequestBody
JSONObject
params
)
{
String
subjectId
=
params
.
getString
(
"subjectId"
);
if
(
StringUtils
.
isEmpty
(
subjectId
))
{
return
Result
.
FAIL
(
"专题id不能为空"
);
...
...
@@ -524,7 +526,7 @@ public class InformationController {
* @date 2025/2/20
*/
@PostMapping
(
"/supplyByCondition"
)
public
Result
<?>
supplyByCondition
(
@RequestBody
JSONObject
params
){
public
Result
<?>
supplyByCondition
(
@RequestBody
JSONObject
params
)
{
String
subjectId
=
params
.
getString
(
"subjectId"
);
if
(
StringUtils
.
isEmpty
(
subjectId
))
{
return
Result
.
FAIL
(
"专题id不能为空"
);
...
...
@@ -550,8 +552,8 @@ public class InformationController {
if
(
CollectionUtils
.
isEmpty
(
keywordList
))
{
return
Result
.
FAIL
(
"关键词不能为空"
);
}
CompletableFuture
.
runAsync
(()->
informationService
.
removeWordLabel
(
searchCondition
));
return
Result
.
OK
();
CompletableFuture
.
runAsync
(()
->
informationService
.
removeWordLabel
(
searchCondition
));
return
Result
.
OK
(
"关键词删除中。。。"
);
}
/**
...
...
@@ -568,8 +570,8 @@ public class InformationController {
if
(
StringUtils
.
isEmpty
(
subjectId
)
&&
CollectionUtils
.
isEmpty
(
ids
))
{
return
Result
.
FAIL
(
"专题id和资讯id集合不能同时为空"
);
}
informationService
.
addToFavorites
(
searchCondition
);
return
Result
.
OK
();
CompletableFuture
.
runAsync
(()
->
informationService
.
addToFavorites
(
searchCondition
)
);
return
Result
.
OK
(
"资讯添加到精选中。。。"
);
}
/**
...
...
@@ -586,8 +588,8 @@ public class InformationController {
if
(
StringUtils
.
isEmpty
(
subjectId
)
&&
CollectionUtils
.
isEmpty
(
ids
))
{
return
Result
.
FAIL
(
"专题id和资讯id集合不能同时为空"
);
}
informationService
.
addToPend
(
searchCondition
);
return
Result
.
OK
();
CompletableFuture
.
runAsync
(()
->
informationService
.
addToPend
(
searchCondition
)
);
return
Result
.
OK
(
"资讯添加到待定中。。。"
);
}
/**
...
...
@@ -604,8 +606,8 @@ public class InformationController {
if
(
StringUtils
.
isEmpty
(
subjectId
)
&&
CollectionUtils
.
isEmpty
(
ids
))
{
return
Result
.
FAIL
(
"专题id和资讯id集合不能同时为空"
);
}
informationService
.
addToRemove
(
searchCondition
);
return
Result
.
OK
();
CompletableFuture
.
runAsync
(()
->
informationService
.
addToRemove
(
searchCondition
)
);
return
Result
.
OK
(
"资讯添加到删除中。。。"
);
}
/**
...
...
@@ -621,13 +623,13 @@ public class InformationController {
if
(
StringUtils
.
isEmpty
(
subjectId
))
{
return
Result
.
FAIL
(
"专题id不能为空"
);
}
informationService
.
initialData
(
searchCondition
);
return
Result
.
OK
();
CompletableFuture
.
runAsync
(()
->
informationService
.
initialData
(
searchCondition
)
);
return
Result
.
OK
(
"数据初始化中。。。"
);
}
//@PostMapping("/searchForReplaceList")
public
Result
<?>
searchForReplaceList
(
@RequestBody
InfoDataSearchCondition
searchCondition
){
public
Result
<?>
searchForReplaceList
(
@RequestBody
InfoDataSearchCondition
searchCondition
)
{
IPage
<
SpecialInformation
>
page
=
informationService
.
searchForReplaceList
(
searchCondition
);
return
Result
.
OK
(
page
);
}
...
...
@@ -649,8 +651,8 @@ public class InformationController {
if
(
CollectionUtils
.
isEmpty
(
searchWordList
))
{
return
Result
.
FAIL
(
"检索词不能为空"
);
}
informationService
.
charReplace
(
searchCondition
);
return
Result
.
OK
();
CompletableFuture
.
runAsync
(()
->
informationService
.
charReplace
(
searchCondition
)
);
return
Result
.
OK
(
"数据替换中。。。"
);
}
/**
...
...
@@ -671,8 +673,8 @@ public class InformationController {
if
(
CollectionUtils
.
isEmpty
(
markTags
))
{
return
Result
.
FAIL
(
"标签不能为空"
);
}
informationService
.
markTag
(
searchCondition
);
return
Result
.
OK
();
CompletableFuture
.
runAsync
(()
->
informationService
.
markTag
(
searchCondition
)
);
return
Result
.
OK
(
"批量打标中。。。"
);
}
/**
...
...
@@ -693,8 +695,8 @@ public class InformationController {
if
(
CollectionUtils
.
isEmpty
(
markTags
))
{
return
Result
.
FAIL
(
"标签不能为空"
);
}
informationService
.
removeTag
(
searchCondition
);
return
Result
.
OK
();
CompletableFuture
.
runAsync
(()
->
informationService
.
removeTag
(
searchCondition
)
);
return
Result
.
OK
(
"批量删除标签中。。。"
);
}
...
...
src/main/java/com/zzsn/event/controller/common/StatisticalAnalysisController.java
浏览文件 @
73fa1b20
...
...
@@ -64,6 +64,9 @@ public class StatisticalAnalysisController {
List
<
CountVO
>
countList
=
new
ArrayList
<>();
int
totalCount
;
List
<
Label
>
bindLabelList
=
bindLabelList
(
searchCondition
.
getSubjectId
());
if
(
CollectionUtils
.
isEmpty
(
bindLabelList
))
{
return
Result
.
FAIL
(
"该专题未绑定信息源标签,无法分析"
);
}
Map
<
String
,
Label
>
labelMap
=
bindLabelList
.
stream
().
collect
(
Collectors
.
toMap
(
label
->
label
.
getLabelMark
()
+
"-"
+
label
.
getRelationId
(),
label
->
label
));
if
(
CollectionUtils
.
isEmpty
(
searchCondition
.
getIds
())
&&
searchCondition
.
getNum
()
==
null
)
{
List
<
String
>
includeValues
=
new
ArrayList
<>();
...
...
src/main/java/com/zzsn/event/service/impl/InformationServiceImpl.java
浏览文件 @
73fa1b20
...
...
@@ -1167,6 +1167,11 @@ public class InformationServiceImpl implements InformationService {
Map
<
String
,
Object
>
deleteParams
=
new
HashMap
<>();
deleteParams
.
put
(
"fieldType"
,
word
);
esOpUtil
.
batchNestedDeleteScript
(
indexArr
,
buildQuery
,
deleteParams
,
"sortField"
);
try
{
Thread
.
sleep
(
3000
);
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
}
}
}
...
...
@@ -1292,6 +1297,11 @@ public class InformationServiceImpl implements InformationService {
Map
<
String
,
String
>
addTag
=
ObjectUtil
.
objectToMap
(
markTag
);
addParams
.
put
(
"labels"
,
addTag
);
esOpUtil
.
batchNestedAddScript
(
indexArr
,
buildQuery
,
addParams
,
"labels"
,
"relationId"
);
try
{
Thread
.
sleep
(
3000
);
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
}
}
}
...
...
@@ -1317,6 +1327,11 @@ public class InformationServiceImpl implements InformationService {
Map
<
String
,
Object
>
deleteParams
=
new
HashMap
<>();
deleteParams
.
put
(
"relationId"
,
tagId
);
esOpUtil
.
batchNestedDeleteScript
(
indexArr
,
buildQuery
,
deleteParams
,
"labels"
);
try
{
Thread
.
sleep
(
3000
);
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
}
}
}
...
...
src/main/java/com/zzsn/event/util/EsOpUtil.java
浏览文件 @
73fa1b20
...
...
@@ -707,8 +707,9 @@ public class EsOpUtil<T> {
request
.
setConflicts
(
"proceed"
);
try
{
BulkByScrollResponse
response
=
client
.
updateByQuery
(
request
,
RequestOptions
.
DEFAULT
);
long
versionConflicts
=
response
.
getVersionConflicts
();
long
updated
=
response
.
getUpdated
();
log
.
info
(
"更新条数
{}"
,
updated
);
log
.
info
(
"更新条数
:{},冲突条数{}"
,
updated
,
versionConflicts
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
...
...
@@ -738,8 +739,9 @@ public class EsOpUtil<T> {
request
.
setConflicts
(
"proceed"
);
try
{
BulkByScrollResponse
response
=
client
.
updateByQuery
(
request
,
RequestOptions
.
DEFAULT
);
long
versionConflicts
=
response
.
getVersionConflicts
();
long
updated
=
response
.
getUpdated
();
log
.
info
(
"更新条数
{}"
,
updated
);
log
.
info
(
"更新条数
:{},冲突条数{}"
,
updated
,
versionConflicts
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
...
...
@@ -779,8 +781,9 @@ public class EsOpUtil<T> {
request
.
setConflicts
(
"proceed"
);
try
{
BulkByScrollResponse
response
=
client
.
updateByQuery
(
request
,
RequestOptions
.
DEFAULT
);
long
deleted
=
response
.
getUpdated
();
log
.
info
(
"更新条数{}"
,
deleted
);
long
versionConflicts
=
response
.
getVersionConflicts
();
long
updated
=
response
.
getUpdated
();
log
.
info
(
"更新条数:{},冲突条数{}"
,
updated
,
versionConflicts
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
...
...
@@ -811,8 +814,9 @@ public class EsOpUtil<T> {
request
.
setConflicts
(
"proceed"
);
try
{
BulkByScrollResponse
response
=
client
.
updateByQuery
(
request
,
RequestOptions
.
DEFAULT
);
long
deleted
=
response
.
getUpdated
();
log
.
info
(
"更新条数{}"
,
deleted
);
long
versionConflicts
=
response
.
getVersionConflicts
();
long
updated
=
response
.
getUpdated
();
log
.
info
(
"更新条数:{},冲突条数{}"
,
updated
,
versionConflicts
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论