Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
E
event
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
陈世强
event
Commits
dd9df705
提交
dd9df705
authored
2月 13, 2025
作者:
925993793@qq.com
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
自定义专题配置编辑/校验bug处理、信息源绑定逻辑修改
上级
852f71fb
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
16 个修改的文件
包含
238 行增加
和
149 行删除
+238
-149
SubjectManageController.java
...va/com/zzsn/event/controller/SubjectManageController.java
+57
-41
Subject.java
src/main/java/com/zzsn/event/entity/Subject.java
+0
-1
EsService.java
src/main/java/com/zzsn/event/es/EsService.java
+28
-1
InfoSourceMapper.java
src/main/java/com/zzsn/event/mapper/InfoSourceMapper.java
+9
-25
InfoSourceMapper.xml
src/main/java/com/zzsn/event/mapper/xml/InfoSourceMapper.xml
+8
-13
IInfoSourceService.java
src/main/java/com/zzsn/event/service/IInfoSourceService.java
+8
-25
InfoSourceServiceImpl.java
...va/com/zzsn/event/service/impl/InfoSourceServiceImpl.java
+40
-20
InformationServiceImpl.java
...a/com/zzsn/event/service/impl/InformationServiceImpl.java
+0
-7
SubjectSimpleServiceImpl.java
...com/zzsn/event/service/impl/SubjectSimpleServiceImpl.java
+0
-0
PythonUtil.java
src/main/java/com/zzsn/event/util/PythonUtil.java
+1
-1
InfoDataSearchCondition.java
src/main/java/com/zzsn/event/vo/InfoDataSearchCondition.java
+10
-2
SubjectBindDirectSourceVO.java
...ain/java/com/zzsn/event/vo/SubjectBindDirectSourceVO.java
+24
-0
SubjectParamsCheckVO.java
src/main/java/com/zzsn/event/vo/SubjectParamsCheckVO.java
+2
-5
SubjectSourceVO.java
src/main/java/com/zzsn/event/vo/SubjectSourceVO.java
+7
-1
application-dev.yml
src/main/resources/application-dev.yml
+19
-5
application-pro.yml
src/main/resources/application-pro.yml
+25
-2
没有找到文件。
src/main/java/com/zzsn/event/controller/SubjectManageController.java
浏览文件 @
dd9df705
...
...
@@ -95,7 +95,7 @@ public class SubjectManageController {
private
KafkaTemplate
<
String
,
String
>
kafkaTemplate
;
@Autowired
private
PythonUtil
pythonUtil
;
@Autowired
@Autowired
(
required
=
false
)
private
RemoteModelService
remoteModelService
;
...
...
@@ -735,7 +735,7 @@ public class SubjectManageController {
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
);
IPage
<
SubjectBindDirectSourceVO
>
page
=
infoSourceService
.
subjectBindDirectSourcePageList
(
subjectId
,
pageNo
,
pageSize
);
return
Result
.
OK
(
page
);
}
...
...
@@ -752,24 +752,7 @@ public class SubjectManageController {
public
Result
<?>
directSourcePageList
(
@RequestParam
(
required
=
false
)
String
searchWord
,
@RequestParam
(
defaultValue
=
"1"
)
Integer
pageNo
,
@RequestParam
(
defaultValue
=
"10"
)
Integer
pageSize
)
{
IPage
<
String
>
page
=
infoSourceService
.
directSourcePageList
(
searchWord
,
pageNo
,
pageSize
);
return
Result
.
OK
(
page
);
}
/**
* 信息源下栏目分页列表(专题绑定定向信息源时使用-研究中心)
*
* @param webSiteName 信息源名称
* @param pageNo 当前页
* @param pageSize 返回条数
* @author lkg
* @date 2025/1/4
*/
@GetMapping
(
"/directInfoSourceColumnPageList"
)
public
Result
<?>
directSourceColumnPageList
(
String
webSiteName
,
@RequestParam
(
defaultValue
=
"1"
)
Integer
pageNo
,
@RequestParam
(
defaultValue
=
"10"
)
Integer
pageSize
)
{
IPage
<
InfoSource
>
page
=
infoSourceService
.
directSourceColumnPageList
(
webSiteName
,
pageNo
,
pageSize
);
IPage
<
SubjectBindDirectSourceVO
>
page
=
infoSourceService
.
directSourcePageList
(
searchWord
,
pageNo
,
pageSize
);
return
Result
.
OK
(
page
);
}
...
...
@@ -782,17 +765,38 @@ public class SubjectManageController {
*/
@PostMapping
(
"/bindDirectInfoSource"
)
public
Result
<?>
bindDirectInfoSource
(
@RequestBody
SubjectSourceVO
subjectSourceVO
)
{
List
<
InfoSource
>
infoSources
=
infoSourceService
.
directSourceColumnList
(
subjectSourceVO
.
getWebSiteName
());
if
(
CollectionUtils
.
isNotEmpty
(
infoSources
))
{
List
<
SubjectInfoSourceMap
>
dataList
=
new
ArrayList
<>();
for
(
InfoSource
source
:
infoSources
)
{
SubjectInfoSourceMap
subjectInfoSourceMap
=
new
SubjectInfoSourceMap
();
subjectInfoSourceMap
.
setSubjectId
(
subjectSourceVO
.
getSubjectId
());
subjectInfoSourceMap
.
setSourceId
(
source
.
getId
());
subjectInfoSourceMap
.
setType
(
1
);
dataList
.
add
(
subjectInfoSourceMap
);
List
<
String
>
sourceIdList
=
subjectSourceVO
.
getSourceIdList
();
if
(
CollectionUtils
.
isEmpty
(
sourceIdList
))
{
LambdaQueryWrapper
<
InfoSource
>
queryWrapper
=
Wrappers
.
lambdaQuery
();
queryWrapper
.
select
(
InfoSource:
:
getId
,
InfoSource:
:
getSiteName
,
InfoSource:
:
getSiteUri
)
.
in
(
InfoSource:
:
getWebSiteName
,
subjectSourceVO
.
getWebSiteNameList
())
.
groupBy
(
InfoSource:
:
getId
);
List
<
InfoSource
>
infoSources
=
infoSourceService
.
list
(
queryWrapper
);
if
(
CollectionUtils
.
isNotEmpty
(
infoSources
))
{
sourceIdList
=
infoSources
.
stream
().
map
(
InfoSource:
:
getId
).
collect
(
Collectors
.
toList
());
}
}
if
(
CollectionUtils
.
isNotEmpty
(
sourceIdList
))
{
LambdaQueryWrapper
<
SubjectInfoSourceMap
>
queryWrapper
=
Wrappers
.
lambdaQuery
();
queryWrapper
.
eq
(
SubjectInfoSourceMap:
:
getSubjectId
,
subjectSourceVO
.
getSubjectId
())
.
in
(
SubjectInfoSourceMap:
:
getSourceId
,
sourceIdList
)
.
eq
(
SubjectInfoSourceMap:
:
getType
,
1
);
List
<
SubjectInfoSourceMap
>
list
=
subjectInfoSourceMapService
.
list
(
queryWrapper
);
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
List
<
String
>
existSourceIdList
=
list
.
stream
().
map
(
SubjectInfoSourceMap:
:
getSourceId
).
collect
(
Collectors
.
toList
());
sourceIdList
.
removeAll
(
existSourceIdList
);
}
if
(
CollectionUtils
.
isNotEmpty
(
sourceIdList
))
{
List
<
SubjectInfoSourceMap
>
dataList
=
new
ArrayList
<>();
for
(
String
sourceId
:
sourceIdList
)
{
SubjectInfoSourceMap
subjectInfoSourceMap
=
new
SubjectInfoSourceMap
();
subjectInfoSourceMap
.
setSubjectId
(
subjectSourceVO
.
getSubjectId
());
subjectInfoSourceMap
.
setSourceId
(
sourceId
);
subjectInfoSourceMap
.
setType
(
1
);
dataList
.
add
(
subjectInfoSourceMap
);
}
subjectInfoSourceMapService
.
saveBatch
(
dataList
);
}
subjectInfoSourceMapService
.
saveBatch
(
dataList
);
}
return
Result
.
OK
();
}
...
...
@@ -848,17 +852,29 @@ public class SubjectManageController {
* @date 2025/1/9
*/
@PostMapping
(
"/removeDirectInfoSource"
)
public
Result
<?>
removeDirectInfoSource
(
@RequestBody
List
<
JSONObject
>
params
){
for
(
JSONObject
param
:
params
)
{
String
subjectId
=
param
.
get
(
"subjectId"
).
toString
();
String
webSiteName
=
param
.
get
(
"webSiteName"
).
toString
();
String
status
=
param
.
get
(
"status"
).
toString
();
if
(
"1"
.
equals
(
status
))
{
List
<
InfoSource
>
infoSources
=
infoSourceService
.
directSourceColumnList
(
webSiteName
);
List
<
String
>
sourceIds
=
infoSources
.
stream
().
map
(
InfoSource:
:
getId
).
collect
(
Collectors
.
toList
());
subjectInfoSourceMapService
.
remove
(
new
LambdaQueryWrapper
<
SubjectInfoSourceMap
>().
eq
(
SubjectInfoSourceMap:
:
getSubjectId
,
subjectId
).
in
(
SubjectInfoSourceMap:
:
getSourceId
,
sourceIds
));
}
else
if
(
"0"
.
equals
(
status
))
{
subjectInfoSourceMiddleMapService
.
remove
(
new
LambdaQueryWrapper
<
SubjectInfoSourceMiddleMap
>().
eq
(
SubjectInfoSourceMiddleMap:
:
getSubjectId
,
subjectId
).
eq
(
SubjectInfoSourceMiddleMap:
:
getInfoSourceName
,
webSiteName
));
public
Result
<?>
removeDirectInfoSource
(
@RequestBody
List
<
SubjectBindDirectSourceVO
>
params
){
for
(
SubjectBindDirectSourceVO
param
:
params
)
{
String
subjectId
=
param
.
getSubjectId
();
String
webSiteName
=
param
.
getWebSiteName
();
Integer
status
=
param
.
getStatus
();
if
(
status
==
1
)
{
List
<
String
>
sourceIdList
;
List
<
InfoSource
>
children
=
param
.
getChildren
();
if
(
CollectionUtils
.
isNotEmpty
(
children
))
{
sourceIdList
=
children
.
stream
().
map
(
InfoSource:
:
getId
).
collect
(
Collectors
.
toList
());
}
else
{
List
<
String
>
webSiteNameList
=
new
ArrayList
<>();
webSiteNameList
.
add
(
webSiteName
);
List
<
InfoSource
>
infoSources
=
infoSourceService
.
subjectBindSourceColumnList
(
subjectId
,
webSiteNameList
);
sourceIdList
=
infoSources
.
stream
().
map
(
InfoSource:
:
getId
).
collect
(
Collectors
.
toList
());
}
subjectInfoSourceMapService
.
remove
(
new
LambdaQueryWrapper
<
SubjectInfoSourceMap
>()
.
eq
(
SubjectInfoSourceMap:
:
getSubjectId
,
subjectId
)
.
in
(
SubjectInfoSourceMap:
:
getSourceId
,
sourceIdList
));
}
else
if
(
status
==
0
)
{
subjectInfoSourceMiddleMapService
.
remove
(
new
LambdaQueryWrapper
<
SubjectInfoSourceMiddleMap
>()
.
eq
(
SubjectInfoSourceMiddleMap:
:
getSubjectId
,
subjectId
)
.
eq
(
SubjectInfoSourceMiddleMap:
:
getInfoSourceName
,
webSiteName
));
}
}
return
Result
.
OK
();
...
...
src/main/java/com/zzsn/event/entity/Subject.java
浏览文件 @
dd9df705
...
...
@@ -104,7 +104,6 @@ public class Subject implements Serializable {
/**是否是平台创建的专题(0否--外部创建 1是--平台创建 )*/
private
String
isPlatform
;
/**第一次启用时间*/
@TableField
(
updateStrategy
=
FieldStrategy
.
IGNORED
)
@JsonFormat
(
timezone
=
"GMT+8"
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
firstOpenTime
;
...
...
src/main/java/com/zzsn/event/es/EsService.java
浏览文件 @
dd9df705
...
...
@@ -78,7 +78,8 @@ public class EsService {
private
LabelEntityService
labelEntityService
;
@Autowired
private
ISubjectKeywordsMapService
subjectKeywordsMapService
;
@Autowired
private
CommonService
commonService
;
/**
* 获取专题下的资讯
...
...
@@ -1787,12 +1788,38 @@ public class EsService {
if
(
StringUtils
.
isNotBlank
(
crawler
))
{
boolQuery
.
must
(
QueryBuilders
.
termQuery
(
"source.keyword"
,
crawler
));
}
//关联标签id集合
List
<
String
>
labelIds
=
searchCondition
.
getLabelIds
();
if
(
CollectionUtils
.
isNotEmpty
(
labelIds
))
{
Set
<
String
>
relationIdSet
=
new
HashSet
<>(
labelIds
);
TermsQueryBuilder
relationIdQuery
=
QueryBuilders
.
termsQuery
(
"labels.relationId"
,
relationIdSet
);
boolQuery
.
must
(
QueryBuilders
.
nestedQuery
(
"labels"
,
relationIdQuery
,
ScoreMode
.
None
));
}
//正面标签
String
tendencyLabelId
=
searchCondition
.
getTendencyLabelId
();
if
(
StringUtils
.
isNotBlank
(
tendencyLabelId
))
{
TermQueryBuilder
relationIdQuery
=
QueryBuilders
.
termQuery
(
"labels.relationId"
,
tendencyLabelId
);
boolQuery
.
must
(
QueryBuilders
.
nestedQuery
(
"labels"
,
relationIdQuery
,
ScoreMode
.
None
));
}
//地域标签
List
<
String
>
areaLabelIds
=
searchCondition
.
getAreaLabelIds
();
if
(
CollectionUtils
.
isNotEmpty
(
areaLabelIds
))
{
Set
<
String
>
relationIdSet
=
new
HashSet
<>(
areaLabelIds
);
TermsQueryBuilder
relationIdQuery
=
QueryBuilders
.
termsQuery
(
"labels.relationId"
,
relationIdSet
);
boolQuery
.
must
(
QueryBuilders
.
nestedQuery
(
"labels"
,
relationIdQuery
,
ScoreMode
.
None
));
}
//企业标签
List
<
String
>
enterpriseLabelTypeIds
=
searchCondition
.
getEnterpriseLabelTypeIds
();
List
<
String
>
socialCreditCodeList
=
searchCondition
.
getSocialCreditCodeList
();
if
(
CollectionUtils
.
isNotEmpty
(
socialCreditCodeList
)
||
CollectionUtils
.
isNotEmpty
(
enterpriseLabelTypeIds
))
{
if
(
CollectionUtils
.
isEmpty
(
socialCreditCodeList
))
{
socialCreditCodeList
=
commonService
.
codesByLabels
(
enterpriseLabelTypeIds
);
}
Set
<
String
>
codeSet
=
new
HashSet
<>(
socialCreditCodeList
);
TermsQueryBuilder
relationIdQuery
=
QueryBuilders
.
termsQuery
(
"labels.relationId"
,
codeSet
);
boolQuery
.
must
(
QueryBuilders
.
nestedQuery
(
"labels"
,
relationIdQuery
,
ScoreMode
.
None
));
}
//信息源标签
List
<
Label
>
labelList
=
searchCondition
.
getLabelList
();
if
(
CollectionUtils
.
isNotEmpty
(
labelList
))
{
List
<
String
>
collect
=
labelList
.
stream
().
map
(
label
->
label
.
getLabelMark
()
+
"-"
+
label
.
getRelationId
()).
collect
(
Collectors
.
toList
());
...
...
src/main/java/com/zzsn/event/mapper/InfoSourceMapper.java
浏览文件 @
dd9df705
...
...
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
com.zzsn.event.vo.InfoSourceCondition
;
import
com.zzsn.event.vo.InfoSourceVo
;
import
com.zzsn.event.entity.InfoSource
;
import
com.zzsn.event.vo.SubjectBindDirectSourceVO
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
...
...
@@ -38,7 +39,7 @@ public interface InfoSourceMapper extends BaseMapper<InfoSource> {
* @author lkg
* @date 2024/5/7
*/
List
<
InfoSourceVo
>
queryInfoSource
(
@Param
(
"sourceIdList"
)
List
<
String
>
sourceIdList
,
@Param
(
"subjectIds"
)
List
<
String
>
subjectIds
);
List
<
InfoSourceVo
>
queryInfoSource
(
@Param
(
"sourceIdList"
)
List
<
String
>
sourceIdList
,
@Param
(
"subjectIds"
)
List
<
String
>
subjectIds
);
/**
* 专题绑定的信息源集合
...
...
@@ -68,7 +69,7 @@ public interface InfoSourceMapper extends BaseMapper<InfoSource> {
* @author lkg
* @date 2025/2/6
*/
List
<
InfoSourceVo
>
bindGroupSourceIdList
(
@Param
(
"subjectIds"
)
List
<
String
>
subjectIds
,
@Param
(
"sourceIds"
)
List
<
String
>
sourceIds
);
List
<
InfoSourceVo
>
bindGroupSourceIdList
(
@Param
(
"subjectIds"
)
List
<
String
>
subjectIds
,
@Param
(
"sourceIds"
)
List
<
String
>
sourceIds
);
/**
* 专题直接屏蔽的信息源列表(不包括专题屏蔽的信息源组下的信息源)
...
...
@@ -88,7 +89,7 @@ public interface InfoSourceMapper extends BaseMapper<InfoSource> {
* @author lkg
* @date 2025/1/6
*/
Page
<
Map
<
String
,
Object
>
>
subjectBindDirectInfoSourceList
(
@Param
(
"subjectId"
)
String
subjectId
,
Page
<
Map
<
String
,
Object
>>
page
);
Page
<
SubjectBindDirectSourceVO
>
subjectBindDirectInfoSourceList
(
@Param
(
"subjectId"
)
String
subjectId
,
Page
<
Map
<
String
,
Object
>>
page
);
/**
...
...
@@ -99,35 +100,18 @@ public interface InfoSourceMapper extends BaseMapper<InfoSource> {
* @author lkg
* @date 2025/1/4
*/
Page
<
S
tring
>
infoSourcePageList
(
@Param
(
"searchWord"
)
String
searchWord
,
Page
<
String
>
page
);
Page
<
S
ubjectBindDirectSourceVO
>
infoSourcePageList
(
@Param
(
"searchWord"
)
String
searchWord
,
Page
<
String
>
page
);
/**
* 信息源下
栏目分页
列表(专题绑定定向信息源时使用-研究中心)
* 信息源下
专题绑定的栏目
列表(专题绑定定向信息源时使用-研究中心)
*
* @param
webSiteName 信息源名称
* @param
page 分页参数
* @param
subjectId 专题id
* @param
webSiteNames 信息源名称
* @author lkg
* @date 2025/1/4
*/
Page
<
InfoSource
>
directSourceColumnList
(
@Param
(
"webSiteName"
)
String
webSiteName
,
Page
<
InfoSource
>
page
);
List
<
InfoSource
>
subjectBindSourceColumnList
(
@Param
(
"subjectId"
)
String
subjectId
,
@Param
(
"webSiteNames"
)
List
<
String
>
webSiteNames
);
/**
* 信息源下栏目列表(专题绑定定向信息源时使用-研究中心)
*
* @param webSiteName 信息源名称
* @author lkg
* @date 2025/1/4
*/
List
<
InfoSource
>
directSourceColumnList
(
@Param
(
"webSiteName"
)
String
webSiteName
);
/**
* 信息源下栏目id列表(校验专题配置时使用-研究中心)
*
* @param webSiteNames 信息源名称集合
* @author lkg
* @date 2025/1/4
*/
Set
<
String
>
directSourceColumnSet
(
@Param
(
"webSiteNames"
)
List
<
String
>
webSiteNames
);
IPage
<
InfoSourceVo
>
bindSourceIdPageList
(
Page
<
InfoSourceVo
>
page
,
@Param
(
"infoSourceVo"
)
InfoSourceCondition
infoSourceCondition
,
@Param
(
"subjectIds"
)
List
<
String
>
subjectIds
);
}
src/main/java/com/zzsn/event/mapper/xml/InfoSourceMapper.xml
浏览文件 @
dd9df705
...
...
@@ -334,7 +334,7 @@
</select>
<select
id=
"subjectBindDirectInfoSourceList"
resultType=
"
Map
"
>
<select
id=
"subjectBindDirectInfoSourceList"
resultType=
"
com.zzsn.event.vo.SubjectBindDirectSourceVO
"
>
select a.*
from (
select iso.web_site_name as webSiteName, 1 as `status`
...
...
@@ -351,31 +351,26 @@
order by a.status desc, a.webSiteName asc
</select>
<select
id=
"infoSourcePageList"
resultType=
"
String
"
>
<select
id=
"infoSourcePageList"
resultType=
"
com.zzsn.event.vo.SubjectBindDirectSourceVO
"
>
select iso.web_site_name
from info_source iso where 1=1
<if
test=
"searchWord!=null and searchWord != ''"
>
and (
iso.web_site_name like CONCAT('%',#{searchWord},'%')
)
and iso.web_site_name like CONCAT('%',#{searchWord},'%')
</if>
group by iso.web_site_name
</select>
<select
id=
"
direct
SourceColumnList"
resultType=
"com.zzsn.event.entity.InfoSource"
>
select iso.id, iso.site_name, iso.site_uri
<select
id=
"
subjectBind
SourceColumnList"
resultType=
"com.zzsn.event.entity.InfoSource"
>
select iso.id, iso.
web_site_name,iso.
site_name, iso.site_uri
from info_source iso
where iso.web_site_name = #{webSiteName}
</select>
<select
id=
"directSourceColumnSet"
resultType=
"String"
>
select iso.id from info_source iso
where 1=1
inner join subject_info_source_map sm on iso.id = sm.source_id and sm.type = 1
where sm.subject_id = #{subjectId}
<if
test=
"webSiteNames != null and webSiteNames.size() > 0"
>
and iso.web_site_name in
<foreach
collection=
"webSiteNames"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
group by iso.id
</select>
</mapper>
src/main/java/com/zzsn/event/service/IInfoSourceService.java
浏览文件 @
dd9df705
...
...
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import
com.zzsn.event.vo.InfoSourceCondition
;
import
com.zzsn.event.vo.InfoSourceVo
;
import
com.zzsn.event.entity.InfoSource
;
import
com.zzsn.event.vo.SubjectBindDirectSourceVO
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -64,7 +65,7 @@ public interface IInfoSourceService extends IService<InfoSource> {
* @author lkg
* @date 2025/1/4
*/
IPage
<
Map
<
String
,
Object
>
>
subjectBindDirectSourcePageList
(
String
subjectId
,
Integer
pageNo
,
Integer
pageSize
);
IPage
<
SubjectBindDirectSourceVO
>
subjectBindDirectSourcePageList
(
String
subjectId
,
Integer
pageNo
,
Integer
pageSize
);
/**
* 信息源分页列表(专题绑定定向信息源时使用-研究中心)
...
...
@@ -75,37 +76,19 @@ public interface IInfoSourceService extends IService<InfoSource> {
* @author lkg
* @date 2025/1/4
*/
IPage
<
S
tring
>
directSourcePageList
(
String
searchWord
,
Integer
pageNo
,
Integer
pageSize
);
IPage
<
S
ubjectBindDirectSourceVO
>
directSourcePageList
(
String
searchWord
,
Integer
pageNo
,
Integer
pageSize
);
/**
* 信息源下栏目分页列表(专题绑定定向信息源时使用-研究中心)
*
* @param webSiteName 信息源名称
* @param pageNo 当前页
* @param pageSize 返回条数
* @author lkg
* @date 2025/1/4
*/
IPage
<
InfoSource
>
directSourceColumnPageList
(
String
webSiteName
,
Integer
pageNo
,
Integer
pageSize
);
/**
* 信息源下栏目列表(专题绑定定向信息源时使用-研究中心)
*
* @param webSiteName 信息源名称
* @author lkg
* @date 2025/1/4
*/
List
<
InfoSource
>
directSourceColumnList
(
String
webSiteName
);
IPage
<
InfoSourceVo
>
bindInfoSourcePageList
(
InfoSourceCondition
infoSourceCondition
,
List
<
String
>
subjectIdList
,
Integer
pageNo
,
Integer
pageSize
);
/**
* 信息源下
栏目id列表(校验专题配置
时使用-研究中心)
* 信息源下
专题绑定的栏目列表(专题绑定定向信息源
时使用-研究中心)
*
* @param subjectId 专题id
* @param webSiteNames 信息源名称集合
* @author lkg
* @date 2025/
1/4
* @date 2025/
2/12
*/
Set
<
String
>
directSourceColumnSet
(
List
<
String
>
webSiteNames
);
IPage
<
InfoSourceVo
>
bindInfoSourcePageList
(
InfoSourceCondition
infoSourceCondition
,
List
<
String
>
subjectIdList
,
Integer
pageNo
,
Integer
pageSize
);
List
<
InfoSource
>
subjectBindSourceColumnList
(
String
subjectId
,
List
<
String
>
webSiteNames
);
}
src/main/java/com/zzsn/event/service/impl/InfoSourceServiceImpl.java
浏览文件 @
dd9df705
...
...
@@ -4,7 +4,9 @@ import cn.hutool.core.date.DateField;
import
cn.hutool.core.date.DateTime
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.util.ObjectUtil
;
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.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.zzsn.event.entity.InfoSource
;
...
...
@@ -14,6 +16,7 @@ import com.zzsn.event.service.IInfoSourceService;
import
com.zzsn.event.vo.InfoSourceCondition
;
import
com.zzsn.event.vo.InfoSourceVo
;
import
com.zzsn.event.vo.NumVO
;
import
com.zzsn.event.vo.SubjectBindDirectSourceVO
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -124,31 +127,43 @@ public class InfoSourceServiceImpl extends ServiceImpl<InfoSourceMapper, InfoSou
}
@Override
public
IPage
<
Map
<
String
,
Object
>
>
subjectBindDirectSourcePageList
(
String
subjectId
,
Integer
pageNo
,
Integer
pageSize
)
{
public
IPage
<
SubjectBindDirectSourceVO
>
subjectBindDirectSourcePageList
(
String
subjectId
,
Integer
pageNo
,
Integer
pageSize
)
{
Page
<
Map
<
String
,
Object
>>
page
=
new
Page
<>(
pageNo
,
pageSize
);
return
baseMapper
.
subjectBindDirectInfoSourceList
(
subjectId
,
page
);
Page
<
SubjectBindDirectSourceVO
>
pageList
=
baseMapper
.
subjectBindDirectInfoSourceList
(
subjectId
,
page
);
List
<
SubjectBindDirectSourceVO
>
records
=
pageList
.
getRecords
();
if
(
CollectionUtils
.
isNotEmpty
(
records
))
{
List
<
String
>
webSiteNames
=
records
.
stream
().
map
(
SubjectBindDirectSourceVO:
:
getWebSiteName
).
collect
(
Collectors
.
toList
());
List
<
InfoSource
>
bindSourceColumnList
=
this
.
subjectBindSourceColumnList
(
subjectId
,
webSiteNames
);
Map
<
String
,
List
<
InfoSource
>>
webSiteNameMap
=
bindSourceColumnList
.
stream
().
collect
(
Collectors
.
groupingBy
(
InfoSource:
:
getWebSiteName
));
for
(
SubjectBindDirectSourceVO
subjectBindDirectSourceVO
:
records
)
{
Integer
status
=
subjectBindDirectSourceVO
.
getStatus
();
if
(
status
==
1
)
{
List
<
InfoSource
>
infoSources
=
webSiteNameMap
.
get
(
subjectBindDirectSourceVO
.
getWebSiteName
());
subjectBindDirectSourceVO
.
setChildren
(
infoSources
);
}
}
}
return
pageList
;
}
@Override
public
IPage
<
S
tring
>
directSourcePageList
(
String
searchWord
,
Integer
pageNo
,
Integer
pageSize
)
{
public
IPage
<
S
ubjectBindDirectSourceVO
>
directSourcePageList
(
String
searchWord
,
Integer
pageNo
,
Integer
pageSize
)
{
Page
<
String
>
page
=
new
Page
<>(
pageNo
,
pageSize
);
return
baseMapper
.
infoSourcePageList
(
searchWord
,
page
);
}
@Override
public
IPage
<
InfoSource
>
directSourceColumnPageList
(
String
webSiteName
,
Integer
pageNo
,
Integer
pageSize
)
{
Page
<
InfoSource
>
page
=
new
Page
<>(
pageNo
,
pageSize
);
return
baseMapper
.
directSourceColumnList
(
webSiteName
,
page
);
}
@Override
public
List
<
InfoSource
>
directSourceColumnList
(
String
webSiteName
)
{
return
baseMapper
.
directSourceColumnList
(
webSiteName
);
}
@Override
public
Set
<
String
>
directSourceColumnSet
(
List
<
String
>
webSiteNames
)
{
return
baseMapper
.
directSourceColumnSet
(
webSiteNames
);
Page
<
SubjectBindDirectSourceVO
>
pageList
=
baseMapper
.
infoSourcePageList
(
searchWord
,
page
);
List
<
SubjectBindDirectSourceVO
>
records
=
pageList
.
getRecords
();
if
(
CollectionUtils
.
isNotEmpty
(
records
))
{
List
<
String
>
webSiteNames
=
records
.
stream
().
map
(
SubjectBindDirectSourceVO:
:
getWebSiteName
).
collect
(
Collectors
.
toList
());
LambdaQueryWrapper
<
InfoSource
>
queryWrapper
=
Wrappers
.
lambdaQuery
();
queryWrapper
.
select
(
InfoSource:
:
getId
,
InfoSource:
:
getWebSiteName
,
InfoSource:
:
getSiteName
,
InfoSource:
:
getSiteUri
)
.
in
(
InfoSource:
:
getWebSiteName
,
webSiteNames
);
List
<
InfoSource
>
children
=
this
.
list
(
queryWrapper
);
Map
<
String
,
List
<
InfoSource
>>
webSiteNameMap
=
children
.
stream
().
collect
(
Collectors
.
groupingBy
(
InfoSource:
:
getWebSiteName
));
for
(
SubjectBindDirectSourceVO
subjectBindDirectSourceVO
:
records
)
{
List
<
InfoSource
>
infoSources
=
webSiteNameMap
.
get
(
subjectBindDirectSourceVO
.
getWebSiteName
());
subjectBindDirectSourceVO
.
setChildren
(
infoSources
);
}
}
return
pageList
;
}
@Override
...
...
@@ -215,4 +230,9 @@ public class InfoSourceServiceImpl extends ServiceImpl<InfoSourceMapper, InfoSou
}
return
pageList
;
}
@Override
public
List
<
InfoSource
>
subjectBindSourceColumnList
(
String
subjectId
,
List
<
String
>
webSiteNames
)
{
return
baseMapper
.
subjectBindSourceColumnList
(
subjectId
,
webSiteNames
);
}
}
src/main/java/com/zzsn/event/service/impl/InformationServiceImpl.java
浏览文件 @
dd9df705
...
...
@@ -117,13 +117,6 @@ public class InformationServiceImpl implements InformationService {
subjectIdList
=
subjectTypeMapService
.
selectEventByTypeIds
(
typeIds
);
}
}
List
<
String
>
relationIds
=
searchCondition
.
getLabelIds
();
List
<
String
>
labelTypeIds
=
searchCondition
.
getLabelTypeIds
();
if
(
CollectionUtils
.
isNotEmpty
(
labelTypeIds
))
{
List
<
String
>
socialCreditCodeList
=
commonService
.
codesByLabels
(
labelTypeIds
);
relationIds
.
addAll
(
socialCreditCodeList
);
}
searchCondition
.
setLabelIds
(
relationIds
);
try
{
IPage
<
SpecialInformation
>
specialInformationIPage
=
esService
.
pageListByCondition
(
searchCondition
,
subjectIdList
);
long
total
=
specialInformationIPage
.
getTotal
();
...
...
src/main/java/com/zzsn/event/service/impl/SubjectSimpleServiceImpl.java
浏览文件 @
dd9df705
差异被折叠。
点击展开。
src/main/java/com/zzsn/event/util/PythonUtil.java
浏览文件 @
dd9df705
...
...
@@ -120,7 +120,7 @@ public class PythonUtil {
if
(
isHandleSuccess
.
equals
(
"true"
))
{
log
.
info
(
"专题-{},清空数据,调用python接口清空去重服务历史数据请求发送成功"
,
subjectId
);
}
else
{
log
.
info
(
"python清空去重服务历史数据接口异常
"
);
log
.
info
(
"python清空去重服务历史数据接口异常
:{}"
,
jsonObject
.
getString
(
"logs"
)
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
...
...
src/main/java/com/zzsn/event/vo/InfoDataSearchCondition.java
浏览文件 @
dd9df705
...
...
@@ -61,11 +61,19 @@ public class InfoDataSearchCondition {
private
String
isSubject
=
"1"
;
//爬虫类型
private
String
crawler
;
/**----企业类标签筛选----**/
//企业类标签id集合
private
List
<
String
>
labelTypeIds
;
private
List
<
String
>
enterpriseLabelTypeIds
;
//企业信用代码集合
private
List
<
String
>
socialCreditCodeList
;
/**----企业类标签id集合----**/
//关联标签值id集合
private
List
<
String
>
labelIds
;
//关联标签集合
//正负面标签
private
String
tendencyLabelId
;
//地域标签id集合
private
List
<
String
>
areaLabelIds
;
//关联信息源标签集合
private
List
<
Label
>
labelList
;
//信息源id
private
String
sourceId
;
...
...
src/main/java/com/zzsn/event/vo/SubjectBindDirectSourceVO.java
0 → 100644
浏览文件 @
dd9df705
package
com
.
zzsn
.
event
.
vo
;
import
com.zzsn.event.entity.InfoSource
;
import
lombok.Data
;
import
java.util.List
;
/**
* 专题绑定信息源
*
* @author lkg
* @date 2025/2/12
*/
@Data
public
class
SubjectBindDirectSourceVO
{
/**专题id*/
private
String
subjectId
;
/**信息源名称*/
private
String
webSiteName
;
/**状态(1-已配置;0-待配置)*/
private
Integer
status
;
/**信息源栏目集合*/
private
List
<
InfoSource
>
children
;
}
src/main/java/com/zzsn/event/vo/SubjectParamsCheckVO.java
浏览文件 @
dd9df705
...
...
@@ -19,9 +19,6 @@ public class SubjectParamsCheckVO {
/**信息源标签*/
private
SubjectSourceTagVO
subjectSourceTagVO
;
/**信息源名称列表*/
private
List
<
String
>
infoSourceWebSiteNames
;
/**信息源id列表-推荐信息源*/
private
List
<
String
>
infoSourceIds
;
/**定向信息源是否发生变化*/
private
boolean
directSourceChange
;
}
src/main/java/com/zzsn/event/vo/SubjectSourceVO.java
浏览文件 @
dd9df705
...
...
@@ -2,6 +2,8 @@ package com.zzsn.event.vo;
import
lombok.Data
;
import
java.util.List
;
/**
*
*
...
...
@@ -14,6 +16,10 @@ public class SubjectSourceVO {
private
String
sourceId
;
private
Integer
count
;
//绑定定向信息源时使用(研究中心)
/**---绑定定向信息源时使用(研究中心)---**/
private
List
<
String
>
webSiteNameList
;
private
List
<
String
>
sourceIdList
;
private
String
webSiteName
;
/**---绑定定向信息源时使用(研究中心)---**/
}
src/main/resources/application-dev.yml
浏览文件 @
dd9df705
...
...
@@ -134,11 +134,25 @@ scoreRule:
translate
:
url
:
http://114.116.116.241:8018/translate/getTranslateInfoWithTag
python
:
#python打分接口
#python打分接口
-弃用
scoreModelUrl
:
http://114.116.36.231:8080/score
#python开始执行接口
#python开始执行接口
--弃用
subjectProcessorUrl
:
http://114.116.36.231:8085/subject/subject_processor
#判重
judgeDuplicateUrl
:
http://1
14.116.36.231
:8080/subject/judg_duplicate
judgeDuplicateUrl
:
http://1
.95.13.40
:8080/subject/judg_duplicate
#抽取关键词
keyWordsExtractUrl
:
http://1.95.91.200:7006/get_phrase/
\ No newline at end of file
keyWordsExtractUrl
:
http://1.95.91.200:7006/get_phrase/
#清空去重服务历史数据
clearDuplicateHistoryUrl
:
http://1.95.13.40:8080/subject/delete_history_data
jeecg
:
shiro
:
excludeUrls
:
kafka
:
topic
:
subject
:
run
:
subjectModelTest
clb
:
subject
:
default
:
processing
:
advanceMonth
:
6
\ No newline at end of file
src/main/resources/application-pro.yml
浏览文件 @
dd9df705
...
...
@@ -130,4 +130,27 @@ scoreRule:
yearScore
:
3
beforeYearScore
:
1
translate
:
url
:
http://114.116.116.241:8018/translate/getTranslateInfoWithTag
\ No newline at end of file
url
:
http://114.116.116.241:8018/translate/getTranslateInfoWithTag
python
:
#python打分接口-弃用
scoreModelUrl
:
http://114.116.36.231:8080/score
#python开始执行接口--弃用
subjectProcessorUrl
:
http://114.116.36.231:8085/subject/subject_processor
#判重
judgeDuplicateUrl
:
http://1.95.13.40:8080/subject/judg_duplicate
#抽取关键词
keyWordsExtractUrl
:
http://1.95.91.200:7006/get_phrase/
#清空去重服务历史数据
clearDuplicateHistoryUrl
:
http://1.95.13.40:8080/subject/delete_history_data
jeecg
:
shiro
:
excludeUrls
:
kafka
:
topic
:
subject
:
run
:
subjectModelTest
clb
:
subject
:
default
:
processing
:
advanceMonth
:
6
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论