Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
E
event
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
陈世强
event
Commits
b3b75c66
提交
b3b75c66
authored
9月 02, 2025
作者:
obcy
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/event_fusion' into event_fusion
上级
52c38dfa
cd73ee57
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
18 个修改的文件
包含
189 行增加
和
38 行删除
+189
-38
CorsConfig.java
src/main/java/com/zzsn/event/config/CorsConfig.java
+0
-1
LlmProperties.java
.../java/com/zzsn/event/config/properties/LlmProperties.java
+2
-0
EventAnalysisController.java
...va/com/zzsn/event/controller/EventAnalysisController.java
+14
-1
ExternalController.java
...om/zzsn/event/external/controller/ExternalController.java
+0
-0
LlmService.java
src/main/java/com/zzsn/event/llm/LlmService.java
+12
-0
LlmServiceImpl.java
src/main/java/com/zzsn/event/llm/LlmServiceImpl.java
+3
-0
SubjectDictMapMapper.java
...main/java/com/zzsn/event/mapper/SubjectDictMapMapper.java
+7
-7
SubjectMapper.java
src/main/java/com/zzsn/event/mapper/SubjectMapper.java
+2
-0
SubjectDictMapMapper.xml
...n/java/com/zzsn/event/mapper/xml/SubjectDictMapMapper.xml
+18
-4
SubjectMapper.xml
src/main/java/com/zzsn/event/mapper/xml/SubjectMapper.xml
+6
-0
ScoreModelService.java
src/main/java/com/zzsn/event/service/ScoreModelService.java
+14
-2
SubjectService.java
src/main/java/com/zzsn/event/service/SubjectService.java
+7
-0
AnalysisServiceImpl.java
...java/com/zzsn/event/service/impl/AnalysisServiceImpl.java
+10
-3
ScoreModelServiceImpl.java
...va/com/zzsn/event/service/impl/ScoreModelServiceImpl.java
+44
-1
SubjectDictMapServiceImpl.java
...om/zzsn/event/service/impl/SubjectDictMapServiceImpl.java
+20
-8
SubjectServiceImpl.java
.../java/com/zzsn/event/service/impl/SubjectServiceImpl.java
+6
-0
SubjectSimpleServiceImpl.java
...com/zzsn/event/service/impl/SubjectSimpleServiceImpl.java
+20
-11
SubjectPage.java
src/main/java/com/zzsn/event/vo/SubjectPage.java
+4
-0
没有找到文件。
src/main/java/com/zzsn/event/config/CorsConfig.java
浏览文件 @
b3b75c66
package
com
.
zzsn
.
event
.
config
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.web.cors.CorsConfiguration
;
import
org.springframework.web.cors.UrlBasedCorsConfigurationSource
;
import
org.springframework.web.filter.CorsFilter
;
...
...
src/main/java/com/zzsn/event/config/properties/LlmProperties.java
浏览文件 @
b3b75c66
...
...
@@ -33,6 +33,8 @@ public class LlmProperties {
private
String
defaultModel
;
//是否开启网络搜索
private
Boolean
webSearch
;
//温度
private
Float
temperature
;
}
/**
...
...
src/main/java/com/zzsn/event/controller/EventAnalysisController.java
浏览文件 @
b3b75c66
...
...
@@ -908,7 +908,20 @@ public class EventAnalysisController {
public
void
downloadPPT
(
@RequestParam
String
versionId
,
HttpServletResponse
response
)
{
EventAnalysisVersion
eventAnalysisVersion
=
eventAnalysisVersionService
.
getById
(
versionId
);
if
(
eventAnalysisVersion
!=
null
&&
StringUtils
.
isNotEmpty
(
eventAnalysisVersion
.
getPptPath
()))
{
commonService
.
downloadTemplate
(
response
,
eventAnalysisVersion
.
getPptPath
());
String
pptPath
=
eventAnalysisVersion
.
getPptPath
();
JSONObject
jsonObject
=
JSON
.
parseObject
(
pptPath
);
Integer
code
=
jsonObject
.
getInteger
(
"code"
);
if
(
code
==
200
)
{
commonService
.
downloadTemplate
(
response
,
jsonObject
.
getString
(
"result"
));
}
else
{
String
json
=
JSON
.
toJSONString
(
Result
.
FAIL
(
"PPT生成失败"
));
response
.
setCharacterEncoding
(
"UTF-8"
);
response
.
setContentType
(
"text/html; charset=utf-8"
);
try
(
PrintWriter
writer
=
response
.
getWriter
())
{
writer
.
println
(
json
);
}
catch
(
Exception
ignored
)
{
}
}
}
else
{
String
json
=
JSON
.
toJSONString
(
Result
.
FAIL
(
201
,
"PPT还在生成中。。。"
));
response
.
setCharacterEncoding
(
"UTF-8"
);
...
...
src/main/java/com/zzsn/event/external/controller/ExternalController.java
浏览文件 @
b3b75c66
差异被折叠。
点击展开。
src/main/java/com/zzsn/event/llm/LlmService.java
浏览文件 @
b3b75c66
package
com
.
zzsn
.
event
.
llm
;
import
com.zzsn.event.config.properties.LlmProperties
;
/**
* 模型调用
*/
...
...
@@ -15,4 +17,14 @@ public interface LlmService {
* @return 大模型响应结果
*/
String
model
(
String
modelType
,
String
modelName
,
String
system
,
String
content
);
/**
* 千问模型调用
*
* @param modelConfig 模型配置信息
* @param system 提示词
* @param content 引用内容
* @return 大模型响应结果
*/
String
qwenModel
(
LlmProperties
.
ModelConfig
modelConfig
,
String
system
,
String
content
);
}
src/main/java/com/zzsn/event/llm/LlmServiceImpl.java
浏览文件 @
b3b75c66
...
...
@@ -136,6 +136,9 @@ public class LlmServiceImpl implements LlmService {
.
messages
(
Arrays
.
asList
(
systemMsg
,
userMsg
))
.
resultFormat
(
GenerationParam
.
ResultFormat
.
MESSAGE
)
.
build
();
if
(
modelConfig
.
getTemperature
()
!=
null
)
{
param
.
setTemperature
(
modelConfig
.
getTemperature
());
}
GenerationResult
call
=
gen
.
call
(
param
);
return
call
.
getOutput
().
getChoices
().
get
(
0
).
getMessage
().
getContent
();
}
catch
(
Exception
e
)
{
...
...
src/main/java/com/zzsn/event/mapper/SubjectDictMapMapper.java
浏览文件 @
b3b75c66
...
...
@@ -22,29 +22,29 @@ public interface SubjectDictMapMapper extends BaseMapper<SubjectDictMap> {
/**
* 专题绑定的数据字典信息
*
* @param subjectId 专题id
* @param subjectId
List
专题id
* @author lkg
* @date 2025/3/28
*/
List
<
DictVO
>
boundList
(
@Param
(
"subjectId
"
)
String
subjectId
);
List
<
DictVO
>
boundList
(
@Param
(
"subjectId
List"
)
List
<
String
>
subjectIdList
);
List
<
String
>
boundIdList
(
@Param
(
"subjectId
"
)
String
subjectId
);
List
<
String
>
boundIdList
(
@Param
(
"subjectId
List"
)
List
<
String
>
subjectIdList
);
/**
* 流程中标签模型绑定的数据字典信息
*
* @param subjectId
* @param subjectId
List
* @return
*/
List
<
DictVO
>
boundArrangeList
(
@Param
(
"subjectId
"
)
String
subjectId
);
List
<
DictVO
>
boundArrangeList
(
@Param
(
"subjectId
List"
)
List
<
String
>
subjectIdList
);
/**
* 老逻辑中标签模型绑定的数据字典信息
*
* @param subjectId
* @param subjectId
List
* @return
*/
List
<
DictVO
>
boundOldList
(
@Param
(
"subjectId
"
)
String
subjectId
);
List
<
DictVO
>
boundOldList
(
@Param
(
"subjectId
List"
)
List
<
String
>
subjectIdList
);
/**
* 查询非数据字典的标签类型
...
...
src/main/java/com/zzsn/event/mapper/SubjectMapper.java
浏览文件 @
b3b75c66
...
...
@@ -125,4 +125,6 @@ public interface SubjectMapper extends BaseMapper<Subject> {
List
<
String
>
getBindSubjectIds
(
@Param
(
"id"
)
String
id
);
String
getMinCreateTime
(
@Param
(
"subjectIdList"
)
List
<
String
>
subjectIdList
);
List
<
String
>
getIdListByType
(
@Param
(
"typeId"
)
String
typeId
);
}
src/main/java/com/zzsn/event/mapper/xml/SubjectDictMapMapper.xml
浏览文件 @
b3b75c66
...
...
@@ -16,12 +16,18 @@
select d.id,d.dict_code as code,d.dict_name as name,'bind' as type
from subject_dict_map m
inner join clb_system.sys_dict d on m.dict_id = d.id
where m.subject_id = #{subjectId}
where m.subject_id in
<foreach
collection=
"subjectIdList"
item=
"id"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</select>
<select
id=
"boundIdList"
resultType=
"String"
>
select dict_id
from subject_dict_map
where subject_id = #{subjectId}
where subject_id in
<foreach
collection=
"subjectIdList"
item=
"id"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</select>
<select
id=
"boundArrangeList"
resultType=
"com.zzsn.event.vo.DictVO"
>
...
...
@@ -39,7 +45,11 @@
WHERE
arrange_id IN
(SELECT DISTINCT arrange_id FROM clb_model_arrange_subject_map
WHERE subject_id = #{subjectId} AND del_flag = 0 )
WHERE subject_id in
<foreach
collection=
"subjectIdList"
item=
"id"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
AND del_flag = 0 )
AND del_flag = 0
AND base_node_id = '1872120615905812482')
and (label_id is not null or dict_code is not null)
...
...
@@ -53,7 +63,11 @@
WHERE
type = 3 AND id IN
(SELECT DISTINCT model_id FROM subject_model_map
WHERE subject_id = #{subjectId} AND type = 3)
WHERE subject_id in
<foreach
collection=
"subjectIdList"
item=
"id"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
AND type = 3)
</select>
<select
id=
"findLabelType"
resultType=
"com.zzsn.event.vo.DictVO"
>
...
...
src/main/java/com/zzsn/event/mapper/xml/SubjectMapper.xml
浏览文件 @
b3b75c66
...
...
@@ -148,6 +148,8 @@
SELECT d.id,
d.subject_name,
d.subject_code,
d.time_enable,
d.time_disable,
d.library,
d.remark,
d.subject_type,
...
...
@@ -327,4 +329,8 @@
</foreach>
</if>
</select>
<select
id=
"getIdListByType"
resultType=
"java.lang.String"
>
select DISTINCT subject_id from subject_type_map where type_id = #{typeId}
</select>
</mapper>
src/main/java/com/zzsn/event/service/ScoreModelService.java
浏览文件 @
b3b75c66
...
...
@@ -4,20 +4,32 @@ import com.alibaba.fastjson2.JSONObject;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.zzsn.event.entity.ScoreModel
;
import
com.zzsn.event.vo.ScoreModelVo
;
import
com.zzsn.event.vo.SearchWordVO
;
import
java.util.List
;
/**
* @Description: 打分模型
* @Author: jeecg-boot
* @Date:
2021-12-17
* @Date: 2021-12-17
* @Version: V1.0
*/
public
interface
ScoreModelService
extends
IService
<
ScoreModel
>
{
void
addOrUpdate
(
ScoreModelVo
scoreModel
,
Integer
category
);
void
addOrUpdate
(
ScoreModelVo
scoreModel
,
Integer
category
);
List
<
ScoreModelVo
>
queryScoreModel
(
String
subjectId
,
String
type
);
JSONObject
scoreModelInfo
(
String
subjectId
,
String
type
);
/**
* 通用打分模型编辑(关键词)
*
* @param subjectId 专题id
* @param keywords 关键词信息
* @author lkg
* @date 2025/9/1
*/
void
commonModifyByKeyword
(
String
subjectId
,
List
<
SearchWordVO
>
keywords
);
}
src/main/java/com/zzsn/event/service/SubjectService.java
浏览文件 @
b3b75c66
...
...
@@ -212,4 +212,11 @@ public interface SubjectService extends IService<Subject> {
Subject
getSubjectOrEventById
(
String
id
);
/**根据编码查询专题或者事件*/
Subject
getSubjectOrEvent
(
String
subjectCode
);
/**
* 根据分组获取专题id列表
* @param typeId
* @return
*/
List
<
String
>
getIdListByType
(
String
typeId
);
}
src/main/java/com/zzsn/event/service/impl/AnalysisServiceImpl.java
浏览文件 @
b3b75c66
...
...
@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.obs.services.model.PutObjectResult
;
import
com.zzsn.event.constant.Constants
;
import
com.zzsn.event.constant.Result
;
import
com.zzsn.event.entity.*
;
import
com.zzsn.event.enums.AnalysisColumnEnum
;
import
com.zzsn.event.es.EsService
;
...
...
@@ -517,9 +518,6 @@ public class AnalysisServiceImpl implements AnalysisService {
InputStream
inputStream
=
connection
.
getInputStream
();
PutObjectResult
putObjectResult
=
obsUtil
.
uploadFile
(
"event_ppt/"
+
eventId
+
"_"
+
timestamp
+
".pptx"
,
inputStream
);
pptFile
=
putObjectResult
.
getObjectKey
();
LambdaUpdateWrapper
<
EventAnalysisVersion
>
update
=
Wrappers
.
lambdaUpdate
();
update
.
set
(
EventAnalysisVersion:
:
getPptPath
,
pptFile
).
eq
(
EventAnalysisVersion:
:
getId
,
versionId
);
eventAnalysisVersionService
.
update
(
update
);
break
;
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
...
...
@@ -535,6 +533,15 @@ public class AnalysisServiceImpl implements AnalysisService {
}
}
}
Result
<
String
>
result
;
if
(
pptFile
==
null
)
{
result
=
Result
.
FAIL
(
"ppt生成失败"
);
}
else
{
result
=
Result
.
OK
(
pptFile
);
}
LambdaUpdateWrapper
<
EventAnalysisVersion
>
update
=
Wrappers
.
lambdaUpdate
();
update
.
set
(
EventAnalysisVersion:
:
getPptPath
,
JSON
.
toJSONString
(
result
)).
eq
(
EventAnalysisVersion:
:
getId
,
versionId
);
eventAnalysisVersionService
.
update
(
update
);
return
pptFile
;
}
...
...
src/main/java/com/zzsn/event/service/impl/ScoreModelServiceImpl.java
浏览文件 @
b3b75c66
...
...
@@ -14,6 +14,7 @@ import com.zzsn.event.service.ISubjectInfoSourceMapService;
import
com.zzsn.event.service.ScoreModelService
;
import
com.zzsn.event.vo.InfoSourceGroupPage
;
import
com.zzsn.event.vo.ScoreModelVo
;
import
com.zzsn.event.vo.SearchWordVO
;
import
com.zzsn.event.vo.SubjectScoreModel
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -22,6 +23,8 @@ import org.springframework.stereotype.Service;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Optional
;
import
java.util.stream.Collectors
;
/**
* @Description: 打分模型
...
...
@@ -81,8 +84,48 @@ public class ScoreModelServiceImpl extends ServiceImpl<ScoreModelMapper, ScoreMo
}
}
@Override
public
void
commonModifyByKeyword
(
String
subjectId
,
List
<
SearchWordVO
>
keywordList
)
{
LambdaQueryWrapper
<
ScoreModel
>
queryWrapper
=
Wrappers
.
lambdaQuery
();
queryWrapper
.
eq
(
ScoreModel:
:
getSubjectId
,
subjectId
)
.
eq
(
ScoreModel:
:
getType
,
"1"
);
ScoreModel
scoreModel
=
this
.
getOne
(
queryWrapper
);
String
keyword
=
keywordList
.
stream
().
map
(
SearchWordVO:
:
getSearchInfo
).
collect
(
Collectors
.
joining
(
"|"
));
if
(
scoreModel
==
null
){
//默认通用打分配置
String
defaultConfig
=
"[{\"id\": \"1-1\", \"name\": \"信息源组\", \"children\": [], \"indexWeight\": 10}, {\"id\": \"1-2\", \"name\": \"文章长度\", \"indexWeight\": 15, \"keyWordsTopLimit\": 2500, \"keyWordsLowerLimit\": 500}, {\"id\": \"1-3\", \"name\": \"内容\", \"children\": [{\"id\": \"1-3-1\", \"name\": \"内容-关键词\", \"keyWords\": \"KEY_WORD\", \"indexWeight\": 75, \"titleWeight\": 10, \"keyWordsTopLimit\": 15, \"keyWordsLowerLimit\": 3}]}]"
;
defaultConfig
=
defaultConfig
.
replace
(
"KEY_WORD"
,
keyword
);
scoreModel
=
new
ScoreModel
();
scoreModel
.
setSubjectId
(
subjectId
);
scoreModel
.
setType
(
"1"
);
scoreModel
.
setData
(
defaultConfig
);
this
.
save
(
scoreModel
);
}
else
{
JSONArray
jsonArray
=
JSON
.
parseArray
((
scoreModel
.
getData
().
toString
()));
Optional
<
Object
>
first
=
jsonArray
.
stream
().
filter
(
e
->
{
JSONObject
jsonObject
=
(
JSONObject
)
e
;
String
name
=
jsonObject
.
getString
(
"name"
);
return
"内容"
.
equals
(
name
);
}).
findFirst
();
if
(
first
.
isPresent
())
{
JSONObject
jsonObject
=
(
JSONObject
)
first
.
get
();
JSONArray
children
=
jsonObject
.
getJSONArray
(
"children"
);
Optional
<
Object
>
wordFirst
=
children
.
stream
().
filter
(
e
->
{
JSONObject
jsonObject1
=
(
JSONObject
)
e
;
String
name
=
jsonObject1
.
getString
(
"name"
);
return
"内容-关键词"
.
equals
(
name
);
}).
findFirst
();
if
(
wordFirst
.
isPresent
())
{
JSONObject
wordJsonObject
=
(
JSONObject
)
wordFirst
.
get
();
wordJsonObject
.
put
(
"keyWords"
,
keyword
);
}
}
scoreModel
.
setData
(
JSON
.
toJSONString
(
jsonArray
));
this
.
updateById
(
scoreModel
);
}
}
private
JSONObject
defaultInfo
(
String
subjectId
,
String
type
){
private
JSONObject
defaultInfo
(
String
subjectId
,
String
type
){
JSONObject
jsonObject
=
new
JSONObject
();
List
<
SubjectScoreModel
>
allList
=
new
ArrayList
<>();
SubjectScoreModel
subjectScoreModel
=
new
SubjectScoreModel
();
...
...
src/main/java/com/zzsn/event/service/impl/SubjectDictMapServiceImpl.java
浏览文件 @
b3b75c66
...
...
@@ -3,19 +3,19 @@ package com.zzsn.event.service.impl;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.zzsn.event.entity.Subject
;
import
com.zzsn.event.entity.SubjectDictMap
;
import
com.zzsn.event.service.SubjectDictMapService
;
import
com.zzsn.event.mapper.SubjectDictMapMapper
;
import
com.zzsn.event.service.SubjectService
;
import
com.zzsn.event.util.tree.Node
;
import
com.zzsn.event.vo.DictVO
;
import
com.zzsn.event.vo.SubjectBindLabelParam
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.Comparator
;
import
java.util.List
;
import
java.util.TreeSet
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
...
...
@@ -27,6 +27,9 @@ import java.util.stream.Stream;
@Service
public
class
SubjectDictMapServiceImpl
extends
ServiceImpl
<
SubjectDictMapMapper
,
SubjectDictMap
>
implements
SubjectDictMapService
{
@Autowired
private
SubjectService
subjectService
;
@Override
public
void
modify
(
SubjectBindLabelParam
bindLabelParam
)
{
String
subjectId
=
bindLabelParam
.
getSubjectId
();
...
...
@@ -49,9 +52,18 @@ public class SubjectDictMapServiceImpl extends ServiceImpl<SubjectDictMapMapper,
@Override
public
List
<
DictVO
>
boundList
(
String
subjectId
)
{
Subject
byId
=
subjectService
.
getById
(
subjectId
);
List
<
String
>
subjectIdList
=
Collections
.
singletonList
(
subjectId
);
if
(
byId
==
null
){
//不是专题时,根据分组获取专题列表
subjectIdList
=
subjectService
.
getIdListByType
(
subjectId
);
}
if
(
subjectIdList
.
isEmpty
()){
return
new
ArrayList
<>();
}
//直接绑定的字典
List
<
DictVO
>
dictVOS
=
baseMapper
.
boundList
(
subjectId
);
List
<
String
>
boundIds
=
baseMapper
.
boundIdList
(
subjectId
);
List
<
DictVO
>
dictVOS
=
baseMapper
.
boundList
(
subjectId
List
);
List
<
String
>
boundIds
=
baseMapper
.
boundIdList
(
subjectId
List
);
if
(
boundIds
.
size
()>
dictVOS
.
size
()){
List
<
String
>
ids
=
dictVOS
.
stream
().
map
(
DictVO:
:
getId
).
collect
(
Collectors
.
toList
());
List
<
String
>
lids
=
new
ArrayList
<>(
boundIds
);
...
...
@@ -64,11 +76,11 @@ public class SubjectDictMapServiceImpl extends ServiceImpl<SubjectDictMapMapper,
dictVOS
.
addAll
(
baseMapper
.
findLeaderLabelType
(
boundIds
));
}
//流程中标签模型绑定字典
List
<
DictVO
>
dictArrange
=
baseMapper
.
boundArrangeList
(
subjectId
);
List
<
DictVO
>
dictArrange
=
baseMapper
.
boundArrangeList
(
subjectId
List
);
dictVOS
.
addAll
(
dictArrange
);
if
(
dictArrange
.
isEmpty
()){
//未绑定流程的(可能)查询老逻辑保定的字典
List
<
DictVO
>
dictOld
=
baseMapper
.
boundOldList
(
subjectId
);
List
<
DictVO
>
dictOld
=
baseMapper
.
boundOldList
(
subjectId
List
);
dictVOS
.
addAll
(
dictOld
);
}
dictVOS
.
forEach
(
dictVO
->
{
...
...
src/main/java/com/zzsn/event/service/impl/SubjectServiceImpl.java
浏览文件 @
b3b75c66
...
...
@@ -1545,6 +1545,12 @@ public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> impl
}
}
@Override
public
List
<
String
>
getIdListByType
(
String
typeId
)
{
return
this
.
baseMapper
.
getIdListByType
(
typeId
);
}
@Override
public
Subject
getSubjectOrEventById
(
String
id
)
{
...
...
src/main/java/com/zzsn/event/service/impl/SubjectSimpleServiceImpl.java
浏览文件 @
b3b75c66
...
...
@@ -110,16 +110,10 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
if
(
CollectionUtils
.
isNotEmpty
(
keywords
))
{
modifyKeyword
(
subjectId
,
subject
.
getSubjectName
(),
keywords
);
//默认通用打分配置
String
defaultConfig
=
"[{\"id\": \"1-1\", \"name\": \"信息源组\", \"children\": [], \"indexWeight\": 10}, {\"id\": \"1-2\", \"name\": \"文章长度\", \"indexWeight\": 15, \"keyWordsTopLimit\": 2500, \"keyWordsLowerLimit\": 500}, {\"id\": \"1-3\", \"name\": \"内容\", \"children\": [{\"id\": \"1-3-1\", \"name\": \"内容-关键词\", \"keyWords\": \"KEY_WORD\", \"indexWeight\": 75, \"titleWeight\": 10, \"keyWordsTopLimit\": 15, \"keyWordsLowerLimit\": 3}]}]"
;
List
<
SearchWordVO
>
collect
=
keywords
.
stream
().
filter
(
searchWordVO
->
!
"NOT"
.
equalsIgnoreCase
(
searchWordVO
.
getSearchLogicRelationship
())).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isNotEmpty
(
collect
))
{
defaultConfig
=
defaultConfig
.
replace
(
"KEY_WORD"
,
String
.
join
(
"|"
,
collect
.
stream
().
map
(
SearchWordVO:
:
getSearchInfo
).
collect
(
Collectors
.
toList
()))
);
scoreModelService
.
commonModifyByKeyword
(
subjectId
,
collect
);
}
ScoreModel
scoreModel
=
new
ScoreModel
();
scoreModel
.
setSubjectId
(
subjectId
);
scoreModel
.
setType
(
"1"
);
scoreModel
.
setData
(
defaultConfig
);
scoreModelService
.
save
(
scoreModel
);
//同步配置到采集
configurationMessageService
.
bindKeyWordsSend
(
subjectId
,
null
);
//默认绑定tpu流程
...
...
@@ -150,8 +144,11 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
List
<
SearchWordVO
>
keywords
=
subjectSimpleVO
.
getKeywords
();
if
(
CollectionUtils
.
isNotEmpty
(
keywords
))
{
modifyKeyword
(
subjectId
,
subject
.
getSubjectName
(),
keywords
);
//同步配置到采集
//configurationMessageService.bindKeyWordsSend(subjectId,1);
//默认通用打分配置
List
<
SearchWordVO
>
collect
=
keywords
.
stream
().
filter
(
searchWordVO
->
!
"NOT"
.
equalsIgnoreCase
(
searchWordVO
.
getSearchLogicRelationship
())).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isNotEmpty
(
collect
))
{
scoreModelService
.
commonModifyByKeyword
(
subjectId
,
collect
);
}
//默认绑定tpu流程
ClbModelArrangeSubjectMap
tpu
=
new
ClbModelArrangeSubjectMap
();
tpu
.
setSubjectId
(
subject
.
getId
());
...
...
@@ -371,12 +368,18 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
BeanUtils
.
copyProperties
(
subjectSimpleVO
,
subjectPage
);
subjectPage
.
setProjectId
(
PROJECT_ID
);
subjectService
.
updateMain
(
subjectPage
);
String
subjectId
=
subjectSimpleVO
.
getId
();
//关键词绑定
List
<
SearchWordVO
>
keywords
=
subjectSimpleVO
.
getKeywords
();
if
(
CollectionUtils
.
isNotEmpty
(
keywords
))
{
modifyKeyword
(
subjectSimpleVO
.
getId
(),
subjectSimpleVO
.
getSubjectName
(),
keywords
);
//默认通用打分配置
List
<
SearchWordVO
>
collect
=
keywords
.
stream
().
filter
(
searchWordVO
->
!
"NOT"
.
equalsIgnoreCase
(
searchWordVO
.
getSearchLogicRelationship
())).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isNotEmpty
(
collect
))
{
scoreModelService
.
commonModifyByKeyword
(
subjectId
,
collect
);
}
//同步配置到采集
configurationMessageService
.
bindKeyWordsSend
(
subject
SimpleVO
.
getId
()
,
null
);
configurationMessageService
.
bindKeyWordsSend
(
subject
Id
,
null
);
}
}
...
...
@@ -386,12 +389,18 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
BeanUtils
.
copyProperties
(
subjectSimpleVO
,
subjectPage
);
subjectPage
.
setProjectId
(
"1955112691539480577"
);
subjectService
.
updateMain
(
subjectPage
);
String
subjectId
=
subjectSimpleVO
.
getId
();
//关键词绑定
List
<
SearchWordVO
>
keywords
=
subjectSimpleVO
.
getKeywords
();
if
(
CollectionUtils
.
isNotEmpty
(
keywords
))
{
modifyKeyword
(
subjectSimpleVO
.
getId
(),
subjectSimpleVO
.
getSubjectName
(),
keywords
);
//默认通用打分配置
List
<
SearchWordVO
>
collect
=
keywords
.
stream
().
filter
(
searchWordVO
->
!
"NOT"
.
equalsIgnoreCase
(
searchWordVO
.
getSearchLogicRelationship
())).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isNotEmpty
(
collect
))
{
scoreModelService
.
commonModifyByKeyword
(
subjectId
,
collect
);
}
//同步配置到采集
configurationMessageService
.
bindKeyWordsSend
(
subject
SimpleVO
.
getId
()
,
1
);
configurationMessageService
.
bindKeyWordsSend
(
subject
Id
,
1
);
}
}
...
...
src/main/java/com/zzsn/event/vo/SubjectPage.java
浏览文件 @
b3b75c66
...
...
@@ -203,4 +203,8 @@ public class SubjectPage {
@JsonFormat
(
timezone
=
"GMT+8"
,
pattern
=
"yyyy-MM-dd"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd"
)
private
Date
latestDataDate
;
/**采集状态(定制专题)*/
private
String
collectStatus
;
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论