Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
E
event
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
陈世强
event
Commits
9def98f0
提交
9def98f0
authored
9月 13, 2025
作者:
obcy
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/event_fusion' into event_fusion
上级
de91ecbf
18ee6352
隐藏空白字符变更
内嵌
并排
正在显示
20 个修改的文件
包含
328 行增加
和
38 行删除
+328
-38
SubjectManageController.java
...va/com/zzsn/event/controller/SubjectManageController.java
+127
-12
InformationController.java
...m/zzsn/event/controller/common/InformationController.java
+26
-0
ReportDataController.java
...zsn/event/controller/reportData/ReportDataController.java
+19
-0
EsService.java
src/main/java/com/zzsn/event/es/EsService.java
+8
-3
ExternalController.java
...om/zzsn/event/external/controller/ExternalController.java
+43
-0
ClbLabelMapper.java
src/main/java/com/zzsn/event/mapper/ClbLabelMapper.java
+2
-0
SysDictItemMapper.java
src/main/java/com/zzsn/event/mapper/SysDictItemMapper.java
+1
-0
ClbLabelMapper.xml
src/main/java/com/zzsn/event/mapper/xml/ClbLabelMapper.xml
+6
-2
SysDictItemMapper.xml
...main/java/com/zzsn/event/mapper/xml/SysDictItemMapper.xml
+11
-1
ClbLabelService.java
src/main/java/com/zzsn/event/service/ClbLabelService.java
+2
-0
InformationService.java
src/main/java/com/zzsn/event/service/InformationService.java
+12
-0
SysDictItemService.java
src/main/java/com/zzsn/event/service/SysDictItemService.java
+2
-0
ClbLabelServiceImpl.java
...java/com/zzsn/event/service/impl/ClbLabelServiceImpl.java
+6
-0
ConfigurationMessageService.java
.../zzsn/event/service/impl/ConfigurationMessageService.java
+21
-19
InformationServiceImpl.java
...a/com/zzsn/event/service/impl/InformationServiceImpl.java
+14
-0
SubjectSimpleServiceImpl.java
...com/zzsn/event/service/impl/SubjectSimpleServiceImpl.java
+2
-0
SysDictItemServiceImpl.java
...a/com/zzsn/event/service/impl/SysDictItemServiceImpl.java
+4
-0
SubjectStatisticTask.java
src/main/java/com/zzsn/event/task/SubjectStatisticTask.java
+1
-1
LabelDictItemVO.java
src/main/java/com/zzsn/event/vo/LabelDictItemVO.java
+20
-0
application-test.yml
src/main/resources/application-test.yml
+1
-0
没有找到文件。
src/main/java/com/zzsn/event/controller/SubjectManageController.java
浏览文件 @
9def98f0
package
com
.
zzsn
.
event
.
controller
;
package
com
.
zzsn
.
event
.
controller
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.lang.tree.Tree
;
import
cn.hutool.core.lang.tree.TreeNode
;
import
cn.hutool.core.lang.tree.TreeUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.json.JSONUtil
;
import
cn.hutool.json.JSONUtil
;
...
@@ -12,6 +16,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
...
@@ -12,6 +16,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.obs.services.model.PutObjectResult
;
import
com.obs.services.model.PutObjectResult
;
import
com.zzsn.event.constant.Result
;
import
com.zzsn.event.constant.Result
;
import
com.zzsn.event.constant.TreeNodeInfo
;
import
com.zzsn.event.entity.*
;
import
com.zzsn.event.entity.*
;
import
com.zzsn.event.es.EsService
;
import
com.zzsn.event.es.EsService
;
import
com.zzsn.event.feign.api.RemoteModelService
;
import
com.zzsn.event.feign.api.RemoteModelService
;
...
@@ -134,6 +139,9 @@ public class SubjectManageController {
...
@@ -134,6 +139,9 @@ public class SubjectManageController {
@Value
(
"${caiji.projectName:克虏宝测试}"
)
@Value
(
"${caiji.projectName:克虏宝测试}"
)
private
String
projectName
;
private
String
projectName
;
@Value
(
"${infoSource.commonLabel:}"
)
private
String
commonSourceLabels
;
/**
/**
* 专题列表-资讯转换时使用
* 专题列表-资讯转换时使用
*
*
...
@@ -256,14 +264,15 @@ public class SubjectManageController {
...
@@ -256,14 +264,15 @@ public class SubjectManageController {
*/
*/
@GetMapping
(
value
=
"/statisticInfo"
)
@GetMapping
(
value
=
"/statisticInfo"
)
private
Result
<?>
statisticInfo
(
@RequestParam
List
<
String
>
subjectIds
)
{
private
Result
<?>
statisticInfo
(
@RequestParam
List
<
String
>
subjectIds
)
{
List
<
SubjectStatisticInfo
>
statisticInfoList
=
subjectService
.
statisticInfo
(
subjectIds
);
//List<SubjectStatisticInfo> statisticInfoList = subjectService.statisticInfo(subjectIds);
//异步更新专题统计信息表的数据
////异步更新专题统计信息表的数据
CompletableFuture
.
runAsync
(()
->
{
//CompletableFuture.runAsync(() -> {
if
(
CollectionUtils
.
isNotEmpty
(
statisticInfoList
))
{
// if (CollectionUtils.isNotEmpty(statisticInfoList)) {
subjectStatisticInfoService
.
batchModify
(
statisticInfoList
);
// subjectStatisticInfoService.batchModify(statisticInfoList);
}
// }
});
//});
return
Result
.
OK
(
statisticInfoList
);
//return Result.OK(statisticInfoList);
return
Result
.
OK
(
new
ArrayList
<>());
}
}
/**
/**
...
@@ -892,8 +901,9 @@ public class SubjectManageController {
...
@@ -892,8 +901,9 @@ public class SubjectManageController {
*/
*/
@GetMapping
(
"/subjectBindMainLabelList"
)
@GetMapping
(
"/subjectBindMainLabelList"
)
public
Result
<?>
subjectBindMainLabelList
(
@RequestParam
String
subjectId
)
{
public
Result
<?>
subjectBindMainLabelList
(
@RequestParam
String
subjectId
)
{
// List<InfoSourceLabelVO> bindList = clbLabelService.subjectBindMainLabelList(subjectId);
//List<InfoSourceLabelVO> bindList = clbLabelService.subjectBindMainLabelList(subjectId);
List
<
String
>
bindList
=
clbLabelService
.
subjectBindMainLabelList
(
subjectId
);
//List<String> bindList = clbLabelService.subjectBindMainLabelList(subjectId);
List
<
LabelDictItemVO
>
bindList
=
clbLabelService
.
subjectBindMainLabels
(
subjectId
);
return
Result
.
OK
(
bindList
);
return
Result
.
OK
(
bindList
);
}
}
...
@@ -971,15 +981,120 @@ public class SubjectManageController {
...
@@ -971,15 +981,120 @@ public class SubjectManageController {
return
Result
.
OK
();
return
Result
.
OK
();
}
}
/**
* 信息源标签列表(通用信息源)
*
* @author lkg
* @date 2025/9/2
*/
@GetMapping
(
"/commonInfoSourceLabelList"
)
public
Result
<?>
getCommonInfoSourceLabelList
(){
List
<
String
>
labelIdList
=
Arrays
.
asList
(
commonSourceLabels
.
split
(
","
));
List
<
ClbLabel
>
clbLabels
=
clbLabelService
.
listByIds
(
labelIdList
);
sortByAnotherList
(
clbLabels
,
labelIdList
);
Map
<
String
,
String
>
relationMap
=
clbLabels
.
stream
().
collect
(
Collectors
.
toMap
(
ClbLabel:
:
getDictCode
,
ClbLabel:
:
getId
));
List
<
String
>
dictCodeList
=
clbLabels
.
stream
().
map
(
ClbLabel:
:
getDictCode
).
collect
(
Collectors
.
toList
());
List
<
SysDictItem
>
dictItems
=
sysDictItemService
.
listByDictCodes
(
dictCodeList
);
//构造树型结构
List
<
TreeNode
<
String
>>
nodeList
=
new
ArrayList
<>();
for
(
SysDictItem
dictItem
:
dictItems
)
{
TreeNode
<
String
>
treeNode
=
new
TreeNode
<>();
//对象转map
Map
<
String
,
Object
>
extra
=
BeanUtil
.
beanToMap
(
dictItem
,
false
,
true
);
treeNode
.
setExtra
(
extra
);
treeNode
.
setId
(
dictItem
.
getId
());
treeNode
.
setName
(
dictItem
.
getItemText
());
if
(
dictItem
.
getPid
().
equals
(
TreeNodeInfo
.
ROOT_PID_VALUE
))
{
treeNode
.
setParentId
(
relationMap
.
get
(
dictItem
.
getDictCode
()));
}
else
{
treeNode
.
setParentId
(
dictItem
.
getPid
());
}
nodeList
.
add
(
treeNode
);
}
//信息源标签 作为父级
clbLabels
.
forEach
(
e
->
{
TreeNode
<
String
>
treeNode
=
new
TreeNode
<>();
//对象转map
Map
<
String
,
Object
>
extra
=
BeanUtil
.
beanToMap
(
e
,
false
,
true
);
treeNode
.
setExtra
(
extra
);
treeNode
.
setId
(
e
.
getId
());
treeNode
.
setName
(
e
.
getLabelName
());
treeNode
.
setParentId
(
"0"
);
nodeList
.
add
(
treeNode
);
});
List
<
Tree
<
String
>>
treeList
=
TreeUtil
.
build
(
nodeList
,
TreeNodeInfo
.
ROOT_PID_VALUE
);
return
Result
.
OK
(
treeList
);
}
//目标集合按照另一个集合的顺序排序
private
void
sortByAnotherList
(
List
<
ClbLabel
>
list
,
List
<
String
>
anotherList
)
{
list
.
sort
((
o1
,
o2
)
->
{
int
index1
=
anotherList
.
indexOf
(
o1
.
getId
());
int
index2
=
anotherList
.
indexOf
(
o2
.
getId
());
if
(
index1
!=
-
1
)
{
index1
=
list
.
size
()
-
index1
;
}
if
(
index2
!=
-
1
)
{
index2
=
list
.
size
()
-
index2
;
}
return
index2
-
index1
;
});
}
/**
/**
* 绑定信息源标签数据
* 绑定信息源标签数据
*
*
* @param
infoSourceMainLabelVO 参数
* @param
params 参数[subjectId,infoSourceMainLabel]
* @author lkg
* @author lkg
* @date 2025/1/3
* @date 2025/1/3
*/
*/
@PostMapping
(
"/bindInfoSourceMainLabel"
)
@PostMapping
(
"/bindInfoSourceMainLabel"
)
public
Result
<?>
bindInfoSourceMainLabel
(
@RequestBody
InfoSourceMainLabelVO
infoSourceMainLabelVO
)
{
public
Result
<?>
bindInfoSourceMainLabel
(
@RequestBody
Map
<
String
,
Object
>
params
)
{
Object
subjectId
=
params
.
get
(
"subjectId"
);
if
(
ObjectUtil
.
isEmpty
(
subjectId
))
{
return
Result
.
FAIL
(
"专题id不能为空"
);
}
Object
infoSourceMainLabel
=
params
.
get
(
"infoSourceMainLabel"
);
//支持全部删除
//不管有没有传值,先删后增
LambdaQueryWrapper
<
SubjectInfoSourceMap
>
queryWrapper
=
Wrappers
.
lambdaQuery
();
queryWrapper
.
eq
(
SubjectInfoSourceMap:
:
getSubjectId
,
subjectId
).
eq
(
SubjectInfoSourceMap:
:
getType
,
312
);
int
count
=
subjectInfoSourceMapService
.
count
(
queryWrapper
);
if
(
count
>
0
)
{
subjectInfoSourceMapService
.
remove
(
queryWrapper
);
}
List
<
SubjectInfoSourceMap
>
dataList
=
new
ArrayList
<>();
if
(
ObjectUtil
.
isNotEmpty
(
infoSourceMainLabel
))
{
List
<
InfoSourceMainLabelVO
>
infoSourceMainLabelList
=
JSON
.
parseArray
(
JSON
.
toJSONString
(
infoSourceMainLabel
),
InfoSourceMainLabelVO
.
class
);
for
(
InfoSourceMainLabelVO
infoSourceMainLabelVO
:
infoSourceMainLabelList
)
{
List
<
String
>
labelList
=
infoSourceMainLabelVO
.
getInfoSourceLabelItemList
();
String
labelCode
=
infoSourceMainLabelVO
.
getLabelCode
();
for
(
String
labelItemCode
:
labelList
)
{
SubjectInfoSourceMap
subjectInfoSourceMap
=
new
SubjectInfoSourceMap
();
subjectInfoSourceMap
.
setSubjectId
(
subjectId
.
toString
());
subjectInfoSourceMap
.
setSourceId
(
labelCode
);
subjectInfoSourceMap
.
setSourceItemId
(
labelItemCode
);
subjectInfoSourceMap
.
setType
(
312
);
UserVo
currentUser
=
UserUtil
.
getLoginUser
();
subjectInfoSourceMap
.
setCreateBy
(
currentUser
.
getUsername
());
subjectInfoSourceMap
.
setCreateTime
(
new
Date
());
dataList
.
add
(
subjectInfoSourceMap
);
}
}
}
if
(
CollectionUtils
.
isNotEmpty
(
dataList
))
{
subjectInfoSourceMapService
.
saveBatch
(
dataList
);
}
//同步配置到采集
configurationMessageService
.
bindInfoSourceSend
(
subjectId
.
toString
());
return
Result
.
OK
();
}
public
Result
<?>
bindInfoSourceMainLabel_old
(
@RequestBody
InfoSourceMainLabelVO
infoSourceMainLabelVO
)
{
String
subjectId
=
infoSourceMainLabelVO
.
getSubjectId
();
String
subjectId
=
infoSourceMainLabelVO
.
getSubjectId
();
if
(
StringUtils
.
isEmpty
(
subjectId
))
{
if
(
StringUtils
.
isEmpty
(
subjectId
))
{
...
...
src/main/java/com/zzsn/event/controller/common/InformationController.java
浏览文件 @
9def98f0
...
@@ -26,6 +26,7 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -26,6 +26,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.concurrent.CompletableFuture
;
import
java.util.concurrent.CompletableFuture
;
...
@@ -699,4 +700,29 @@ public class InformationController {
...
@@ -699,4 +700,29 @@ public class InformationController {
}
}
/**
* 批量指定
* 研究中心-AI资讯:生成简报是调用
*
* @param params 参数
* @author lkg
* @date 2025/9/4
*/
@PostMapping
(
value
=
"/batchTop"
)
public
Result
<?>
batchTop
(
@RequestBody
Map
<
String
,
Object
>
params
)
{
Object
subjectId
=
params
.
get
(
"subjectId"
);
if
(
subjectId
==
null
)
{
return
Result
.
FAIL
(
"专题id不能为空"
);
}
Object
ids
=
params
.
get
(
"ids"
);
if
(
ids
==
null
)
{
return
Result
.
FAIL
(
"ids不能为空"
);
}
Object
index
=
params
.
get
(
"index"
);
if
(
index
==
null
)
{
return
Result
.
FAIL
(
"es索引不能为空"
);
}
informationService
.
batchTop
(
subjectId
.
toString
(),
index
.
toString
(),
JSON
.
parseArray
(
ids
.
toString
(),
String
.
class
));
return
Result
.
OK
();
}
}
}
src/main/java/com/zzsn/event/controller/reportData/ReportDataController.java
浏览文件 @
9def98f0
...
@@ -5,12 +5,14 @@ import cn.hutool.json.JSONUtil;
...
@@ -5,12 +5,14 @@ import cn.hutool.json.JSONUtil;
import
com.alibaba.fastjson2.JSON
;
import
com.alibaba.fastjson2.JSON
;
import
com.alibaba.fastjson2.JSONArray
;
import
com.alibaba.fastjson2.JSONArray
;
import
com.alibaba.fastjson2.JSONObject
;
import
com.alibaba.fastjson2.JSONObject
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.CollectionUtils
;
import
com.baomidou.mybatisplus.core.toolkit.CollectionUtils
;
import
com.google.common.base.Charsets
;
import
com.google.common.base.Charsets
;
import
com.zzsn.event.constant.Constants
;
import
com.zzsn.event.constant.Constants
;
import
com.zzsn.event.constant.Result
;
import
com.zzsn.event.constant.Result
;
import
com.zzsn.event.entity.SysDictItem
;
import
com.zzsn.event.entity.SysDictItem
;
import
com.zzsn.event.service.CommonService
;
import
com.zzsn.event.service.CommonService
;
import
com.zzsn.event.service.InformationService
;
import
com.zzsn.event.service.SubjectService
;
import
com.zzsn.event.service.SubjectService
;
import
com.zzsn.event.service.SysDictItemService
;
import
com.zzsn.event.service.SysDictItemService
;
import
com.zzsn.event.util.DateUtil
;
import
com.zzsn.event.util.DateUtil
;
...
@@ -18,6 +20,8 @@ import com.zzsn.event.util.EsDateUtil;
...
@@ -18,6 +20,8 @@ import com.zzsn.event.util.EsDateUtil;
import
com.zzsn.event.util.EsIndexUtil
;
import
com.zzsn.event.util.EsIndexUtil
;
import
com.zzsn.event.util.FieldUtil
;
import
com.zzsn.event.util.FieldUtil
;
import
com.zzsn.event.vo.CountVO
;
import
com.zzsn.event.vo.CountVO
;
import
com.zzsn.event.vo.InfoDataSearchCondition
;
import
com.zzsn.event.vo.es.DisplayInfo
;
import
com.zzsn.event.vo.es.Label
;
import
com.zzsn.event.vo.es.Label
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
@@ -70,6 +74,8 @@ public class ReportDataController {
...
@@ -70,6 +74,8 @@ public class ReportDataController {
private
CommonService
commonService
;
private
CommonService
commonService
;
@Autowired
@Autowired
private
SysDictItemService
dictItemService
;
private
SysDictItemService
dictItemService
;
@Autowired
private
InformationService
informationService
;
/**
/**
* 检索字段集合
* 检索字段集合
...
@@ -95,6 +101,19 @@ public class ReportDataController {
...
@@ -95,6 +101,19 @@ public class ReportDataController {
return
Result
.
OK
(
fieldDetails
);
return
Result
.
OK
(
fieldDetails
);
}
}
/**
* 专题资讯列表(研究中心[AI资讯])
*
* @param searchCondition 检索条件
* @author lkg
* @date 2025/9/5
*/
@PostMapping
(
"/infoList"
)
public
Result
<?>
infoList
(
@RequestBody
InfoDataSearchCondition
searchCondition
)
{
return
informationService
.
subjectPageListGroupByLabel
(
null
,
searchCondition
);
}
/**
/**
* 专题资讯列表
* 专题资讯列表
*
*
...
...
src/main/java/com/zzsn/event/es/EsService.java
浏览文件 @
9def98f0
...
@@ -2579,9 +2579,14 @@ public class EsService {
...
@@ -2579,9 +2579,14 @@ public class EsService {
//信息源标签
//信息源标签
List
<
Label
>
labelList
=
searchCondition
.
getLabelList
();
List
<
Label
>
labelList
=
searchCondition
.
getLabelList
();
if
(
CollectionUtils
.
isNotEmpty
(
labelList
))
{
if
(
CollectionUtils
.
isNotEmpty
(
labelList
))
{
List
<
String
>
collect
=
labelList
.
stream
().
map
(
label
->
label
.
getLabelMark
()
+
"-"
+
label
.
getRelationId
()).
collect
(
Collectors
.
toList
());
//同类标签之间 或 的关系;不同类标签之间 与 的关系
TermsQueryBuilder
relationIdQuery
=
QueryBuilders
.
termsQuery
(
"labels.relationId"
,
collect
);
Map
<
String
,
List
<
Label
>>
labelMap
=
labelList
.
stream
().
collect
(
Collectors
.
groupingBy
(
Label:
:
getLabelMark
));
boolQuery
.
must
(
QueryBuilders
.
nestedQuery
(
"labels"
,
relationIdQuery
,
ScoreMode
.
None
));
for
(
Map
.
Entry
<
String
,
List
<
Label
>>
entry
:
labelMap
.
entrySet
())
{
List
<
Label
>
value
=
entry
.
getValue
();
List
<
String
>
collect
=
value
.
stream
().
map
(
label
->
label
.
getLabelMark
()
+
"-"
+
label
.
getRelationId
()).
collect
(
Collectors
.
toList
());
TermsQueryBuilder
relationIdQuery
=
QueryBuilders
.
termsQuery
(
"labels.relationId"
,
collect
);
boolQuery
.
must
(
QueryBuilders
.
nestedQuery
(
"labels"
,
relationIdQuery
,
ScoreMode
.
None
));
}
}
}
String
sourceId
=
searchCondition
.
getSourceId
();
String
sourceId
=
searchCondition
.
getSourceId
();
if
(
StringUtils
.
isNotBlank
(
sourceId
))
{
if
(
StringUtils
.
isNotBlank
(
sourceId
))
{
...
...
src/main/java/com/zzsn/event/external/controller/ExternalController.java
浏览文件 @
9def98f0
...
@@ -35,6 +35,7 @@ import com.zzsn.event.xxljob.entity.XxlJobInfo;
...
@@ -35,6 +35,7 @@ import com.zzsn.event.xxljob.entity.XxlJobInfo;
import
com.zzsn.event.xxljob.service.IXxlJobInfoService
;
import
com.zzsn.event.xxljob.service.IXxlJobInfoService
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.jsoup.Jsoup
;
import
org.jsoup.Jsoup
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
...
@@ -375,6 +376,48 @@ public class ExternalController {
...
@@ -375,6 +376,48 @@ public class ExternalController {
}
}
/**
/**
* 批量绑定信息源
*
* @param params 参数
* @author lkg
* @date 2025/9/10
*/
@PostMapping
(
"/batchBindSource"
)
public
Result
<?>
batchBindSource
(
@RequestBody
Map
<
String
,
Object
>
params
)
{
Object
subjectId
=
params
.
get
(
"subjectId"
);
if
(
ObjectUtils
.
isEmpty
(
subjectId
))
{
return
Result
.
FAIL
(
"专题id不能为空"
);
}
Object
bindList
=
params
.
get
(
"bindList"
);
if
(
ObjectUtils
.
isEmpty
(
bindList
))
{
return
Result
.
FAIL
(
"请添加信息源"
);
}
List
<
ExternalSubjectInfoSourceMap
>
saveList
=
new
ArrayList
<>();
List
<
ExternalSubjectInfoSourceMap
>
mapList
=
JSON
.
parseArray
(
JSON
.
toJSONString
(
bindList
),
ExternalSubjectInfoSourceMap
.
class
);
LambdaQueryWrapper
<
ExternalSubjectInfoSourceMap
>
queryWrapper
=
Wrappers
.
lambdaQuery
();
queryWrapper
.
eq
(
ExternalSubjectInfoSourceMap:
:
getSubjectId
,
subjectId
.
toString
());
List
<
ExternalSubjectInfoSourceMap
>
existedList
=
externalSubjectInfoSourceMapService
.
list
(
queryWrapper
);
if
(
CollectionUtils
.
isEmpty
(
existedList
))
{
saveList
.
addAll
(
mapList
);
}
else
{
for
(
ExternalSubjectInfoSourceMap
externalSubjectInfoSourceMap
:
mapList
)
{
Optional
<
ExternalSubjectInfoSourceMap
>
any
=
existedList
.
stream
()
.
filter
(
map
->
map
.
getInfoSourceUrl
().
equals
(
externalSubjectInfoSourceMap
.
getInfoSourceUrl
()))
.
findAny
();
if
(!
any
.
isPresent
())
{
saveList
.
add
(
externalSubjectInfoSourceMap
);
}
}
}
for
(
ExternalSubjectInfoSourceMap
externalSubjectInfoSourceMap
:
saveList
)
{
externalSubjectInfoSourceMap
.
setSubjectId
(
subjectId
.
toString
());
externalSubjectInfoSourceMap
.
setType
(
1
);
}
externalSubjectInfoSourceMapService
.
saveBatch
(
saveList
);
return
Result
.
OK
();
}
/**
* 解绑信息源
* 解绑信息源
*
*
* @param ids id集合
* @param ids id集合
...
...
src/main/java/com/zzsn/event/mapper/ClbLabelMapper.java
浏览文件 @
9def98f0
...
@@ -3,6 +3,7 @@ package com.zzsn.event.mapper;
...
@@ -3,6 +3,7 @@ package com.zzsn.event.mapper;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.zzsn.event.entity.ClbLabel
;
import
com.zzsn.event.entity.ClbLabel
;
import
com.zzsn.event.vo.InfoSourceLabelVO
;
import
com.zzsn.event.vo.InfoSourceLabelVO
;
import
com.zzsn.event.vo.LabelDictItemVO
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
...
@@ -38,4 +39,5 @@ public interface ClbLabelMapper extends BaseMapper<ClbLabel> {
...
@@ -38,4 +39,5 @@ public interface ClbLabelMapper extends BaseMapper<ClbLabel> {
List
<
InfoSourceLabelVO
>
labelInfoByType
(
@Param
(
"labelTypeId"
)
String
labelTypeId
);
List
<
InfoSourceLabelVO
>
labelInfoByType
(
@Param
(
"labelTypeId"
)
String
labelTypeId
);
List
<
String
>
subjectBindMainLabelList
(
@Param
(
"subjectId"
)
String
subjectId
);
List
<
String
>
subjectBindMainLabelList
(
@Param
(
"subjectId"
)
String
subjectId
);
List
<
LabelDictItemVO
>
subjectBindMainLabels
(
@Param
(
"subjectId"
)
String
subjectId
);
}
}
src/main/java/com/zzsn/event/mapper/SysDictItemMapper.java
浏览文件 @
9def98f0
...
@@ -20,6 +20,7 @@ import java.util.List;
...
@@ -20,6 +20,7 @@ import java.util.List;
public
interface
SysDictItemMapper
extends
BaseMapper
<
SysDictItem
>
{
public
interface
SysDictItemMapper
extends
BaseMapper
<
SysDictItem
>
{
List
<
SysDictItem
>
listByDictCode
(
@Param
(
"dictCode"
)
String
dictCode
);
List
<
SysDictItem
>
listByDictCode
(
@Param
(
"dictCode"
)
String
dictCode
);
List
<
SysDictItem
>
listByDictCodes
(
@Param
(
"dictCodes"
)
List
<
String
>
dictCodes
);
SysDictItem
dictItemInfoByName
(
@Param
(
"dictCode"
)
String
dictCode
,
@Param
(
"itemName"
)
String
itemName
);
SysDictItem
dictItemInfoByName
(
@Param
(
"dictCode"
)
String
dictCode
,
@Param
(
"itemName"
)
String
itemName
);
...
...
src/main/java/com/zzsn/event/mapper/xml/ClbLabelMapper.xml
浏览文件 @
9def98f0
...
@@ -30,5 +30,10 @@
...
@@ -30,5 +30,10 @@
from subject_info_source_map m
from subject_info_source_map m
where m.subject_id = #{subjectId} and m.type = 312
where m.subject_id = #{subjectId} and m.type = 312
</select>
</select>
<select
id=
"subjectBindMainLabels"
resultType=
"com.zzsn.event.vo.LabelDictItemVO"
>
select m.source_id as label_code,label.label_name, m.source_item_id as label_item_code
from subject_info_source_map m inner join clb_label label on m.source_id = label.label_code
where m.subject_id = #{subjectId} and m.type = 312
</select>
</mapper>
</mapper>
\ No newline at end of file
src/main/java/com/zzsn/event/mapper/xml/SysDictItemMapper.xml
浏览文件 @
9def98f0
...
@@ -4,7 +4,17 @@
...
@@ -4,7 +4,17 @@
<select
id=
"listByDictCode"
resultType=
"com.zzsn.event.entity.SysDictItem"
>
<select
id=
"listByDictCode"
resultType=
"com.zzsn.event.entity.SysDictItem"
>
select * from sys_dict_item item inner join sys_dict dict on item.dict_id = dict.id
select * from sys_dict_item item inner join sys_dict dict on item.dict_id = dict.id
where dict.dict_code = #{dictCode} and item.status = 1
where dict.dict_code = #{dictCode} and item.status = 1 order by item.sort_order
</select>
<select
id=
"listByDictCodes"
resultType=
"com.zzsn.event.entity.SysDictItem"
>
select item.*,dict.dict_code from sys_dict_item item inner join sys_dict dict on item.dict_id = dict.id
where item.status = 1
<if
test=
"dictCodes != null and dictCodes.size() > 0"
>
and dict.dict_code in
<foreach
collection=
"dictCodes"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
</select>
</select>
<select
id=
"dictItemInfoByName"
resultType=
"com.zzsn.event.entity.SysDictItem"
>
<select
id=
"dictItemInfoByName"
resultType=
"com.zzsn.event.entity.SysDictItem"
>
select * from sys_dict_item item inner join sys_dict dict on item.dict_id = dict.id
select * from sys_dict_item item inner join sys_dict dict on item.dict_id = dict.id
...
...
src/main/java/com/zzsn/event/service/ClbLabelService.java
浏览文件 @
9def98f0
...
@@ -3,6 +3,7 @@ package com.zzsn.event.service;
...
@@ -3,6 +3,7 @@ package com.zzsn.event.service;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.zzsn.event.entity.ClbLabel
;
import
com.zzsn.event.entity.ClbLabel
;
import
com.zzsn.event.vo.InfoSourceLabelVO
;
import
com.zzsn.event.vo.InfoSourceLabelVO
;
import
com.zzsn.event.vo.LabelDictItemVO
;
import
java.util.List
;
import
java.util.List
;
...
@@ -35,4 +36,5 @@ public interface ClbLabelService extends IService<ClbLabel> {
...
@@ -35,4 +36,5 @@ public interface ClbLabelService extends IService<ClbLabel> {
List
<
InfoSourceLabelVO
>
labelInfoByType
(
String
labelTypeId
);
List
<
InfoSourceLabelVO
>
labelInfoByType
(
String
labelTypeId
);
List
<
String
>
subjectBindMainLabelList
(
String
subjectId
);
List
<
String
>
subjectBindMainLabelList
(
String
subjectId
);
List
<
LabelDictItemVO
>
subjectBindMainLabels
(
String
subjectId
);
}
}
src/main/java/com/zzsn/event/service/InformationService.java
浏览文件 @
9def98f0
...
@@ -342,4 +342,16 @@ public interface InformationService {
...
@@ -342,4 +342,16 @@ public interface InformationService {
* @date 2025/4/23
* @date 2025/4/23
*/
*/
void
removeTag
(
InfoDataSearchCondition
searchCondition
);
void
removeTag
(
InfoDataSearchCondition
searchCondition
);
/**
* 批量指定
* 研究中心-AI资讯:生成简报是调用
*
* @param subjectId 专题id
* @param index es索引
* @param ids 资讯id集合
* @author lkg
* @date 2024/12/19
*/
void
batchTop
(
String
subjectId
,
String
index
,
List
<
String
>
ids
);
}
}
src/main/java/com/zzsn/event/service/SysDictItemService.java
浏览文件 @
9def98f0
...
@@ -19,6 +19,8 @@ public interface SysDictItemService extends IService<SysDictItem> {
...
@@ -19,6 +19,8 @@ public interface SysDictItemService extends IService<SysDictItem> {
List
<
SysDictItem
>
listByDictCode
(
String
dictCode
);
List
<
SysDictItem
>
listByDictCode
(
String
dictCode
);
List
<
SysDictItem
>
listByDictCodes
(
List
<
String
>
dictCodes
);
SysDictItem
dictItemInfoByName
(
String
dictCode
,
String
itemName
);
SysDictItem
dictItemInfoByName
(
String
dictCode
,
String
itemName
);
/**
/**
...
...
src/main/java/com/zzsn/event/service/impl/ClbLabelServiceImpl.java
浏览文件 @
9def98f0
...
@@ -6,6 +6,7 @@ import com.zzsn.event.entity.ClbLabel;
...
@@ -6,6 +6,7 @@ import com.zzsn.event.entity.ClbLabel;
import
com.zzsn.event.mapper.ClbLabelMapper
;
import
com.zzsn.event.mapper.ClbLabelMapper
;
import
com.zzsn.event.service.ClbLabelService
;
import
com.zzsn.event.service.ClbLabelService
;
import
com.zzsn.event.vo.InfoSourceLabelVO
;
import
com.zzsn.event.vo.InfoSourceLabelVO
;
import
com.zzsn.event.vo.LabelDictItemVO
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
java.util.List
;
...
@@ -35,4 +36,9 @@ public class ClbLabelServiceImpl extends ServiceImpl<ClbLabelMapper, ClbLabel> i
...
@@ -35,4 +36,9 @@ public class ClbLabelServiceImpl extends ServiceImpl<ClbLabelMapper, ClbLabel> i
public
List
<
String
>
subjectBindMainLabelList
(
String
subjectId
)
{
public
List
<
String
>
subjectBindMainLabelList
(
String
subjectId
)
{
return
baseMapper
.
subjectBindMainLabelList
(
subjectId
);
return
baseMapper
.
subjectBindMainLabelList
(
subjectId
);
}
}
@Override
public
List
<
LabelDictItemVO
>
subjectBindMainLabels
(
String
subjectId
)
{
return
baseMapper
.
subjectBindMainLabels
(
subjectId
);
}
}
}
src/main/java/com/zzsn/event/service/impl/ConfigurationMessageService.java
浏览文件 @
9def98f0
...
@@ -26,6 +26,7 @@ import org.springframework.stereotype.Service;
...
@@ -26,6 +26,7 @@ import org.springframework.stereotype.Service;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.util.*
;
import
java.util.*
;
import
java.util.concurrent.CompletableFuture
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
@Service
@Service
...
@@ -207,25 +208,26 @@ public class ConfigurationMessageService {
...
@@ -207,25 +208,26 @@ public class ConfigurationMessageService {
log
.
info
(
"未查询到专题或专题未启用"
);
log
.
info
(
"未查询到专题或专题未启用"
);
return
;
return
;
}
}
//只有启用状态的专题才需要通知采集更新绑定数据
CompletableFuture
.
runAsync
(()
->
{
List
<
String
>
bindIds
=
getAllInfoSourceIds
(
subjectId
);
//只有启用状态的专题才需要通知采集更新绑定数据
String
getparam
;
List
<
String
>
bindIds
=
getAllInfoSourceIds
(
subjectId
);
if
(
CollectionUtil
.
isNotEmpty
(
bindIds
))
{
String
getparam
;
getparam
=
getparam
(
byId
,
null
,
bindIds
);
if
(
CollectionUtil
.
isNotEmpty
(
bindIds
))
{
}
else
{
getparam
=
getparam
(
byId
,
null
,
bindIds
);
log
.
info
(
"专题未绑定信息源,通知采集清空"
);
}
else
{
log
.
info
(
"专题未绑定信息源,通知采集清空"
);
getparam
=
getparam
(
byId
,
null
,
new
ArrayList
<>());
getparam
=
getparam
(
byId
,
null
,
new
ArrayList
<>());
}
}
String
post
=
caiJiCenterHttpService
.
allInfosourcebindUrl
(
getparam
);
String
post
=
caiJiCenterHttpService
.
allInfosourcebindUrl
(
getparam
);
JSONObject
entries
=
JSONUtil
.
parseObj
(
post
);
JSONObject
entries
=
JSONUtil
.
parseObj
(
post
);
//获取code状态码
//获取code状态码
Integer
code
=
entries
.
getInt
(
"code"
);
Integer
code
=
entries
.
getInt
(
"code"
);
if
(
ObjectUtil
.
isEmpty
(
code
)
||
code
!=
200
)
{
if
(
ObjectUtil
.
isEmpty
(
code
)
||
code
!=
200
)
{
log
.
error
(
"专题信息源配置通知采集失败{}"
,
post
);
log
.
error
(
"专题信息源配置通知采集失败{}"
,
post
);
throw
new
RuntimeException
(
"专题信息源配置通知采集失败"
);
throw
new
RuntimeException
(
"专题信息源配置通知采集失败"
);
}
}
log
.
info
(
"{}专题信息源配置通知采集结束"
,
byId
.
getSubjectName
());
log
.
info
(
"{}专题信息源配置通知采集结束"
,
byId
.
getSubjectName
());
});
}
}
...
...
src/main/java/com/zzsn/event/service/impl/InformationServiceImpl.java
浏览文件 @
9def98f0
...
@@ -1484,6 +1484,20 @@ public class InformationServiceImpl implements InformationService {
...
@@ -1484,6 +1484,20 @@ public class InformationServiceImpl implements InformationService {
}
}
}
}
@Override
public
void
batchTop
(
String
subjectId
,
String
index
,
List
<
String
>
ids
)
{
//先查询出库里面最大的置顶id
int
topNum
=
esService
.
getTopNum
(
index
,
subjectId
);
Map
<
String
,
Map
<
String
,
Object
>>
updateMap
=
new
HashMap
<>();
for
(
int
i
=
0
;
i
<
ids
.
size
();
i
++)
{
String
id
=
ids
.
get
(
i
);
Map
<
String
,
Object
>
updateFields
=
new
HashMap
<>();
updateFields
.
put
(
"topNum"
,
topNum
+
(
ids
.
size
()
-
i
));
updateMap
.
put
(
id
,
updateFields
);
}
esOpUtil
.
bulkUpdateFields
(
index
,
updateMap
);
}
private
void
formatLabel
(
List
<
LabelModelVo
>
labelModelVos
,
DisplayInfo
info
)
{
private
void
formatLabel
(
List
<
LabelModelVo
>
labelModelVos
,
DisplayInfo
info
)
{
if
(
CollectionUtils
.
isNotEmpty
(
labelModelVos
))
{
if
(
CollectionUtils
.
isNotEmpty
(
labelModelVos
))
{
List
<
Label
>
list
=
info
.
getLabels
();
List
<
Label
>
list
=
info
.
getLabels
();
...
...
src/main/java/com/zzsn/event/service/impl/SubjectSimpleServiceImpl.java
浏览文件 @
9def98f0
...
@@ -232,8 +232,10 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
...
@@ -232,8 +232,10 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
@Override
@Override
public
Boolean
configVerification
(
SubjectParamsCheckVO
subjectParamsCheckVO
)
{
public
Boolean
configVerification
(
SubjectParamsCheckVO
subjectParamsCheckVO
)
{
//新
SubjectSimpleVO
subjectSimpleVO
=
subjectParamsCheckVO
.
getSubjectSimpleVO
();
SubjectSimpleVO
subjectSimpleVO
=
subjectParamsCheckVO
.
getSubjectSimpleVO
();
String
subjectId
=
subjectSimpleVO
.
getId
();
String
subjectId
=
subjectSimpleVO
.
getId
();
//旧
SubjectDetailVO
subjectDetailVO
=
queryInfo
(
subjectId
);
SubjectDetailVO
subjectDetailVO
=
queryInfo
(
subjectId
);
Date
firstOpenTime
=
subjectDetailVO
.
getFirstOpenTime
();
Date
firstOpenTime
=
subjectDetailVO
.
getFirstOpenTime
();
//未启用过的可以直接修改,校验通过
//未启用过的可以直接修改,校验通过
...
...
src/main/java/com/zzsn/event/service/impl/SysDictItemServiceImpl.java
浏览文件 @
9def98f0
...
@@ -33,6 +33,10 @@ public class SysDictItemServiceImpl extends ServiceImpl<SysDictItemMapper, SysDi
...
@@ -33,6 +33,10 @@ public class SysDictItemServiceImpl extends ServiceImpl<SysDictItemMapper, SysDi
public
List
<
SysDictItem
>
listByDictCode
(
String
dictCode
)
{
public
List
<
SysDictItem
>
listByDictCode
(
String
dictCode
)
{
return
this
.
baseMapper
.
listByDictCode
(
dictCode
);
return
this
.
baseMapper
.
listByDictCode
(
dictCode
);
}
}
@Override
public
List
<
SysDictItem
>
listByDictCodes
(
List
<
String
>
dictCodes
)
{
return
this
.
baseMapper
.
listByDictCodes
(
dictCodes
);
}
@Override
@Override
public
SysDictItem
dictItemInfoByName
(
String
dictCode
,
String
itemName
)
{
public
SysDictItem
dictItemInfoByName
(
String
dictCode
,
String
itemName
)
{
...
...
src/main/java/com/zzsn/event/task/SubjectStatisticTask.java
浏览文件 @
9def98f0
...
@@ -32,7 +32,7 @@ public class SubjectStatisticTask {
...
@@ -32,7 +32,7 @@ public class SubjectStatisticTask {
@Autowired
@Autowired
private
SubjectStatisticInfoService
subjectStatisticInfoService
;
private
SubjectStatisticInfoService
subjectStatisticInfoService
;
@Scheduled
(
cron
=
"0 30 0 * * ?"
)
//
@Scheduled(cron = "0 30 0 * * ?")
public
void
statistic
()
{
public
void
statistic
()
{
LambdaQueryWrapper
<
Subject
>
queryWrapper
=
Wrappers
.
lambdaQuery
();
LambdaQueryWrapper
<
Subject
>
queryWrapper
=
Wrappers
.
lambdaQuery
();
queryWrapper
.
select
(
Subject:
:
getId
).
eq
(
Subject:
:
getSubjectType
,
1
);
queryWrapper
.
select
(
Subject:
:
getId
).
eq
(
Subject:
:
getSubjectType
,
1
);
...
...
src/main/java/com/zzsn/event/vo/LabelDictItemVO.java
0 → 100644
浏览文件 @
9def98f0
package
com
.
zzsn
.
event
.
vo
;
import
lombok.Data
;
/**
* 标签-字典
*
* @author lkg
* @date 2025/9/3
*/
@Data
public
class
LabelDictItemVO
{
/**标签编码*/
private
String
labelCode
;
/**标签名称*/
private
String
labelName
;
/**标签应用数据字典对应的字典值(itemValue)*/
private
String
labelItemCode
;
}
src/main/resources/application-test.yml
浏览文件 @
9def98f0
...
@@ -180,6 +180,7 @@ infoSource:
...
@@ -180,6 +180,7 @@ infoSource:
waitInfoRemove
:
http://1.95.79.85:8823/baseSourceInfo/api/infoSource/waitInfoRemove
waitInfoRemove
:
http://1.95.79.85:8823/baseSourceInfo/api/infoSource/waitInfoRemove
columnListByWait
:
http://1.95.79.85:8823/baseSourceInfo/api/infoSource/columnListByWait
columnListByWait
:
http://1.95.79.85:8823/baseSourceInfo/api/infoSource/columnListByWait
columnDetail
:
http://1.95.79.85:8823/baseSourceInfo/api/infoSource/columnDetail
columnDetail
:
http://1.95.79.85:8823/baseSourceInfo/api/infoSource/columnDetail
commonLabel
:
1935224186961723394,1935224004379475969
ai-article
:
ai-article
:
thematicColumnConfig-url
:
http://1.95.77.159:10089/reportManage/thematicInformationColumn/column/getThematicColumnConfig
thematicColumnConfig-url
:
http://1.95.77.159:10089/reportManage/thematicInformationColumn/column/getThematicColumnConfig
caiji
:
caiji
:
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论