Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
E
event
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
陈世强
event
Commits
4a1f6bb3
提交
4a1f6bb3
authored
2月 10, 2025
作者:
925993793@qq.com
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
调试修改
上级
107e2609
隐藏空白字符变更
内嵌
并排
正在显示
20 个修改的文件
包含
193 行增加
和
42 行删除
+193
-42
Constants.java
src/main/java/com/zzsn/event/constant/Constants.java
+3
-0
FileController.java
src/main/java/com/zzsn/event/controller/FileController.java
+4
-2
SubjectManageController.java
...va/com/zzsn/event/controller/SubjectManageController.java
+19
-1
EsService.java
src/main/java/com/zzsn/event/es/EsService.java
+15
-6
SubjectMapper.java
src/main/java/com/zzsn/event/mapper/SubjectMapper.java
+12
-0
SubjectMapper.xml
src/main/java/com/zzsn/event/mapper/xml/SubjectMapper.xml
+8
-1
SubjectService.java
src/main/java/com/zzsn/event/service/SubjectService.java
+11
-0
ClbSysAttachmentServiceImpl.java
.../zzsn/event/service/impl/ClbSysAttachmentServiceImpl.java
+2
-1
InformationServiceImpl.java
...a/com/zzsn/event/service/impl/InformationServiceImpl.java
+28
-0
KeyWordsServiceImpl.java
...java/com/zzsn/event/service/impl/KeyWordsServiceImpl.java
+19
-15
SubjectInfoSourceMapServiceImpl.java
...n/event/service/impl/SubjectInfoSourceMapServiceImpl.java
+13
-7
SubjectServiceImpl.java
.../java/com/zzsn/event/service/impl/SubjectServiceImpl.java
+6
-0
SubjectSimpleServiceImpl.java
...com/zzsn/event/service/impl/SubjectSimpleServiceImpl.java
+6
-2
PythonUtil.java
src/main/java/com/zzsn/event/util/PythonUtil.java
+19
-0
KeywordsTypeVo.java
src/main/java/com/zzsn/event/vo/KeywordsTypeVo.java
+6
-0
AttachmentInfo.java
src/main/java/com/zzsn/event/vo/es/AttachmentInfo.java
+1
-1
DisplayInfo.java
src/main/java/com/zzsn/event/vo/es/DisplayInfo.java
+4
-0
application-dev.yml
src/main/resources/application-dev.yml
+9
-5
application-pro.yml
src/main/resources/application-pro.yml
+6
-1
application-test.yml
src/main/resources/application-test.yml
+2
-0
没有找到文件。
src/main/java/com/zzsn/event/constant/Constants.java
浏览文件 @
4a1f6bb3
...
...
@@ -102,4 +102,7 @@ public class Constants {
}
public
static
final
String
HISTORY_DATE_QUEUE
=
"HISTORY_DATE_QUEUE:"
;
//obs 文件浏览地址 前部分
public
static
final
String
OBS_FILE_PATH_URL_PREFIX
=
"http://obs.ciglobal.cn/"
;
}
src/main/java/com/zzsn/event/controller/FileController.java
浏览文件 @
4a1f6bb3
...
...
@@ -146,6 +146,10 @@ public class FileController {
@PostMapping
(
"/importInfo"
)
public
Result
<?>
importInfo
(
HttpServletRequest
request
)
{
UserVo
userVo
=
UserUtil
.
getLoginUser
();
String
subjectId
=
request
.
getParameter
(
"subjectId"
);
if
(
StringUtils
.
isBlank
(
subjectId
))
{
return
Result
.
FAIL
(
500
,
"专题id不能为空"
);
}
MultipartHttpServletRequest
multipartRequest
=
(
MultipartHttpServletRequest
)
request
;
Map
<
String
,
MultipartFile
>
fileMap
=
multipartRequest
.
getFileMap
();
if
(
fileMap
.
size
()
<
1
)
{
...
...
@@ -158,7 +162,6 @@ public class FileController {
CompletableFuture
.
runAsync
(()->{
//开启日志
ClbFileOperationLog
clbFileOperationLog
=
clbFileOperationLogService
.
operationStart
(
multipartFile
.
getOriginalFilename
(),
userVo
);
String
subjectId
=
request
.
getParameter
(
"subjectId"
);
String
isTopping
=
request
.
getParameter
(
"isTopping"
);
String
isExamine
=
request
.
getParameter
(
"isExamine"
);
try
{
...
...
@@ -302,7 +305,6 @@ public class FileController {
String
fileSuffix
=
multipartFile
.
getOriginalFilename
().
substring
(
index
+
1
);
if
(
"xls"
.
equals
(
fileSuffix
)
||
"xlsx"
.
equals
(
fileSuffix
))
{
CompletableFuture
.
runAsync
(()
->
{
try
{
byte
[]
fileData
=
multipartFile
.
getBytes
();
//读取文件内容
...
...
src/main/java/com/zzsn/event/controller/SubjectManageController.java
浏览文件 @
4a1f6bb3
...
...
@@ -14,6 +14,8 @@ import com.zzsn.event.es.EsService;
import
com.zzsn.event.feign.api.RemoteModelService
;
import
com.zzsn.event.service.*
;
import
com.zzsn.event.util.*
;
import
com.zzsn.event.util.user.UserUtil
;
import
com.zzsn.event.util.user.UserVo
;
import
com.zzsn.event.vo.*
;
import
com.zzsn.event.vo.es.SpecialInformation
;
import
com.zzsn.event.xxljob.entity.XxlJobInfo
;
...
...
@@ -91,7 +93,7 @@ public class SubjectManageController {
private
KafkaTemplate
<
String
,
String
>
kafkaTemplate
;
@Autowired
private
PythonUtil
pythonUtil
;
@Autowired
@Autowired
(
required
=
false
)
private
RemoteModelService
remoteModelService
;
...
...
@@ -141,6 +143,22 @@ public class SubjectManageController {
}
/**
* 当前用户可见的专题列表-研究中心
*
* @param subjectName 专题名称
* @author lkg
* @date 2025/2/8
*/
@GetMapping
(
"/visiblePageList"
)
public
Result
<?>
visiblePageList
(
@RequestParam
(
required
=
false
)
String
subjectName
,
@RequestParam
(
name
=
"pageNo"
,
defaultValue
=
"1"
)
Integer
pageNo
,
@RequestParam
(
name
=
"pageSize"
,
defaultValue
=
"10"
)
Integer
pageSize
){
UserVo
loginUser
=
UserUtil
.
getLoginUser
();
Page
<
String
>
pageList
=
subjectService
.
visiblePageList
(
loginUser
.
getUsername
(),
subjectName
,
pageNo
,
pageSize
);
return
Result
.
OK
(
pageList
);
}
/**
* 分页列表查询
*
* @param subjectCondition 搜索条件
...
...
src/main/java/com/zzsn/event/es/EsService.java
浏览文件 @
4a1f6bb3
...
...
@@ -1732,22 +1732,31 @@ public class EsService {
}
}
Integer
checkStatus
=
searchCondition
.
getCheckStatus
();
Integer
deleteFlag
=
searchCondition
.
getDeleteFlag
();
if
(
checkStatus
!=
null
)
{
boolQuery
.
must
(
QueryBuilders
.
termQuery
(
"checkStatus"
,
checkStatus
));
}
if
(
StringUtils
.
isNotBlank
(
searchCondition
.
getVideo
()))
{
boolQuery
.
must
(
QueryBuilders
.
matchQuery
(
"type"
,
"video"
));
}
else
{
boolQuery
.
mustNot
(
QueryBuilders
.
matchQuery
(
"type"
,
"video"
));
if
(
deleteFlag
==
null
)
{
deleteFlag
=
0
;
}
}
//删除状态查询
if
(
searchCondition
.
getDeleteFlag
()
!=
null
)
{
if
(
searchCondition
.
getDeleteFlag
()
!=
0
)
{
if
(
deleteFlag
!=
null
)
{
if
(
deleteFlag
!=
0
)
{
boolQuery
.
must
(
QueryBuilders
.
termQuery
(
"deleteFlag"
,
"1"
));
}
else
{
boolQuery
.
mustNot
(
QueryBuilders
.
termQuery
(
"deleteFlag"
,
"1"
));
}
}
//免审核状态
if
(
searchCondition
.
getIsFreeCheck
()
!=
null
)
{
boolQuery
.
must
(
QueryBuilders
.
termQuery
(
"isFreeCheck"
,
1
));
}
if
(
StringUtils
.
isNotBlank
(
searchCondition
.
getVideo
()))
{
boolQuery
.
must
(
QueryBuilders
.
matchQuery
(
"type"
,
"video"
));
}
else
{
boolQuery
.
mustNot
(
QueryBuilders
.
matchQuery
(
"type"
,
"video"
));
}
//专题库类别筛选
if
(
CollectionUtils
.
isNotEmpty
(
searchCondition
.
getClassificationType
()))
{
boolQuery
.
must
(
QueryBuilders
.
termsQuery
(
"classificationType"
,
searchCondition
.
getClassificationType
()));
...
...
src/main/java/com/zzsn/event/mapper/SubjectMapper.java
浏览文件 @
4a1f6bb3
...
...
@@ -37,6 +37,7 @@ public interface SubjectMapper extends BaseMapper<Subject> {
* @date 2024/12/18
*/
Page
<
SubjectPage
>
researchCenterPageList
(
@Param
(
"subjectCondition"
)
SubjectCondition
subjectCondition
,
Page
<
SubjectPage
>
page
);
/**
* 专题分页列表(公开)-研究中心
*
...
...
@@ -48,6 +49,16 @@ public interface SubjectMapper extends BaseMapper<Subject> {
Page
<
SubjectPage
>
researchCenterFacePageList
(
@Param
(
"subjectCondition"
)
SubjectCondition
subjectCondition
,
Page
<
SubjectPage
>
page
);
/**
* 当前用户可见的专题分页列表(公开和个人非公开)-研究中心
*
* @param username 用户名称
* @param page 分页参数
* @author lkg
* @date 2025/2/8
*/
Page
<
String
>
visibleList
(
String
username
,
String
subjectName
,
Page
<
String
>
page
);
/**
* 获取专题详情(包含样例文章信息)
*
* @param subjectId 专题id
...
...
@@ -55,6 +66,7 @@ public interface SubjectMapper extends BaseMapper<Subject> {
* @date 2025/1/8
*/
SubjectDetailVO
queryInfo
(
@Param
(
"subjectId"
)
String
subjectId
);
/**
* 专题详情
*
...
...
src/main/java/com/zzsn/event/mapper/xml/SubjectMapper.xml
浏览文件 @
4a1f6bb3
...
...
@@ -130,7 +130,7 @@
from subject d
LEFT JOIN subject_type_map b ON b.subject_id = d.id
LEFT JOIN subject_type c ON b.type_id = c.id
where face_public = 1
where
d.
face_public = 1
<if
test=
"subjectCondition.id !=null and subjectCondition.id !=''"
>
and d.id =#{subjectCondition.id}
</if>
...
...
@@ -149,6 +149,13 @@
order by d.create_time desc
</select>
<select
id=
"visibleList"
resultType=
"String"
>
select subject_name from subject d where (d.face_public = 1 or d.create_by = #{username})
<if
test=
"subjectName != null and subjectName != ''"
>
and d.subject_name like concat('%',#{subjectName},'%')
</if>
</select>
<resultMap
id=
"SubjectDetailVOMap"
type=
"com.zzsn.event.vo.SubjectDetailVO"
>
<result
column=
"subject_name"
property=
"subjectName"
/>
<result
column=
"subjectTypeId"
property=
"subjectTypeId"
/>
...
...
src/main/java/com/zzsn/event/service/SubjectService.java
浏览文件 @
4a1f6bb3
...
...
@@ -39,6 +39,17 @@ public interface SubjectService extends IService<Subject> {
Page
<
SubjectPage
>
researchCenterPageList
(
SubjectCondition
subjectCondition
,
Integer
pageNo
,
Integer
pageSize
);
/**
* 当前用户可见的专题分页列表(公开和个人非公开)-研究中心
*
* @param username 用户名称
* @param pageNo 当前页
* @param pageSize 每页返回条数
* @author lkg
* @date 2025/2/8
*/
Page
<
String
>
visiblePageList
(
String
username
,
String
subjectName
,
Integer
pageNo
,
Integer
pageSize
);
/**
* 获取专题详情(包含样例文章信息)
*
* @param subjectId 专题id
...
...
src/main/java/com/zzsn/event/service/impl/ClbSysAttachmentServiceImpl.java
浏览文件 @
4a1f6bb3
...
...
@@ -2,6 +2,7 @@ package com.zzsn.event.service.impl;
import
cn.hutool.core.io.FileUtil
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.zzsn.event.constant.Constants
;
import
com.zzsn.event.entity.ClbSysAttachment
;
import
com.zzsn.event.mapper.ClbSysAttachmentMapper
;
import
com.zzsn.event.service.IClbSysAttachmentService
;
...
...
@@ -50,7 +51,7 @@ public class ClbSysAttachmentServiceImpl extends ServiceImpl<ClbSysAttachmentMap
this
.
save
(
clbSysAttachment
);
AttachmentInfo
attachmentInfo
=
new
AttachmentInfo
();
attachmentInfo
.
setAttachmentName
(
file
.
getOriginalFilename
());
attachmentInfo
.
setAttachmentFullPath
(
"http://obs.ciglobal.cn/"
+
url
);
attachmentInfo
.
setAttachmentFullPath
(
Constants
.
OBS_FILE_PATH_URL_PREFIX
+
url
);
attachmentInfo
.
setCategory
(
fileSuffix
);
attachmentInfo
.
setFileSize
(
FileUtil
.
readableFileSize
(
file
.
getSize
()));
attachmentInfo
.
setAttachmentId
(
clbSysAttachment
.
getId
().
toString
());
...
...
src/main/java/com/zzsn/event/service/impl/InformationServiceImpl.java
浏览文件 @
4a1f6bb3
...
...
@@ -87,6 +87,8 @@ public class InformationServiceImpl implements InformationService {
private
ICollectionMapService
collectionMapService
;
@Autowired
private
SysDictItemService
sysDictItemService
;
@Autowired
private
IClbSysAttachmentService
csAttachmentService
;
@Override
...
...
@@ -158,6 +160,7 @@ public class InformationServiceImpl implements InformationService {
@Override
public
DisplayInfo
queryInfo
(
Integer
type
,
String
index
,
String
id
)
{
DisplayInfo
info
=
(
DisplayInfo
)
esOpUtil
.
getInfoById
(
index
,
id
,
DisplayInfo
.
class
);
info
.
setDbIndex
(
index
);
if
(
StringUtils
.
isNotEmpty
(
info
.
getContentWithTag
()))
{
String
contentNoTag
=
Utility
.
TransferHTML2TextWithImg
(
info
.
getContentWithTag
());
String
contentNoTag2
=
Utility
.
dealImg
(
contentNoTag
);
...
...
@@ -165,6 +168,30 @@ public class InformationServiceImpl implements InformationService {
}
info
.
setPublishDate
(
EsDateUtil
.
esFieldDateMapping
(
info
.
getPublishDate
()));
if
(
type
==
2
)
{
//获取附件信息
if
(
info
.
getAttachmentIds
()
!=
null
&&
info
.
getAttachmentIds
().
size
()
>
0
)
{
List
<
AttachmentInfo
>
attachmentInfoList
=
new
ArrayList
<>();
for
(
String
attachmentId
:
info
.
getAttachmentIds
())
{
QueryWrapper
<
ClbSysAttachment
>
queryWrapper
=
Wrappers
.
query
();
queryWrapper
.
eq
(
"id"
,
attachmentId
);
ClbSysAttachment
clbSysAttachment
=
clbSysAttachmentService
.
getOne
(
queryWrapper
);
if
(
clbSysAttachment
!=
null
)
{
AttachmentInfo
attachmentInfo
=
new
AttachmentInfo
();
attachmentInfo
.
setAttachmentName
(
clbSysAttachment
.
getName
());
attachmentInfo
.
setAttachmentPath
(
clbSysAttachment
.
getPath
());
attachmentInfo
.
setGroup
(
clbSysAttachment
.
getGroupName
());
attachmentInfo
.
setAttachmentId
(
String
.
valueOf
(
clbSysAttachment
.
getId
()));
attachmentInfo
.
setAttachmentFullPath
(
Constants
.
OBS_FILE_PATH_URL_PREFIX
+
clbSysAttachment
.
getObjectKey
());
attachmentInfo
.
setPageSize
(
clbSysAttachment
.
getPageSize
());
attachmentInfo
.
setSource
(
clbSysAttachment
.
getSource
());
attachmentInfo
.
setFileSize
(
clbSysAttachment
.
getFileSize
());
attachmentInfoList
.
add
(
attachmentInfo
);
}
}
info
.
setAttachmentInfos
(
attachmentInfoList
);
info
.
setYnArticle
(
false
);
}
CompletableFuture
.
runAsync
(()->
addReadNum
(
info
,
index
));
}
return
info
;
...
...
@@ -303,6 +330,7 @@ public class InformationServiceImpl implements InformationService {
specialInformation
.
setId
(
id
);
specialInformation
.
setUniqueCode
(
id
);
specialInformation
.
setDeleteFlag
(
0
);
specialInformation
.
setCheckStatus
(
0
);
specialInformation
.
setTopNum
(
0
);
specialInformation
.
setFlag
(
"1"
);
specialInformation
.
setCreateDate
(
EsDateUtil
.
esFieldDateFormat
(
cn
.
hutool
.
core
.
date
.
DateUtil
.
formatDateTime
(
new
Date
())));
...
...
src/main/java/com/zzsn/event/service/impl/KeyWordsServiceImpl.java
浏览文件 @
4a1f6bb3
...
...
@@ -73,6 +73,7 @@ public class KeyWordsServiceImpl extends ServiceImpl<KeyWordsMapper, KeyWords> i
Node
node
=
new
Node
();
node
.
setId
(
e
.
getId
());
node
.
setPid
(
e
.
getPid
());
nodeList
.
add
(
node
);
});
typeIds
=
TreeUtil
.
belowList
(
nodeList
,
keyWordsTypeId
,
true
);
}
...
...
@@ -137,21 +138,24 @@ public class KeyWordsServiceImpl extends ServiceImpl<KeyWordsMapper, KeyWords> i
KeyWords
keyWords
=
new
KeyWords
();
BeanUtils
.
copyProperties
(
keyWordsPage
,
keyWords
);
//更细redis缓存
KeyWordsDTO
keyWordsDTO
=
(
KeyWordsDTO
)
redisUtil
.
get
(
Constants
.
KEY_WORDS_TO_REDIS_PREFIX
+
keyWords
.
getWordsCode
());
keyWordsDTO
.
setKeyWord
(
keyWordsPage
.
getKeyWord
());
keyWordsDTO
.
setExclusionWord
(
keyWordsPage
.
getExclusionWord
());
redisUtil
.
set
(
Constants
.
KEY_WORDS_TO_REDIS_PREFIX
+
keyWords
.
getWordsCode
(),
keyWordsDTO
);
//判断是否存在,不存在新增
int
count
=
xxlJobInfoService
.
selectCount
(
keyWordsPage
.
getWordsCode
());
if
(
count
<
1
)
{
//之前插入应该异常,再此处再次插入数据
//插入xxljob
xxlJobInfoService
.
keyWordsInsert
(
keyWordsDTO
);
}
else
{
//更新xxljob
List
<
String
>
keyWordsCodes
=
new
ArrayList
<>();
keyWordsCodes
.
add
(
keyWordsDTO
.
getWordsCode
());
xxlJobInfoService
.
keyWordsUpdate
(
keyWordsCodes
,
keyWordsPage
.
getStatus
());
Object
object
=
redisUtil
.
get
(
Constants
.
KEY_WORDS_TO_REDIS_PREFIX
+
keyWords
.
getWordsCode
());
if
(
object
!=
null
)
{
KeyWordsDTO
keyWordsDTO
=
(
KeyWordsDTO
)
object
;
keyWordsDTO
.
setKeyWord
(
keyWordsPage
.
getKeyWord
());
keyWordsDTO
.
setExclusionWord
(
keyWordsPage
.
getExclusionWord
());
redisUtil
.
set
(
Constants
.
KEY_WORDS_TO_REDIS_PREFIX
+
keyWords
.
getWordsCode
(),
keyWordsDTO
);
//判断是否存在,不存在新增
int
count
=
xxlJobInfoService
.
selectCount
(
keyWordsPage
.
getWordsCode
());
if
(
count
<
1
)
{
//之前插入应该异常,再此处再次插入数据
//插入xxljob
xxlJobInfoService
.
keyWordsInsert
(
keyWordsDTO
);
}
else
{
//更新xxljob
List
<
String
>
keyWordsCodes
=
new
ArrayList
<>();
keyWordsCodes
.
add
(
keyWordsDTO
.
getWordsCode
());
xxlJobInfoService
.
keyWordsUpdate
(
keyWordsCodes
,
keyWordsPage
.
getStatus
());
}
}
//插入关键词表
baseMapper
.
updateById
(
keyWords
);
...
...
src/main/java/com/zzsn/event/service/impl/SubjectInfoSourceMapServiceImpl.java
浏览文件 @
4a1f6bb3
...
...
@@ -6,6 +6,7 @@ import cn.hutool.core.util.ObjectUtil;
import
cn.hutool.core.util.StrUtil
;
import
com.alibaba.fastjson2.JSONArray
;
import
com.alibaba.fastjson2.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.zzsn.event.entity.InfoSourceGroup
;
...
...
@@ -280,13 +281,18 @@ public class SubjectInfoSourceMapServiceImpl extends ServiceImpl<SubjectInfoSour
.
eq
(
SubjectInfoSourceMap:
:
getSubjectId
,
subjectId
)
.
eq
(
SubjectInfoSourceMap:
:
getType
,
sourceType
));
if
(
CollUtil
.
isNotEmpty
(
list
)){
this
.
update
(
Wrappers
.<
SubjectInfoSourceMap
>
lambdaUpdate
()
.
set
(
ObjectUtil
.
isNotEmpty
(
infoSourceGroupPage
.
getIsExemptKeyword
()),
SubjectInfoSourceMap:
:
getIsExemptKeyword
,
infoSourceGroupPage
.
getIsExemptKeyword
())
.
set
(
ObjectUtil
.
isNotEmpty
(
infoSourceGroupPage
.
getIsFreeCheck
()),
SubjectInfoSourceMap:
:
getIsFreeCheck
,
infoSourceGroupPage
.
getIsFreeCheck
())
.
set
(
ObjectUtil
.
isNotEmpty
(
infoSourceGroupPage
.
getWeight
()),
SubjectInfoSourceMap:
:
getWeight
,
infoSourceGroupPage
.
getWeight
())
.
eq
(
SubjectInfoSourceMap:
:
getSourceId
,
id
)
.
eq
(
SubjectInfoSourceMap:
:
getSubjectId
,
subjectId
)
.
eq
(
SubjectInfoSourceMap:
:
getType
,
sourceType
));
LambdaUpdateWrapper
<
SubjectInfoSourceMap
>
updateWrapper
=
Wrappers
.<
SubjectInfoSourceMap
>
lambdaUpdate
()
.
set
(
ObjectUtil
.
isNotEmpty
(
infoSourceGroupPage
.
getIsExemptKeyword
()),
SubjectInfoSourceMap:
:
getIsExemptKeyword
,
infoSourceGroupPage
.
getIsExemptKeyword
())
.
set
(
ObjectUtil
.
isNotEmpty
(
infoSourceGroupPage
.
getIsFreeCheck
()),
SubjectInfoSourceMap:
:
getIsFreeCheck
,
infoSourceGroupPage
.
getIsFreeCheck
())
.
eq
(
SubjectInfoSourceMap:
:
getSourceId
,
id
)
.
eq
(
SubjectInfoSourceMap:
:
getSubjectId
,
subjectId
)
.
eq
(
SubjectInfoSourceMap:
:
getType
,
sourceType
);
if
(
ObjectUtil
.
isNotEmpty
(
infoSourceGroupPage
.
getWeight
())){
updateWrapper
.
set
(
SubjectInfoSourceMap:
:
getWeight
,
infoSourceGroupPage
.
getWeight
());
}
else
{
updateWrapper
.
set
(
SubjectInfoSourceMap:
:
getWeight
,
null
);
}
this
.
update
(
updateWrapper
);
}
else
{
SubjectInfoSourceMap
subjectInfoSourceMap
=
new
SubjectInfoSourceMap
();
subjectInfoSourceMap
.
setSubjectId
(
subjectId
);
...
...
src/main/java/com/zzsn/event/service/impl/SubjectServiceImpl.java
浏览文件 @
4a1f6bb3
...
...
@@ -154,6 +154,12 @@ public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> impl
}
@Override
public
Page
<
String
>
visiblePageList
(
String
username
,
String
subjectName
,
Integer
pageNo
,
Integer
pageSize
)
{
Page
<
String
>
page
=
new
Page
<>(
pageNo
,
pageSize
);
return
baseMapper
.
visibleList
(
username
,
subjectName
,
page
);
}
@Override
public
SubjectDetailVO
queryInfo
(
String
subjectId
)
{
return
baseMapper
.
queryInfo
(
subjectId
);
}
...
...
src/main/java/com/zzsn/event/service/impl/SubjectSimpleServiceImpl.java
浏览文件 @
4a1f6bb3
...
...
@@ -12,6 +12,7 @@ import com.zzsn.event.es.EsService;
import
com.zzsn.event.service.*
;
import
com.zzsn.event.util.CodeGenerateUtil
;
import
com.zzsn.event.util.EsOpUtil
;
import
com.zzsn.event.util.PythonUtil
;
import
com.zzsn.event.vo.*
;
import
com.zzsn.event.vo.es.SpecialInformation
;
import
org.apache.commons.collections4.CollectionUtils
;
...
...
@@ -20,7 +21,6 @@ import org.elasticsearch.index.query.BoolQueryBuilder;
import
org.elasticsearch.index.query.QueryBuilders
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -70,6 +70,8 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
private
EsOpUtil
esOpUtil
;
@Autowired
private
CodeGenerateUtil
codeGenerateUtil
;
@Autowired
private
PythonUtil
pythonUtil
;
//关键词默认分类
private
static
final
String
KEYWORDS_TYPE_ID
=
"1476498704680194050"
;
...
...
@@ -403,8 +405,10 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
.
set
(
Subject:
:
getFirstOpenTime
,
null
)
.
set
(
Subject:
:
getEstimateStatus
,
null
);
subjectService
.
update
(
updateWrapper
);
//todo 调用python接口
CompletableFuture
.
runAsync
(()
->
{
//调用python接口
pythonUtil
.
clearDuplicateHistory
(
subjectId
);
//清空专题数据
BoolQueryBuilder
boolQuery
=
QueryBuilders
.
boolQuery
();
boolQuery
.
must
(
QueryBuilders
.
termQuery
(
"subjectId.keyword"
,
subjectId
));
esOpUtil
.
docDeleteByQuery
(
Constants
.
SUBJECT_INDEX
,
boolQuery
);
...
...
src/main/java/com/zzsn/event/util/PythonUtil.java
浏览文件 @
4a1f6bb3
...
...
@@ -25,6 +25,8 @@ public class PythonUtil {
private
String
keywordExtractUrl
;
@Value
(
"${python.judgeDuplicateUrl:}"
)
private
String
judgeDuplicateUrl
;
@Value
(
"${python.clearDuplicateHistoryUrl:}"
)
private
String
clearDuplicateHistoryUrl
;
/**
* 提取关键词
...
...
@@ -93,4 +95,21 @@ public class PythonUtil {
}
return
repeat
;
}
/**
* 清空去重服务历史数据
*
* @param subjectId 专题id
* @author lkg
* @date 2025/2/10
*/
public
void
clearDuplicateHistory
(
String
subjectId
)
{
Map
<
String
,
String
>
params
=
new
HashMap
<>();
params
.
put
(
"subjectId"
,
subjectId
);
try
{
HttpUtil
.
doGet
(
clearDuplicateHistoryUrl
,
params
,
"UTF-8"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
src/main/java/com/zzsn/event/vo/KeywordsTypeVo.java
浏览文件 @
4a1f6bb3
package
com
.
zzsn
.
event
.
vo
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
lombok.Data
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
java.util.Date
;
import
java.util.List
;
...
...
@@ -22,6 +24,8 @@ public class KeywordsTypeVo {
/**
* 创建日期
*/
@JsonFormat
(
timezone
=
"GMT+8"
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
createTime
;
/**
* 更新人
...
...
@@ -30,6 +34,8 @@ public class KeywordsTypeVo {
/**
* 更新日期
*/
@JsonFormat
(
timezone
=
"GMT+8"
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
updateTime
;
/**
* 所属部门
...
...
src/main/java/com/zzsn/event/vo/es/AttachmentInfo.java
浏览文件 @
4a1f6bb3
...
...
@@ -20,6 +20,6 @@ public class AttachmentInfo {
private
String
category
;
private
String
fileSize
;
private
String
group
;
private
Long
pageSize
;
private
Integer
pageSize
;
private
String
source
;
}
src/main/java/com/zzsn/event/vo/es/DisplayInfo.java
浏览文件 @
4a1f6bb3
...
...
@@ -112,6 +112,10 @@ public class DisplayInfo {
private
List
<
String
>
riskTypes
;
//标签集合
private
List
<
LabelInfo
>
labelInfos
;
//资讯关联的附件id
private
List
<
String
>
attachmentIds
;
//附件集合
private
List
<
AttachmentInfo
>
attachmentInfos
;
//是否为资讯(true:资讯 false:附件类)
private
Boolean
ynArticle
=
true
;
//法规号
...
...
src/main/resources/application-dev.yml
浏览文件 @
4a1f6bb3
...
...
@@ -50,7 +50,12 @@ spring:
password
:
_PSuWVQ4CLpX
driver-class-name
:
com.mysql.cj.jdbc.Driver
multi-datasource1
:
url
:
jdbc:mysql://1.95.14.228:3306/clb_xxl_job?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
url
:
jdbc:mysql://1.95.78.131:3306/clb_xxl_job?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
username
:
ciglobal
password
:
qwer@9988&zzsn
driver-class-name
:
com.mysql.cj.jdbc.Driver
multi-datasource2
:
url
:
jdbc:mysql://1.95.14.228:3306/clb_system?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
username
:
ciglobal
password
:
_PSuWVQ4CLpX
driver-class-name
:
com.mysql.cj.jdbc.Driver
...
...
@@ -135,6 +140,5 @@ python:
subjectProcessorUrl
:
http://114.116.36.231:8085/subject/subject_processor
#判重
judgeDuplicateUrl
:
http://114.116.36.231:8080/subject/judg_duplicate
#热词抽取地址
hotWords
:
extractUrl
:
http://114.116.99.6:8055/task/dispose/extractKeyword
\ No newline at end of file
#抽取关键词
keyWordsExtractUrl
:
http://1.95.91.200:7006/get_phrase/
\ No newline at end of file
src/main/resources/application-pro.yml
浏览文件 @
4a1f6bb3
...
...
@@ -42,7 +42,7 @@ spring:
connectionProperties
:
druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
datasource
:
master
:
url
:
jdbc:mysql://1
14.116.44.11
:3306/clb_project?useUnicode=true&characterEncoding=utf-8&AllowPublicKeyRetrieval=True&serverTimezone=Asia/Shanghai&autoReconnect=true&rewriteBatchedStatements=true
url
:
jdbc:mysql://1
.95.14.228
:3306/clb_project?useUnicode=true&characterEncoding=utf-8&AllowPublicKeyRetrieval=True&serverTimezone=Asia/Shanghai&autoReconnect=true&rewriteBatchedStatements=true
username
:
ciglobal
password
:
_PSuWVQ4CLpX
driver-class-name
:
com.mysql.cj.jdbc.Driver
...
...
@@ -51,6 +51,11 @@ spring:
username
:
ciglobal
password
:
qwer@9988&zzsn
driver-class-name
:
com.mysql.cj.jdbc.Driver
multi-datasource2
:
url
:
jdbc:mysql://1.95.14.228:3306/clb_system?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
username
:
ciglobal
password
:
_PSuWVQ4CLpX
driver-class-name
:
com.mysql.cj.jdbc.Driver
elasticsearch
:
uris
:
[
"
192.168.0.24:9700"
,
"
192.168.0.150:9200"
,
"
192.168.0.81:9700"
]
username
:
elastic
...
...
src/main/resources/application-test.yml
浏览文件 @
4a1f6bb3
...
...
@@ -144,6 +144,8 @@ python:
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
:
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论