Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
E
event
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
陈世强
event
Commits
26915460
提交
26915460
authored
10月 14, 2025
作者:
925993793@qq.com
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
【第三方-政策分析(研究中心)】新增第三方专题创建接口
上级
94743fde
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
188 行增加
和
23 行删除
+188
-23
SubjectApi.java
...n/java/com/zzsn/event/controller/thirdApi/SubjectApi.java
+80
-0
ThirdAddSubjectVO.java
...com/zzsn/event/controller/thirdApi/ThirdAddSubjectVO.java
+46
-0
SubjectSimpleService.java
...ain/java/com/zzsn/event/service/SubjectSimpleService.java
+10
-0
SubjectSimpleServiceImpl.java
...com/zzsn/event/service/impl/SubjectSimpleServiceImpl.java
+52
-23
没有找到文件。
src/main/java/com/zzsn/event/controller/thirdApi/SubjectApi.java
0 → 100644
浏览文件 @
26915460
package
com
.
zzsn
.
event
.
controller
.
thirdApi
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.json.JSONUtil
;
import
com.zzsn.event.constant.Result
;
import
com.zzsn.event.entity.Subject
;
import
com.zzsn.event.service.SubjectSimpleService
;
import
com.zzsn.event.service.impl.CaiJiCenterHttpService
;
import
com.zzsn.event.service.impl.ConfigurationMessageService
;
import
com.zzsn.event.xxljob.service.IXxlJobInfoService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.kafka.core.KafkaTemplate
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.annotation.Resource
;
import
java.util.concurrent.CompletableFuture
;
/**
* 研究中心-政策分析-创建专题
*
* @author lkg
* @date 2025/10/11
*/
@Slf4j
@RestController
@RequestMapping
(
"/third/api"
)
public
class
SubjectApi
{
@Autowired
private
SubjectSimpleService
subjectSimpleService
;
@Autowired
private
IXxlJobInfoService
xxlJobInfoService
;
@Autowired
private
ConfigurationMessageService
configurationMessageService
;
@Resource
private
KafkaTemplate
<
String
,
String
>
kafkaTemplate
;
@Autowired
private
CaiJiCenterHttpService
caiJiCenterHttpService
;
@Value
(
"${kafka.topic.subject.run:}"
)
private
String
SUBJECT_MODEL_KAFKA_CHANNEL
;
/**
* 创建专题
*
* @param subjectSimpleVO 参数
* @author lkg
* @date 2025/1/9
*/
@PostMapping
(
"/createSubject"
)
public
Result
<?>
createSubject
(
@RequestBody
ThirdAddSubjectVO
subjectSimpleVO
)
{
Subject
subject
=
subjectSimpleService
.
createPolicySubject
(
subjectSimpleVO
);
CompletableFuture
.
runAsync
(()
->
{
//插入xxlJob
xxlJobInfoService
.
subjectInsert
(
subject
);
});
//远程调用,执行采集入库流程
kafkaTemplate
.
send
(
SUBJECT_MODEL_KAFKA_CHANNEL
,
subject
.
getSubjectCode
());
configurationMessageService
.
bindInfoSourceSend
(
subject
.
getId
());
configurationMessageService
.
bindKeyWordsSend
(
subject
.
getId
(),
null
);
configurationMessageService
.
subjectEnterpriseSourceSync
(
subject
.
getId
());
configurationMessageService
.
subjectPolicySourceSync
(
subject
.
getId
());
try
{
String
res
=
caiJiCenterHttpService
.
subjectStatusEdit
(
subject
.
getStatus
(),
subject
.
getId
());
cn
.
hutool
.
json
.
JSONObject
entries
=
JSONUtil
.
parseObj
(
res
);
//获取code状态码
Integer
code
=
entries
.
getInt
(
"code"
);
if
(
ObjectUtil
.
isEmpty
(
code
)
||
code
!=
200
)
{
log
.
error
(
"专题状态同步采集失败{}"
,
res
);
}
}
catch
(
Exception
e
)
{
log
.
error
(
"专题状态同步采集失败{}"
,
e
.
getMessage
(),
e
);
}
return
Result
.
OK
(
subject
.
getId
());
}
}
src/main/java/com/zzsn/event/controller/thirdApi/ThirdAddSubjectVO.java
0 → 100644
浏览文件 @
26915460
package
com
.
zzsn
.
event
.
controller
.
thirdApi
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
lombok.Getter
;
import
lombok.Setter
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
java.util.Date
;
/**
*
*
* @author lkg
* @date 2024/7/19
*/
@Getter
@Setter
public
class
ThirdAddSubjectVO
{
private
String
subjectName
;
//默认政策分析
private
String
subjectTypeId
=
"1976857756188119042"
;
//默认研究中心
private
String
projectId
=
"1476527644425682945"
;
//默认10分钟调度一次
/**定时单位(1分;2小时;3日;4月)*/
private
String
unit
=
"1"
;
/**定时数值*/
private
Integer
space
=
10
;
private
String
remark
;
@JsonFormat
(
timezone
=
"GMT+8"
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
timeEnable
;
@JsonFormat
(
timezone
=
"GMT+8"
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
timeDisable
;
private
String
library
;
private
Integer
subjectType
=
1
;
private
Integer
dataSource
=
0
;
private
Integer
facePublic
=
0
;
private
Integer
status
=
1
;
/**关键词*/
private
String
keyword
;
/**数据范围(是否是全库) - 采集库全库-1,企业库全库-2,政策库全库-3*/
private
String
dataScope
=
"1"
;
}
src/main/java/com/zzsn/event/service/SubjectSimpleService.java
浏览文件 @
26915460
package
com
.
zzsn
.
event
.
service
;
package
com
.
zzsn
.
event
.
service
;
import
com.zzsn.event.controller.thirdApi.ThirdAddSubjectVO
;
import
com.zzsn.event.entity.Subject
;
import
com.zzsn.event.entity.Subject
;
import
com.zzsn.event.vo.*
;
import
com.zzsn.event.vo.*
;
...
@@ -120,4 +121,13 @@ public interface SubjectSimpleService {
...
@@ -120,4 +121,13 @@ public interface SubjectSimpleService {
* @date 2025/2/6
* @date 2025/2/6
*/
*/
void
clearSubjectData
(
String
subjectId
);
void
clearSubjectData
(
String
subjectId
);
/**
* 新增专题-对外【政策分析专用】
*
* @param thirdAddSubjectVO 参数
* @author lkg
* @date 2025/1/14
*/
Subject
createPolicySubject
(
ThirdAddSubjectVO
thirdAddSubjectVO
);
}
}
src/main/java/com/zzsn/event/service/impl/SubjectSimpleServiceImpl.java
浏览文件 @
26915460
package
com
.
zzsn
.
event
.
service
.
impl
;
package
com
.
zzsn
.
event
.
service
.
impl
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.date.DateTime
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.alibaba.fastjson2.JSON
;
import
com.alibaba.fastjson2.JSON
;
...
@@ -10,6 +9,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
...
@@ -10,6 +9,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.zzsn.event.constant.Constants
;
import
com.zzsn.event.constant.Constants
;
import
com.zzsn.event.controller.thirdApi.ThirdAddSubjectVO
;
import
com.zzsn.event.entity.*
;
import
com.zzsn.event.entity.*
;
import
com.zzsn.event.enums.BindTypeEnum
;
import
com.zzsn.event.enums.BindTypeEnum
;
import
com.zzsn.event.enums.CodePrefixEnum
;
import
com.zzsn.event.enums.CodePrefixEnum
;
...
@@ -51,7 +51,7 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
...
@@ -51,7 +51,7 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
@Autowired
@Autowired
private
ISubjectTypeService
subjectTypeService
;
private
ISubjectTypeService
subjectTypeService
;
@Autowired
@Autowired
private
IKeyWordsService
keyword
Word
sService
;
private
IKeyWordsService
keywordsService
;
@Autowired
@Autowired
private
IKeywordsTypeMapService
keywordsTypeMapService
;
private
IKeywordsTypeMapService
keywordsTypeMapService
;
@Autowired
@Autowired
...
@@ -115,7 +115,7 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
...
@@ -115,7 +115,7 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
scoreModelService
.
commonModifyByKeyword
(
subjectId
,
collect
);
scoreModelService
.
commonModifyByKeyword
(
subjectId
,
collect
);
}
}
//同步配置到采集
//同步配置到采集
configurationMessageService
.
bindKeyWordsSend
(
subjectId
,
null
);
configurationMessageService
.
bindKeyWordsSend
(
subjectId
,
null
);
//默认绑定tpu流程
//默认绑定tpu流程
List
<
ClbModelArrangeSubjectMap
>
tpuList
=
new
ArrayList
<>();
List
<
ClbModelArrangeSubjectMap
>
tpuList
=
new
ArrayList
<>();
ClbModelArrangeSubjectMap
tpu
=
new
ClbModelArrangeSubjectMap
();
ClbModelArrangeSubjectMap
tpu
=
new
ClbModelArrangeSubjectMap
();
...
@@ -196,12 +196,12 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
...
@@ -196,12 +196,12 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
subjectTypeMap
.
setSysOrgCode
(
subject
.
getSysOrgCode
());
subjectTypeMap
.
setSysOrgCode
(
subject
.
getSysOrgCode
());
subjectTypeMap
.
setTypeId
(
subjectTypeId
);
subjectTypeMap
.
setTypeId
(
subjectTypeId
);
subjectTypeMapService
.
save
(
subjectTypeMap
);
subjectTypeMapService
.
save
(
subjectTypeMap
);
}
else
if
(
StringUtils
.
isNotEmpty
(
subjectTypeName
)){
}
else
if
(
StringUtils
.
isNotEmpty
(
subjectTypeName
))
{
UserVo
loginUser
=
UserUtil
.
getLoginUser
();
UserVo
loginUser
=
UserUtil
.
getLoginUser
();
LambdaQueryWrapper
<
SubjectType
>
queryWrapper
=
Wrappers
.
lambdaQuery
();
LambdaQueryWrapper
<
SubjectType
>
queryWrapper
=
Wrappers
.
lambdaQuery
();
queryWrapper
.
eq
(
SubjectType:
:
getTypeName
,
subjectTypeName
)
queryWrapper
.
eq
(
SubjectType:
:
getTypeName
,
subjectTypeName
)
.
eq
(
SubjectType:
:
getCreateBy
,
loginUser
.
getUsername
())
.
eq
(
SubjectType:
:
getCreateBy
,
loginUser
.
getUsername
())
.
eq
(
SubjectType:
:
getSysOrgCode
,
"YJZX"
);
.
eq
(
SubjectType:
:
getSysOrgCode
,
"YJZX"
);
SubjectType
one
=
subjectTypeService
.
getOne
(
queryWrapper
);
SubjectType
one
=
subjectTypeService
.
getOne
(
queryWrapper
);
if
(
ObjectUtil
.
isEmpty
(
one
))
{
if
(
ObjectUtil
.
isEmpty
(
one
))
{
SubjectType
subjectType
=
new
SubjectType
();
SubjectType
subjectType
=
new
SubjectType
();
...
@@ -275,7 +275,7 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
...
@@ -275,7 +275,7 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
return
false
;
return
false
;
}
}
//判断信息源标签配置是否变化,变化则校验不通过;反之通过
//判断信息源标签配置是否变化,变化则校验不通过;反之通过
boolean
judgeInfoSourceLabel
=
judgeInfoSourceLabel
(
subjectId
,
subjectDetailVO
.
getDataScope
(),
subjectParamsCheckVO
.
getDataScope
(),
subjectParamsCheckVO
.
getInfoSourceMainLabelVO
());
boolean
judgeInfoSourceLabel
=
judgeInfoSourceLabel
(
subjectId
,
subjectDetailVO
.
getDataScope
(),
subjectParamsCheckVO
.
getDataScope
(),
subjectParamsCheckVO
.
getInfoSourceMainLabelVO
());
//判断定向信息源是否发生变化(前端传参),true 是;false 否
//判断定向信息源是否发生变化(前端传参),true 是;false 否
boolean
directSourceChange
=
subjectParamsCheckVO
.
isDirectSourceChange
();
boolean
directSourceChange
=
subjectParamsCheckVO
.
isDirectSourceChange
();
return
!
judgeInfoSourceLabel
&&
!
directSourceChange
;
return
!
judgeInfoSourceLabel
&&
!
directSourceChange
;
...
@@ -322,12 +322,12 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
...
@@ -322,12 +322,12 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
/**
/**
* 判断信息源配置是否发生变化 true 是;false 否
* 判断信息源配置是否发生变化 true 是;false 否
*
*
* @param subjectId
专题id
* @param subjectId 专题id
* @param infoSourceMainLabelVO
信息源标签信息(编辑时前端传参)
* @param infoSourceMainLabelVO 信息源标签信息(编辑时前端传参)
* @author lkg
* @author lkg
* @date 2025/2/5
* @date 2025/2/5
*/
*/
private
boolean
judgeInfoSourceLabel
(
String
subjectId
,
Integer
oldDataScope
,
Integer
newDataScope
,
InfoSourceMainLabelVO
infoSourceMainLabelVO
)
{
private
boolean
judgeInfoSourceLabel
(
String
subjectId
,
Integer
oldDataScope
,
Integer
newDataScope
,
InfoSourceMainLabelVO
infoSourceMainLabelVO
)
{
boolean
flag
=
false
;
boolean
flag
=
false
;
if
(
oldDataScope
==
null
)
{
if
(
oldDataScope
==
null
)
{
oldDataScope
=
0
;
oldDataScope
=
0
;
...
@@ -381,7 +381,7 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
...
@@ -381,7 +381,7 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
scoreModelService
.
commonModifyByKeyword
(
subjectId
,
collect
);
scoreModelService
.
commonModifyByKeyword
(
subjectId
,
collect
);
}
}
//同步配置到采集
//同步配置到采集
configurationMessageService
.
bindKeyWordsSend
(
subjectId
,
null
);
configurationMessageService
.
bindKeyWordsSend
(
subjectId
,
null
);
}
}
}
}
...
@@ -402,7 +402,7 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
...
@@ -402,7 +402,7 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
scoreModelService
.
commonModifyByKeyword
(
subjectId
,
collect
);
scoreModelService
.
commonModifyByKeyword
(
subjectId
,
collect
);
}
}
//同步配置到采集
//同步配置到采集
configurationMessageService
.
bindKeyWordsSend
(
subjectId
,
1
);
configurationMessageService
.
bindKeyWordsSend
(
subjectId
,
1
);
}
}
}
}
...
@@ -476,7 +476,7 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
...
@@ -476,7 +476,7 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
List
<
String
>
keywordIds
=
list
.
stream
().
map
(
SubjectKeywordsMap:
:
getKeywordsId
).
collect
(
Collectors
.
toList
());
List
<
String
>
keywordIds
=
list
.
stream
().
map
(
SubjectKeywordsMap:
:
getKeywordsId
).
collect
(
Collectors
.
toList
());
//删除关键词
//删除关键词
keyword
Word
sService
.
removeByIds
(
keywordIds
);
keywordsService
.
removeByIds
(
keywordIds
);
//删除与关键词组的关联关系
//删除与关键词组的关联关系
subjectKeywordsMapService
.
delete
(
subjectId
);
subjectKeywordsMapService
.
delete
(
subjectId
);
//删除关键词组关联关系
//删除关键词组关联关系
...
@@ -499,7 +499,7 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
...
@@ -499,7 +499,7 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
public
void
selected
(
InfoDataSearchCondition
searchCondition
)
{
public
void
selected
(
InfoDataSearchCondition
searchCondition
)
{
//勾选的主题信息列表
//勾选的主题信息列表
List
<
Label
>
themeList
=
searchCondition
.
getThemeList
();
List
<
Label
>
themeList
=
searchCondition
.
getThemeList
();
String
[]
fetchFields
=
new
String
[]{
"id"
,
"checkStatus"
,
"labels"
};
String
[]
fetchFields
=
new
String
[]{
"id"
,
"checkStatus"
,
"labels"
};
searchCondition
.
setFetchFields
(
fetchFields
);
searchCondition
.
setFetchFields
(
fetchFields
);
Map
<
String
,
List
<
SpecialInformation
>>
updateMap
=
new
HashMap
<>();
Map
<
String
,
List
<
SpecialInformation
>>
updateMap
=
new
HashMap
<>();
List
<
SpecialInformation
>
informationList
=
informationService
.
informationAllList
(
searchCondition
);
List
<
SpecialInformation
>
informationList
=
informationService
.
informationAllList
(
searchCondition
);
...
@@ -603,26 +603,55 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
...
@@ -603,26 +603,55 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
Subject
byId
=
subjectService
.
getById
(
subjectId
);
Subject
byId
=
subjectService
.
getById
(
subjectId
);
String
subjectCode
=
byId
.
getSubjectCode
();
String
subjectCode
=
byId
.
getSubjectCode
();
Set
<
String
>
keys
=
redisUtil
.
keys
(
"*"
+
subjectCode
);
Set
<
String
>
keys
=
redisUtil
.
keys
(
"*"
+
subjectCode
);
if
(
CollectionUtil
.
isNotEmpty
(
keys
))
{
if
(
CollectionUtil
.
isNotEmpty
(
keys
))
{
keys
.
forEach
(
key
->
{
keys
.
forEach
(
key
->
{
redisUtil
.
del
(
key
);
redisUtil
.
del
(
key
);
});
});
}
}
//判断是否需要中断数据处理
//判断是否需要中断数据处理
String
runningList
=
remoteModelService
.
isRunningList
(
byId
.
getId
());
String
runningList
=
remoteModelService
.
isRunningList
(
byId
.
getId
());
if
(
runningList
.
contains
(
byId
.
getSubjectCode
())){
if
(
runningList
.
contains
(
byId
.
getSubjectCode
()))
{
remoteModelService
.
breakSubjcet
(
subjectId
);
remoteModelService
.
breakSubjcet
(
subjectId
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"专题-{},删除中间库数据、删除专题相关缓存key、中断专题处理、请求发送失败"
,
subjectId
,
e
);
log
.
error
(
"专题-{},删除中间库数据、删除专题相关缓存key、中断专题处理、请求发送失败"
,
subjectId
,
e
);
}
}
log
.
info
(
"专题-{},删除中间库数据、删除专题相关缓存key、中断专题处理、请求发送成功"
,
subjectId
);
log
.
info
(
"专题-{},删除中间库数据、删除专题相关缓存key、中断专题处理、请求发送成功"
,
subjectId
);
}
}
@Override
public
Subject
createPolicySubject
(
ThirdAddSubjectVO
thirdAddSubjectVO
)
{
SubjectPage
subjectPage
=
new
SubjectPage
();
BeanUtils
.
copyProperties
(
thirdAddSubjectVO
,
subjectPage
);
Subject
subject
=
saveMain
(
subjectPage
);
String
subjectId
=
subject
.
getId
();
//关键词绑定
String
keyword
=
thirdAddSubjectVO
.
getKeyword
();
if
(
StringUtils
.
isNotBlank
(
keyword
))
{
List
<
SearchWordVO
>
keywords
=
new
ArrayList
<>();
SearchWordVO
searchWord
=
new
SearchWordVO
();
searchWord
.
setSearchScope
(
1
);
searchWord
.
setSearchInfo
(
keyword
);
searchWord
.
setSearchLogicRelationship
(
"AND"
);
searchWord
.
setBindingType
(
"1"
);
keywords
.
add
(
searchWord
);
modifyKeyword
(
subjectId
,
subject
.
getSubjectName
(),
keywords
);
//默认通用打分配置
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
());
tpu
.
setArrangeId
(
"1976894424042553345"
);
tpu
.
setType
(
"baseDateToSubject"
);
clbModelArrangeSubjectMapService
.
save
(
tpu
);
}
return
subject
;
}
//目标集合按照另一个集合的顺序排序
//目标集合按照另一个集合的顺序排序
private
void
sortByAnotherList
(
List
<
SearchWordVO
>
list
,
List
<
String
>
anotherList
)
{
private
void
sortByAnotherList
(
List
<
SearchWordVO
>
list
,
List
<
String
>
anotherList
)
{
list
.
sort
((
o1
,
o2
)
->
{
list
.
sort
((
o1
,
o2
)
->
{
...
@@ -666,7 +695,7 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
...
@@ -666,7 +695,7 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
addMapIdList
.
add
(
searchWordVO
);
addMapIdList
.
add
(
searchWordVO
);
}
}
}
}
handlerSubjectKeywordMap
(
subjectId
,
addMapIdList
,
bindList
,
retainList
,
removeIdList
);
handlerSubjectKeywordMap
(
subjectId
,
addMapIdList
,
bindList
,
retainList
,
removeIdList
);
//专题下关键词之间的关系
//专题下关键词之间的关系
modifySubjectKeywordsGroupRelation
(
subjectId
,
retainList
);
modifySubjectKeywordsGroupRelation
(
subjectId
,
retainList
);
}
}
...
@@ -743,7 +772,7 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
...
@@ -743,7 +772,7 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
}
}
//处理专题-关键词绑定关系
//处理专题-关键词绑定关系
private
void
handlerSubjectKeywordMap
(
String
subjectId
,
List
<
SearchWordVO
>
addMapIdList
,
List
<
SubjectKeywordsMap
>
bindList
,
List
<
SearchWordVO
>
retainList
,
List
<
String
>
removeIdList
)
{
private
void
handlerSubjectKeywordMap
(
String
subjectId
,
List
<
SearchWordVO
>
addMapIdList
,
List
<
SubjectKeywordsMap
>
bindList
,
List
<
SearchWordVO
>
retainList
,
List
<
String
>
removeIdList
)
{
if
(
CollectionUtils
.
isNotEmpty
(
addMapIdList
))
{
if
(
CollectionUtils
.
isNotEmpty
(
addMapIdList
))
{
List
<
SubjectKeywordsMap
>
subjectKeywordsMapList
=
new
ArrayList
<>();
List
<
SubjectKeywordsMap
>
subjectKeywordsMapList
=
new
ArrayList
<>();
for
(
SearchWordVO
wordVO
:
addMapIdList
)
{
for
(
SearchWordVO
wordVO
:
addMapIdList
)
{
...
@@ -806,7 +835,7 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
...
@@ -806,7 +835,7 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
String
wordsName
=
subjectName
+
wordsCode
.
substring
(
wordsCode
.
indexOf
(
"-"
));
String
wordsName
=
subjectName
+
wordsCode
.
substring
(
wordsCode
.
indexOf
(
"-"
));
keyWords
.
setWordsName
(
wordsName
);
keyWords
.
setWordsName
(
wordsName
);
keyWords
.
setWordsCode
(
wordsCode
);
keyWords
.
setWordsCode
(
wordsCode
);
keyword
Word
sService
.
save
(
keyWords
);
keywordsService
.
save
(
keyWords
);
//关键词组-分类 关系绑定
//关键词组-分类 关系绑定
KeywordsTypeMap
keywordsTypeMap
=
new
KeywordsTypeMap
();
KeywordsTypeMap
keywordsTypeMap
=
new
KeywordsTypeMap
();
keywordsTypeMap
.
setTypeId
(
KEYWORDS_TYPE_ID
);
keywordsTypeMap
.
setTypeId
(
KEYWORDS_TYPE_ID
);
...
@@ -817,12 +846,12 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
...
@@ -817,12 +846,12 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
wordVO
.
setWordName
(
wordsName
);
wordVO
.
setWordName
(
wordsName
);
}
else
{
}
else
{
keyWords
.
setId
(
id
);
keyWords
.
setId
(
id
);
keyword
Word
sService
.
updateById
(
keyWords
);
keywordsService
.
updateById
(
keyWords
);
}
}
realKeyWordList
.
add
(
wordVO
);
realKeyWordList
.
add
(
wordVO
);
}
}
if
(
CollectionUtils
.
isNotEmpty
(
removeIdList
))
{
if
(
CollectionUtils
.
isNotEmpty
(
removeIdList
))
{
keyword
Word
sService
.
removeByIds
(
removeIdList
);
keywordsService
.
removeByIds
(
removeIdList
);
LambdaQueryWrapper
<
KeywordsTypeMap
>
queryWrapper
=
Wrappers
.
lambdaQuery
();
LambdaQueryWrapper
<
KeywordsTypeMap
>
queryWrapper
=
Wrappers
.
lambdaQuery
();
queryWrapper
.
in
(
KeywordsTypeMap:
:
getKeywordsId
,
removeIdList
);
queryWrapper
.
in
(
KeywordsTypeMap:
:
getKeywordsId
,
removeIdList
);
keywordsTypeMapService
.
remove
(
queryWrapper
);
keywordsTypeMapService
.
remove
(
queryWrapper
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论