Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
E
event
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
陈世强
event
Commits
c311ac86
提交
c311ac86
authored
4月 28, 2025
作者:
yanxin
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/event_fusion' into event_fusion
# Conflicts: # src/main/java/com/zzsn/event/es/EsService.java
上级
c78bddff
9badde3e
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
27 个修改的文件
包含
529 行增加
和
27 行删除
+529
-27
Constants.java
src/main/java/com/zzsn/event/constant/Constants.java
+2
-0
SubjectManageController.java
...va/com/zzsn/event/controller/SubjectManageController.java
+12
-0
ClbSubjectHitwordsMapController.java
...event/controller/biz/ClbSubjectHitwordsMapController.java
+17
-6
InformationController.java
...m/zzsn/event/controller/common/InformationController.java
+171
-7
RelationBindController.java
.../zzsn/event/controller/common/RelationBindController.java
+26
-1
StatisticalAnalysisController.java
...vent/controller/common/StatisticalAnalysisController.java
+3
-0
InfoSource.java
src/main/java/com/zzsn/event/entity/InfoSource.java
+4
-0
Subject.java
src/main/java/com/zzsn/event/entity/Subject.java
+3
-0
EsService.java
src/main/java/com/zzsn/event/es/EsService.java
+0
-0
RemoteProjectService.java
...n/java/com/zzsn/event/feign/api/RemoteProjectService.java
+24
-0
ClbSubjectHitwordsMapMapper.java
...va/com/zzsn/event/mapper/ClbSubjectHitwordsMapMapper.java
+4
-0
ClbSubjectHitwordsMapMapper.xml
...com/zzsn/event/mapper/xml/ClbSubjectHitwordsMapMapper.xml
+5
-0
SubjectMapper.xml
src/main/java/com/zzsn/event/mapper/xml/SubjectMapper.xml
+1
-1
ClbSubjectHitwordsMapService.java
.../com/zzsn/event/service/ClbSubjectHitwordsMapService.java
+3
-0
InformationService.java
src/main/java/com/zzsn/event/service/InformationService.java
+81
-0
SubjectService.java
src/main/java/com/zzsn/event/service/SubjectService.java
+3
-0
ClbSubjectHitwordsMapServiceImpl.java
.../event/service/impl/ClbSubjectHitwordsMapServiceImpl.java
+48
-1
InformationServiceImpl.java
...a/com/zzsn/event/service/impl/InformationServiceImpl.java
+0
-0
SubjectServiceImpl.java
.../java/com/zzsn/event/service/impl/SubjectServiceImpl.java
+51
-0
EsOpUtil.java
src/main/java/com/zzsn/event/util/EsOpUtil.java
+0
-0
HanlpUtil.java
src/main/java/com/zzsn/event/util/HanlpUtil.java
+1
-1
InfoDataSearchCondition.java
src/main/java/com/zzsn/event/vo/InfoDataSearchCondition.java
+32
-9
InfoSourceCondition.java
src/main/java/com/zzsn/event/vo/InfoSourceCondition.java
+1
-1
SubjectPageVO.java
src/main/java/com/zzsn/event/vo/SubjectPageVO.java
+1
-0
DisplayInfo.java
src/main/java/com/zzsn/event/vo/es/DisplayInfo.java
+4
-0
SortField.java
src/main/java/com/zzsn/event/vo/es/SortField.java
+30
-0
SpecialInformation.java
src/main/java/com/zzsn/event/vo/es/SpecialInformation.java
+2
-0
没有找到文件。
src/main/java/com/zzsn/event/constant/Constants.java
浏览文件 @
c311ac86
...
...
@@ -107,4 +107,6 @@ public class Constants {
//obs 文件浏览地址 前部分
public
static
final
String
OBS_FILE_PATH_URL_PREFIX
=
"http://obs.ciglobal.cn/"
;
/**专题模型处理中断缓存*/
public
static
final
String
SUBJECT_MODEL_DETAIL_BREAK
=
"SUBJECT_MODEL_DETAIL_BREAK::"
;
}
src/main/java/com/zzsn/event/controller/SubjectManageController.java
浏览文件 @
c311ac86
...
...
@@ -860,6 +860,18 @@ public class SubjectManageController {
List
<
InfoSourceLabelVO
>
bindList
=
clbLabelService
.
bindInfoSourceLabelInfo
(
subjectId
);
return
Result
.
OK
(
bindList
);
}
/**
* 更新subject的数据范围
* @param subjectId 专题id
*/
@GetMapping
(
"/subjectUpdateScope"
)
public
Result
<?>
subjectUpdateScope
(
@RequestParam
(
name
=
"subjectId"
)
String
subjectId
,
@RequestParam
(
name
=
"type"
)
String
type
,
@RequestParam
(
name
=
"scop"
,
defaultValue
=
""
)
String
scop
)
{
Subject
subject
=
subjectService
.
subjectUpdateScope
(
subjectId
,
type
,
scop
);
return
Result
.
OK
(
subject
);
}
/**
* 绑定信息源标签数据
...
...
src/main/java/com/zzsn/event/controller/biz/ClbSubjectHitwordsMapController.java
浏览文件 @
c311ac86
...
...
@@ -3,26 +3,23 @@ package com.zzsn.event.controller.biz;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.json.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.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.zzsn.event.constant.Result
;
import
com.zzsn.event.entity.ClbSubjectHitwordsMap
;
import
com.zzsn.event.feign.api.RemoteProjectService
;
import
com.zzsn.event.service.ClbSubjectHitwordsMapService
;
import
com.zzsn.event.vo.InfoDataSearchCondition
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.servlet.ModelAndView
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
* <p>
...
...
@@ -33,10 +30,13 @@ import java.util.stream.Collectors;
* @since 2025-04-23
*/
@RestController
@Slf4j
@RequestMapping
(
"/subject/hitwordsMap"
)
public
class
ClbSubjectHitwordsMapController
{
@Autowired
private
ClbSubjectHitwordsMapService
clbSubjectHitwordsMapService
;
@Autowired
private
RemoteProjectService
remoteProjectService
;
/**
* 分页列表查询
...
...
@@ -106,6 +106,17 @@ public class ClbSubjectHitwordsMapController {
}
clbSubjectHitwordsMapService
.
save
(
clbSubjectHitwordsMap
);
InfoDataSearchCondition
searchCondition
=
new
InfoDataSearchCondition
();
searchCondition
.
setSubjectId
(
clbSubjectHitwordsMap
.
getSubjectId
());
searchCondition
.
setStatus
(
0
);
searchCondition
.
setIsSubject
(
"1"
);
searchCondition
.
setCategory
(
1
);
searchCondition
.
setFlowId
(
"1914980469431201794"
);
//手动中断正在执行的词频历史处理任务
clbSubjectHitwordsMapService
.
stopTask
(
searchCondition
);
String
s
=
remoteProjectService
.
doTaskByFlow
(
searchCondition
);
log
.
info
(
"调用流程编排接口返回结果:{}"
,
s
);
return
Result
.
OK
(
clbSubjectHitwordsMap
);
}
...
...
src/main/java/com/zzsn/event/controller/common/InformationController.java
浏览文件 @
c311ac86
...
...
@@ -13,11 +13,11 @@ import com.zzsn.event.enums.LabelTypeEnum;
import
com.zzsn.event.es.EsService
;
import
com.zzsn.event.service.*
;
import
com.zzsn.event.util.PythonUtil
;
import
com.zzsn.event.util.tree.Node
;
import
com.zzsn.event.util.user.UserUtil
;
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.Label
;
import
com.zzsn.event.vo.es.SpecialInformation
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -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不能为空"
);
...
...
@@ -536,4 +538,166 @@ public class InformationController {
informationService
.
supplyByCondition
(
subjectId
,
JSONArray
.
parseArray
(
themeIds
.
toJSONString
(),
String
.
class
));
return
Result
.
OK
();
}
/**
* 批量删除关键词
*
* @param searchCondition 检索条件
* @author lkg
* @date 2025/4/23
*/
@PostMapping
(
"/removeWord"
)
public
Result
<?>
removeWordLabel
(
@RequestBody
InfoDataSearchCondition
searchCondition
)
{
List
<
String
>
keywordList
=
searchCondition
.
getKeywordList
();
if
(
CollectionUtils
.
isEmpty
(
keywordList
))
{
return
Result
.
FAIL
(
"关键词不能为空"
);
}
CompletableFuture
.
runAsync
(()
->
informationService
.
removeWordLabel
(
searchCondition
));
return
Result
.
OK
(
"关键词删除中。。。"
);
}
/**
* 批量添加到精选
*
* @param searchCondition 检索条件
* @author lkg
* @date 2025/4/23
*/
@PostMapping
(
"/addToFavorites"
)
public
Result
<?>
addToFavorites
(
@RequestBody
InfoDataSearchCondition
searchCondition
)
{
String
subjectId
=
searchCondition
.
getSubjectId
();
List
<
String
>
ids
=
searchCondition
.
getIds
();
if
(
StringUtils
.
isEmpty
(
subjectId
)
&&
CollectionUtils
.
isEmpty
(
ids
))
{
return
Result
.
FAIL
(
"专题id和资讯id集合不能同时为空"
);
}
informationService
.
addToFavorites
(
searchCondition
);
return
Result
.
OK
();
}
/**
* 批量添加到待定
*
* @param searchCondition 检索条件
* @author lkg
* @date 2025/4/23
*/
@PostMapping
(
"/addToPend"
)
public
Result
<?>
addToPend
(
@RequestBody
InfoDataSearchCondition
searchCondition
)
{
String
subjectId
=
searchCondition
.
getSubjectId
();
List
<
String
>
ids
=
searchCondition
.
getIds
();
if
(
StringUtils
.
isEmpty
(
subjectId
)
&&
CollectionUtils
.
isEmpty
(
ids
))
{
return
Result
.
FAIL
(
"专题id和资讯id集合不能同时为空"
);
}
informationService
.
addToPend
(
searchCondition
);
return
Result
.
OK
();
}
/**
* 批量添加到移除
*
* @param searchCondition 检索条件
* @author lkg
* @date 2025/4/23
*/
@PostMapping
(
"/addToRemove"
)
public
Result
<?>
addToRemove
(
@RequestBody
InfoDataSearchCondition
searchCondition
)
{
String
subjectId
=
searchCondition
.
getSubjectId
();
List
<
String
>
ids
=
searchCondition
.
getIds
();
if
(
StringUtils
.
isEmpty
(
subjectId
)
&&
CollectionUtils
.
isEmpty
(
ids
))
{
return
Result
.
FAIL
(
"专题id和资讯id集合不能同时为空"
);
}
informationService
.
addToRemove
(
searchCondition
);
return
Result
.
OK
();
}
/**
* 初始化数据
*
* @param searchCondition 检索条件
* @author lkg
* @date 2025/4/23
*/
@PostMapping
(
"/initialData"
)
public
Result
<?>
initialData
(
@RequestBody
InfoDataSearchCondition
searchCondition
)
{
String
subjectId
=
searchCondition
.
getSubjectId
();
if
(
StringUtils
.
isEmpty
(
subjectId
))
{
return
Result
.
FAIL
(
"专题id不能为空"
);
}
informationService
.
initialData
(
searchCondition
);
return
Result
.
OK
();
}
//@PostMapping("/searchForReplaceList")
public
Result
<?>
searchForReplaceList
(
@RequestBody
InfoDataSearchCondition
searchCondition
)
{
IPage
<
SpecialInformation
>
page
=
informationService
.
searchForReplaceList
(
searchCondition
);
return
Result
.
OK
(
page
);
}
/**
* 字符串替换
*
* @param searchCondition 检索条件
* @author lkg
* @date 2025/4/23
*/
@PostMapping
(
"/charReplace"
)
public
Result
<?>
charReplace
(
@RequestBody
InfoDataSearchCondition
searchCondition
)
{
String
subjectId
=
searchCondition
.
getSubjectId
();
if
(
StringUtils
.
isEmpty
(
subjectId
))
{
return
Result
.
FAIL
(
"专题id不能为空"
);
}
List
<
SearchWordVO
>
searchWordList
=
searchCondition
.
getSearchWordList
();
if
(
CollectionUtils
.
isEmpty
(
searchWordList
))
{
return
Result
.
FAIL
(
"检索词不能为空"
);
}
informationService
.
charReplace
(
searchCondition
);
return
Result
.
OK
();
}
/**
* 资讯批量打标
*
* @param searchCondition 检索条件
* @author lkg
* @date 2025/4/23
*/
@PostMapping
(
"/markTag"
)
public
Result
<?>
markTag
(
@RequestBody
InfoDataSearchCondition
searchCondition
)
{
String
subjectId
=
searchCondition
.
getSubjectId
();
List
<
String
>
ids
=
searchCondition
.
getIds
();
if
(
StringUtils
.
isEmpty
(
subjectId
)
&&
CollectionUtils
.
isEmpty
(
ids
))
{
return
Result
.
FAIL
(
"专题id和资讯id集合不能同时为空"
);
}
List
<
Label
>
markTags
=
searchCondition
.
getMarkTags
();
if
(
CollectionUtils
.
isEmpty
(
markTags
))
{
return
Result
.
FAIL
(
"标签不能为空"
);
}
informationService
.
markTag
(
searchCondition
);
return
Result
.
OK
();
}
/**
* 资讯批量删除标签
*
* @param searchCondition 检索条件
* @author lkg
* @date 2025/4/23
*/
@PostMapping
(
"/removeTag"
)
public
Result
<?>
removeTag
(
@RequestBody
InfoDataSearchCondition
searchCondition
)
{
String
subjectId
=
searchCondition
.
getSubjectId
();
List
<
String
>
ids
=
searchCondition
.
getIds
();
if
(
StringUtils
.
isEmpty
(
subjectId
)
&&
CollectionUtils
.
isEmpty
(
ids
))
{
return
Result
.
FAIL
(
"专题id和资讯id集合不能同时为空"
);
}
List
<
Label
>
markTags
=
searchCondition
.
getMarkTags
();
if
(
CollectionUtils
.
isEmpty
(
markTags
))
{
return
Result
.
FAIL
(
"标签不能为空"
);
}
informationService
.
removeTag
(
searchCondition
);
return
Result
.
OK
();
}
}
src/main/java/com/zzsn/event/controller/common/RelationBindController.java
浏览文件 @
c311ac86
...
...
@@ -7,9 +7,11 @@ import com.alibaba.fastjson2.JSONObject;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.zzsn.event.constant.Result
;
import
com.zzsn.event.entity.InfoSource
;
import
com.zzsn.event.entity.InfoSourceGroup
;
import
com.zzsn.event.entity.Subject
;
import
com.zzsn.event.service.*
;
import
com.zzsn.event.util.tree.Node
;
import
com.zzsn.event.vo.*
;
...
...
@@ -116,7 +118,30 @@ public class RelationBindController {
}
subjectIdList
.
add
(
subjectId
);
}
IPage
<
InfoSourceVo
>
pageList
=
infoSourceService
.
bindInfoSourcePageList
(
infoSourceCondition
,
subjectIdList
,
pageNo
,
pageSize
);
//查询
IPage
<
InfoSourceVo
>
pageList
=
null
;
if
(
CollectionUtil
.
isNotEmpty
(
subjectIdList
)
&&
subjectIdList
.
size
()
==
1
&&
subjectId
.
equals
(
subjectIdList
.
get
(
0
)))
{
Subject
byId
=
subjectService
.
getById
(
subjectId
);
if
(
ObjectUtil
.
isNotNull
(
byId
)
&&
StringUtils
.
isNotEmpty
(
byId
.
getDataScope
())
&&
byId
.
getDataScope
().
contains
(
"1"
))
{
Page
<
InfoSource
>
page
=
new
Page
<>(
pageNo
,
pageSize
);
return
Result
.
OK
(
infoSourceService
.
page
(
page
,
Wrappers
.<
InfoSource
>
lambdaQuery
()
.
eq
(
ObjectUtil
.
isNotNull
(
infoSourceCondition
.
getCrawlType
()),
InfoSource:
:
getCrawlType
,
infoSourceCondition
.
getCrawlType
())
.
eq
(
StrUtil
.
isNotBlank
(
infoSourceCondition
.
getStatus
()),
InfoSource:
:
getStatus
,
infoSourceCondition
.
getStatus
())
.
like
(
StrUtil
.
isNotBlank
(
infoSourceCondition
.
getWebSiteName
()),
InfoSource:
:
getWebSiteName
,
infoSourceCondition
.
getWebSiteName
())
.
like
(
StrUtil
.
isNotBlank
(
infoSourceCondition
.
getSiteName
()),
InfoSource:
:
getSiteName
,
infoSourceCondition
.
getSiteName
())
.
like
(
StrUtil
.
isNotBlank
(
infoSourceCondition
.
getSiteUri
()),
InfoSource:
:
getSiteUri
,
infoSourceCondition
.
getSiteUri
())
.
orderByDesc
(
InfoSource:
:
getCreateTime
)
));
}
else
{
pageList
=
infoSourceService
.
bindInfoSourcePageList
(
infoSourceCondition
,
subjectIdList
,
pageNo
,
pageSize
);
}
}
else
{
pageList
=
infoSourceService
.
bindInfoSourcePageList
(
infoSourceCondition
,
subjectIdList
,
pageNo
,
pageSize
);
}
return
Result
.
OK
(
pageList
);
}
...
...
src/main/java/com/zzsn/event/controller/common/StatisticalAnalysisController.java
浏览文件 @
c311ac86
...
...
@@ -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/entity/InfoSource.java
浏览文件 @
c311ac86
...
...
@@ -69,4 +69,8 @@ public class InfoSource implements Serializable {
/**原创来源(中文逗号隔开)*/
private
String
originalSource
;
/**爬虫类别*/
private
String
crawlType
;
/**爬虫类别*/
private
String
status
;
}
src/main/java/com/zzsn/event/entity/Subject.java
浏览文件 @
c311ac86
...
...
@@ -114,5 +114,8 @@ public class Subject implements Serializable {
/**专题分类id*/
@TableField
(
exist
=
false
)
private
String
typeId
;
/**数据范围(是否是全库) - 采集库全库-1,企业库全库-2,政策库全库-3*/
@TableField
(
updateStrategy
=
FieldStrategy
.
IGNORED
)
// 忽略更新策略
private
String
dataScope
;
}
src/main/java/com/zzsn/event/es/EsService.java
浏览文件 @
c311ac86
差异被折叠。
点击展开。
src/main/java/com/zzsn/event/feign/api/RemoteProjectService.java
0 → 100644
浏览文件 @
c311ac86
package
com
.
zzsn
.
event
.
feign
.
api
;
import
com.zzsn.event.vo.InfoDataSearchCondition
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.web.bind.annotation.*
;
//feign调用
@FeignClient
(
value
=
"service-project"
)
public
interface
RemoteProjectService
{
/**
* 清除专题缓存
*
* @param
* @author lkg
* @date 2025/2/7
*/
@PostMapping
(
"/manage/subjectModel/doTaskByFlow"
)
String
doTaskByFlow
(
@RequestBody
InfoDataSearchCondition
task
);
}
src/main/java/com/zzsn/event/mapper/ClbSubjectHitwordsMapMapper.java
浏览文件 @
c311ac86
...
...
@@ -3,6 +3,9 @@ package com.zzsn.event.mapper;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.zzsn.event.entity.ClbSubjectHitwordsMap
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* <p>
...
...
@@ -15,4 +18,5 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public
interface
ClbSubjectHitwordsMapMapper
extends
BaseMapper
<
ClbSubjectHitwordsMap
>
{
List
<
String
>
detail
(
@Param
(
"flowId"
)
String
flowId
,
@Param
(
"subjectId"
)
String
subjectId
);
}
src/main/java/com/zzsn/event/mapper/xml/ClbSubjectHitwordsMapMapper.xml
浏览文件 @
c311ac86
...
...
@@ -15,4 +15,9 @@
<result
column=
"del_flag"
property=
"delFlag"
/>
</resultMap>
<select
id=
"detail"
resultType=
"String"
>
SELECT id FROM clb_subject_model_detail_task WHERE subject_id = #{subjectId} AND flow_id = #{flowId} AND task_status in (0,1);
</select>
</mapper>
src/main/java/com/zzsn/event/mapper/xml/SubjectMapper.xml
浏览文件 @
c311ac86
...
...
@@ -45,7 +45,7 @@
</select>
<select
id=
"pageList_new"
resultType=
"com.zzsn.event.vo.SubjectPageVO"
>
SELECT d.id,d.subject_name,d.status,
SELECT d.id,d.subject_name,d.status,
d.data_scope,
s.total_num,s.un_check_num,s.bind_source_num,s.bind_keyword_num,s.latest_data_date,
c.type_name as subjectTypeName, g.project_name as projectName
from subject d
...
...
src/main/java/com/zzsn/event/service/ClbSubjectHitwordsMapService.java
浏览文件 @
c311ac86
...
...
@@ -2,6 +2,7 @@ package com.zzsn.event.service;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.zzsn.event.entity.ClbSubjectHitwordsMap
;
import
com.zzsn.event.vo.InfoDataSearchCondition
;
import
java.util.List
;
...
...
@@ -16,4 +17,6 @@ import java.util.List;
public
interface
ClbSubjectHitwordsMapService
extends
IService
<
ClbSubjectHitwordsMap
>
{
void
delEs
(
List
<
ClbSubjectHitwordsMap
>
clbSubjectHitwordsMaps
);
void
stopTask
(
InfoDataSearchCondition
searchCondition
);
}
src/main/java/com/zzsn/event/service/InformationService.java
浏览文件 @
c311ac86
...
...
@@ -261,4 +261,85 @@ public interface InformationService {
List
<
SpecialInformation
>
informationAllList
(
InfoDataSearchCondition
searchCondition
);
void
removeLabelById
(
String
index
,
String
id
,
String
relationId
);
/**
* 删除关键词标签
*
* @param searchCondition 检索条件
* @author lkg
* @date 2025/4/22
*/
void
removeWordLabel
(
InfoDataSearchCondition
searchCondition
);
/**
* 批量添加到精选
*
* @param searchCondition 资讯检索条件
* @author lkg
* @date 2025/4/23
*/
void
addToFavorites
(
InfoDataSearchCondition
searchCondition
);
/**
* 批量添加到精选
*
* @param searchCondition 资讯检索条件
* @author lkg
* @date 2025/4/23
*/
void
addToPend
(
InfoDataSearchCondition
searchCondition
);
/**
* 批量添加到精选
*
* @param searchCondition 资讯检索条件
* @author lkg
* @date 2025/4/23
*/
void
addToRemove
(
InfoDataSearchCondition
searchCondition
);
/**
* 初始化数据(数据状态全部重置为待审核、未删除)
*
* @param searchCondition 资讯检索条件
* @author lkg
* @date 2025/4/23
*/
void
initialData
(
InfoDataSearchCondition
searchCondition
);
/**
* 查找替换信息列表
*
* @param searchCondition 资讯检索条件
* @author lkg
* @date 2025/4/24
*/
IPage
<
SpecialInformation
>
searchForReplaceList
(
InfoDataSearchCondition
searchCondition
);
/**
* 字符串替换
*
* @param searchCondition 资讯检索条件
* @author lkg
* @date 2025/4/23
*/
void
charReplace
(
InfoDataSearchCondition
searchCondition
);
/**
* 打标签
*
* @param searchCondition 资讯检索条件
* @author lkg
* @date 2025/4/23
*/
void
markTag
(
InfoDataSearchCondition
searchCondition
);
/**
* 打标签
*
* @param searchCondition 资讯检索条件
* @author lkg
* @date 2025/4/23
*/
void
removeTag
(
InfoDataSearchCondition
searchCondition
);
}
src/main/java/com/zzsn/event/service/SubjectService.java
浏览文件 @
c311ac86
...
...
@@ -202,4 +202,7 @@ public interface SubjectService extends IService<Subject> {
void
deleteBindNew
(
SubjectPage
subjectPage
);
String
getMinCreateTime
(
List
<
String
>
subjectIdList
);
Subject
subjectUpdateScope
(
String
subjectId
,
String
type
,
String
scop
);
}
src/main/java/com/zzsn/event/service/impl/ClbSubjectHitwordsMapServiceImpl.java
浏览文件 @
c311ac86
...
...
@@ -2,14 +2,23 @@ package com.zzsn.event.service.impl;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.zzsn.event.constant.Constants
;
import
com.zzsn.event.entity.ClbSubjectHitwordsMap
;
import
com.zzsn.event.mapper.ClbSubjectHitwordsMapMapper
;
import
com.zzsn.event.service.ClbSubjectHitwordsMapService
;
import
com.zzsn.event.service.InformationService
;
import
com.zzsn.event.util.RedisUtil
;
import
com.zzsn.event.vo.InfoDataSearchCondition
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.concurrent.CompletableFuture
;
/**
* <p>
...
...
@@ -20,14 +29,52 @@ import java.util.List;
* @since 2025-04-23
*/
@Service
@Slf4j
public
class
ClbSubjectHitwordsMapServiceImpl
extends
ServiceImpl
<
ClbSubjectHitwordsMapMapper
,
ClbSubjectHitwordsMap
>
implements
ClbSubjectHitwordsMapService
{
@Autowired
private
InformationService
informationService
;
@Autowired
RedisUtil
redisUtil
;
@Override
public
void
delEs
(
List
<
ClbSubjectHitwordsMap
>
clbSubjectHitwordsMaps
)
{
//TODO
if
(
CollectionUtils
.
isEmpty
(
clbSubjectHitwordsMaps
))
{
return
;
}
String
subjectId
=
clbSubjectHitwordsMaps
.
get
(
0
).
getSubjectId
();
InfoDataSearchCondition
searchCondition
=
new
InfoDataSearchCondition
();
searchCondition
.
setSubjectId
(
subjectId
);
searchCondition
.
setStatus
(
0
);
searchCondition
.
setKeywordList
(
new
ArrayList
<>());
if
(
CollectionUtil
.
isNotEmpty
(
clbSubjectHitwordsMaps
))
{
for
(
ClbSubjectHitwordsMap
clbSubjectHitwordsMap
:
clbSubjectHitwordsMaps
)
{
if
(
StrUtil
.
isNotBlank
(
clbSubjectHitwordsMap
.
getWordName
()))
{
searchCondition
.
getKeywordList
().
add
(
clbSubjectHitwordsMap
.
getWordName
());
}
}
}
if
(
CollectionUtil
.
isEmpty
(
searchCondition
.
getKeywordList
()))
{
log
.
info
(
"命中词为空,不删除es"
);
return
;
}
log
.
info
(
"delEs:{}"
,
searchCondition
);
CompletableFuture
.
runAsync
(()->
informationService
.
removeWordLabel
(
searchCondition
));
}
@Override
public
void
stopTask
(
InfoDataSearchCondition
searchCondition
)
{
String
flowId
=
searchCondition
.
getFlowId
();
String
subjectId
=
searchCondition
.
getSubjectId
();
List
<
String
>
taskIds
=
baseMapper
.
detail
(
flowId
,
subjectId
);
if
(
CollectionUtil
.
isNotEmpty
(
taskIds
))
{
taskIds
.
forEach
(
taskId
->
{
redisUtil
.
hset
(
Constants
.
SUBJECT_MODEL_DETAIL_BREAK
+
subjectId
,
taskId
,
"1"
);
});
}
}
}
src/main/java/com/zzsn/event/service/impl/InformationServiceImpl.java
浏览文件 @
c311ac86
差异被折叠。
点击展开。
src/main/java/com/zzsn/event/service/impl/SubjectServiceImpl.java
浏览文件 @
c311ac86
...
...
@@ -184,6 +184,16 @@ public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> impl
Map
<
String
,
List
<
ClbModelArrange
>>
collect
=
clbModelArranges
.
stream
().
collect
(
Collectors
.
groupingBy
(
ClbModelArrange:
:
getSubjectId
));
records
.
forEach
(
e
->
e
.
setClbModelArranges
(
collect
.
get
(
e
.
getId
())));
}
Optional
<
SubjectPageVO
>
any
=
records
.
stream
().
filter
(
f
->
StrUtil
.
isNotBlank
(
f
.
getDataScope
())).
findAny
();
if
(
any
.
isPresent
())
{
int
count
=
infoSourceService
.
count
();
records
.
forEach
(
e
->
{
if
(
StrUtil
.
isNotBlank
(
e
.
getDataScope
())
&&
e
.
getDataScope
().
contains
(
"1"
))
{
e
.
setBindSourceNum
(
count
);
}
});
}
}
return
pageList
;
}
...
...
@@ -905,6 +915,47 @@ public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> impl
return
baseMapper
.
getMinCreateTime
(
subjectIdList
);
}
@Override
public
Subject
subjectUpdateScope
(
String
subjectId
,
String
type
,
String
scop
)
{
Subject
byId
=
super
.
getById
(
subjectId
);
if
(
ObjectUtil
.
isNotNull
(
byId
)){
String
dataScope
=
byId
.
getDataScope
();
if
(
StrUtil
.
isNotBlank
(
dataScope
)){
List
<
String
>
scopeList
=
CollectionUtil
.
newArrayList
(
dataScope
.
split
(
","
));
if
(
StrUtil
.
equals
(
type
,
"1"
)
&&
"1"
.
equals
(
scop
)){
scopeList
.
add
(
"1"
);
}
else
if
(
StrUtil
.
equals
(
type
,
"1"
)
&&
"0"
.
equals
(
scop
)){
scopeList
.
remove
(
"1"
);
}
if
(
StrUtil
.
equals
(
type
,
"2"
)
&&
"1"
.
equals
(
scop
)){
scopeList
.
add
(
"2"
);
}
else
if
(
StrUtil
.
equals
(
type
,
"2"
)
&&
"0"
.
equals
(
scop
)){
scopeList
.
remove
(
"2"
);
}
if
(
StrUtil
.
equals
(
type
,
"3"
)
&&
"1"
.
equals
(
scop
)){
scopeList
.
add
(
"3"
);
}
else
if
(
StrUtil
.
equals
(
type
,
"3"
)
&&
"0"
.
equals
(
scop
)){
scopeList
.
remove
(
"3"
);
}
if
(
CollectionUtil
.
isNotEmpty
(
scopeList
))
{
scopeList
=
scopeList
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
String
join
=
StrUtil
.
join
(
","
,
scopeList
);
byId
.
setDataScope
(
join
);
}
else
{
byId
.
setDataScope
(
null
);
}
this
.
updateById
(
byId
);
}
else
{
if
(
"1"
.
equals
(
scop
))
{
byId
.
setDataScope
(
scop
);
}
this
.
updateById
(
byId
);
}
}
return
byId
;
}
private
void
unBindInfoSourceGroup
(
SubjectPage
subjectPage
)
{
String
sourceBindType
=
subjectPage
.
getSourceBindType
();
...
...
src/main/java/com/zzsn/event/util/EsOpUtil.java
浏览文件 @
c311ac86
差异被折叠。
点击展开。
src/main/java/com/zzsn/event/util/HanlpUtil.java
浏览文件 @
c311ac86
...
...
@@ -114,7 +114,7 @@ public class HanlpUtil {
* @创建时间 2020/8/27 19:56
* @Version 1.0
*/
p
rivate
static
int
countKeyWordInContent
(
String
keyword
,
String
srcContent
){
p
ublic
static
int
countKeyWordInContent
(
String
keyword
,
String
srcContent
){
if
(
keyword
==
null
||
keyword
.
trim
().
equals
(
""
)){
return
0
;
}
...
...
src/main/java/com/zzsn/event/vo/InfoDataSearchCondition.java
浏览文件 @
c311ac86
...
...
@@ -50,11 +50,17 @@ public class InfoDataSearchCondition {
/**原创性(0-非原创;1-原创;2-疑似)*/
private
String
originality
;
//资讯状态-研究中心(0-全部;1-模型推荐;2-精选;3-待定;4-移除),和checkStatus、deleteFlag、isFreeCheck互斥
private
Integer
status
;
//审核操作(0:未审核 1:审核通过 2:审核未通过 3:暂定 默认值为0)
private
Integer
checkStatus
;
//删除标记(1:删除;0:未删除)
private
Integer
deleteFlag
=
0
;
private
Integer
deleteFlag
;
//是否免审核(1-是;0-否)
private
Integer
isFreeCheck
;
//关联标签名称
private
String
labelName
;
...
...
@@ -70,7 +76,7 @@ public class InfoDataSearchCondition {
//爬虫类型
private
String
crawler
;
//组合标签查询(不同类标签之间是与的关系,同一类标签之间是或的关系),示例: "a
,b;c,d;e,f
"
//组合标签查询(不同类标签之间是与的关系,同一类标签之间是或的关系),示例: "a
1,a2;c1,c2
"
private
String
composeSearchLabelIds
;
/**----企业类标签筛选----**/
...
...
@@ -104,21 +110,22 @@ public class InfoDataSearchCondition {
//待删除的标签id(多个用逗号隔开)-研究中心
private
String
removeRelationId
;
//关键词信息;推荐信息源时使用-研究中心
private
List
<
String
>
wordsList
;
//是否免审核(1-是;0-否)
private
Integer
isFreeCheck
;
//得分范围-研究中心
//最小得分
private
Integer
minScore
;
//最大得分
private
Integer
maxScore
;
//正文长度-研究中心
//最小长度
private
Integer
minContentLength
;
//最大长度
private
Integer
maxContentLength
;
//es查询字段数组
private
String
[]
fetchFields
;
//排除字段数组
...
...
@@ -126,7 +133,7 @@ public class InfoDataSearchCondition {
//排序参数
//排序字段
private
String
column
=
"publishDate"
;
private
String
column
;
//排序方式 asc/desc
private
String
order
=
"desc"
;
//置顶排序是否起效(1-是;0-否)
...
...
@@ -166,7 +173,23 @@ public class InfoDataSearchCondition {
/*------添加至精选时,主题列表---start-------------------*/
//聚合分组类型-按日期集合分析时使用
private
List
<
Label
>
themeList
;
/*------添加至精选时,主题列表---end-------------------*/
/*------待删除的关键词列表---start-------------------*/
private
List
<
String
>
keywordList
;
/*------待删除的关键词列表---end-------------------*/
/*-----字符串替换---start-------------------*/
private
String
replaceWord
;
/*------字符串替换---end-------------------*/
/*-----打标签---start-------------------*/
private
List
<
Label
>
markTags
;
/*------打标签---end-------------------*/
/**
* 本次任务使用的流程id
*/
private
String
flowId
;
}
src/main/java/com/zzsn/event/vo/InfoSourceCondition.java
浏览文件 @
c311ac86
...
...
@@ -30,7 +30,7 @@ public class InfoSourceCondition {
/**
* 爬虫类别
*/
private
int
crawlType
;
private
Integer
crawlType
;
/**
* 专题id/事件id-获取专题绑定信息源信息时使用
...
...
src/main/java/com/zzsn/event/vo/SubjectPageVO.java
浏览文件 @
c311ac86
...
...
@@ -27,6 +27,7 @@ public class SubjectPageVO {
private
String
subjectTypeName
;
/**专题所属项目名称*/
private
String
projectName
;
private
String
dataScope
;
/**信息总数量*/
private
Integer
totalNum
;
...
...
src/main/java/com/zzsn/event/vo/es/DisplayInfo.java
浏览文件 @
c311ac86
...
...
@@ -44,6 +44,8 @@ public class DisplayInfo {
private
String
summaryRaw
;
//关键词
private
String
keyWords
;
//命中词列表
private
List
<
String
>
keyWordsList
;
//标题
private
String
title
;
private
String
titleRaw
;
...
...
@@ -54,6 +56,8 @@ public class DisplayInfo {
private
String
type
;
//标签信息
private
List
<
Label
>
labels
;
//排序字段信息
private
List
<
SortField
>
sortField
;
//模型打分信息
private
List
<
ModelScore
>
modelScores
;
//视频下载链接
...
...
src/main/java/com/zzsn/event/vo/es/SortField.java
0 → 100644
浏览文件 @
c311ac86
package
com
.
zzsn
.
event
.
vo
.
es
;
import
lombok.Data
;
/**
* 排序字段
*
* @author lkg
* @date 2025/4/22
*/
@Data
public
class
SortField
{
//字段 (摘要、内容、标签、词频统计)
private
String
fieldType
;
//字段排序值
private
String
fieldKeyword
;
//词频
private
Long
fieldLong
;
public
SortField
(
String
fieldType
,
Long
fieldLong
)
{
this
.
fieldType
=
fieldType
;
this
.
fieldLong
=
fieldLong
;
}
public
SortField
(
String
fieldType
,
String
fieldKeyword
)
{
this
.
fieldType
=
fieldType
;
this
.
fieldKeyword
=
fieldKeyword
;
}
}
src/main/java/com/zzsn/event/vo/es/SpecialInformation.java
浏览文件 @
c311ac86
...
...
@@ -53,6 +53,8 @@ public class SpecialInformation {
private
String
type
;
//标签信息
private
List
<
Label
>
labels
;
//排序字段信息
private
List
<
SortField
>
sortField
;
//模型打分信息
private
List
<
ModelScore
>
modelScores
;
//视频下载链接
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论