Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
E
event
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
陈世强
event
Commits
9a26e983
提交
9a26e983
authored
4月 01, 2025
作者:
obcy
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/event_fusion' into event_fusion
上级
b9371fc8
67edd30c
隐藏空白字符变更
内嵌
并排
正在显示
18 个修改的文件
包含
425 行增加
和
67 行删除
+425
-67
FileController.java
src/main/java/com/zzsn/event/controller/FileController.java
+17
-11
InformationController.java
...m/zzsn/event/controller/common/InformationController.java
+17
-4
RelationBindController.java
.../zzsn/event/controller/common/RelationBindController.java
+27
-0
StatisticalAnalysisController.java
...vent/controller/common/StatisticalAnalysisController.java
+3
-3
SubjectAPi.java
...n/java/com/zzsn/event/controller/thirdApi/SubjectAPi.java
+0
-22
InfoSource.java
src/main/java/com/zzsn/event/entity/InfoSource.java
+0
-3
SubjectDictMap.java
src/main/java/com/zzsn/event/entity/SubjectDictMap.java
+55
-0
SysDictItem.java
src/main/java/com/zzsn/event/entity/SysDictItem.java
+7
-0
SubjectDictMapMapper.java
...main/java/com/zzsn/event/mapper/SubjectDictMapMapper.java
+33
-0
SubjectDictMapMapper.xml
...n/java/com/zzsn/event/mapper/xml/SubjectDictMapMapper.xml
+20
-0
InformationService.java
src/main/java/com/zzsn/event/service/InformationService.java
+12
-1
SubjectDictMapService.java
...in/java/com/zzsn/event/service/SubjectDictMapService.java
+35
-0
InformationServiceImpl.java
...a/com/zzsn/event/service/impl/InformationServiceImpl.java
+64
-23
SubjectDictMapServiceImpl.java
...om/zzsn/event/service/impl/SubjectDictMapServiceImpl.java
+53
-0
DataBindLabelFrom.java
src/main/java/com/zzsn/event/vo/DataBindLabelFrom.java
+25
-0
DictVO.java
src/main/java/com/zzsn/event/vo/DictVO.java
+17
-0
FileDataVO.java
src/main/java/com/zzsn/event/vo/FileDataVO.java
+21
-0
SubjectBindLabelParam.java
src/main/java/com/zzsn/event/vo/SubjectBindLabelParam.java
+19
-0
没有找到文件。
src/main/java/com/zzsn/event/controller/FileController.java
浏览文件 @
9a26e983
package
com
.
zzsn
.
event
.
controller
;
package
com
.
zzsn
.
event
.
controller
;
import
cn.hutool.poi.excel.ExcelReader
;
import
cn.hutool.poi.excel.ExcelUtil
;
import
com.aspose.words.Document
;
import
com.aspose.words.Document
;
import
com.aspose.words.SaveFormat
;
import
com.aspose.words.SaveFormat
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
...
@@ -14,6 +16,7 @@ import com.zzsn.event.service.*;
...
@@ -14,6 +16,7 @@ import com.zzsn.event.service.*;
import
com.zzsn.event.util.*
;
import
com.zzsn.event.util.*
;
import
com.zzsn.event.util.user.UserUtil
;
import
com.zzsn.event.util.user.UserUtil
;
import
com.zzsn.event.util.user.UserVo
;
import
com.zzsn.event.util.user.UserVo
;
import
com.zzsn.event.vo.FileDataVO
;
import
com.zzsn.event.vo.InfoDataSearchCondition
;
import
com.zzsn.event.vo.InfoDataSearchCondition
;
import
com.zzsn.event.vo.LabelModelVo
;
import
com.zzsn.event.vo.LabelModelVo
;
import
com.zzsn.event.vo.es.AttachmentInfo
;
import
com.zzsn.event.vo.es.AttachmentInfo
;
...
@@ -294,7 +297,7 @@ public class FileController {
...
@@ -294,7 +297,7 @@ public class FileController {
*/
*/
@GetMapping
(
"/downloadResearchTemplate"
)
@GetMapping
(
"/downloadResearchTemplate"
)
public
void
downloadResearchTemplate
(
HttpServletResponse
response
)
{
public
void
downloadResearchTemplate
(
HttpServletResponse
response
)
{
String
filePath
=
"subjectDataImport/上传Excel模板.xls"
;
String
filePath
=
"subjectDataImport/上传Excel模板.xls
x
"
;
commonService
.
downloadTemplate
(
response
,
filePath
);
commonService
.
downloadTemplate
(
response
,
filePath
);
}
}
...
@@ -321,20 +324,23 @@ public class FileController {
...
@@ -321,20 +324,23 @@ public class FileController {
if
(
"xls"
.
equals
(
fileSuffix
)
||
"xlsx"
.
equals
(
fileSuffix
))
{
if
(
"xls"
.
equals
(
fileSuffix
)
||
"xlsx"
.
equals
(
fileSuffix
))
{
CompletableFuture
.
runAsync
(()
->
{
CompletableFuture
.
runAsync
(()
->
{
try
{
try
{
byte
[]
fileData
=
multipartFile
.
getBytes
();
ExcelReader
reader
=
ExcelUtil
.
getReader
(
multipartFile
.
getInputStream
());
//读取文件内容
Map
<
String
,
String
>
header
=
new
HashMap
<>();
List
<
List
<
String
>>
lists
;
header
.
put
(
"标题"
,
"title"
);
if
(
"xls"
.
equals
(
fileSuffix
))
{
header
.
put
(
"作者"
,
"author"
);
lists
=
ExcelExportUtil
.
readExcelXls
(
new
ByteArrayInputStream
(
fileData
),
true
,
1
,
7
);
header
.
put
(
"来源"
,
"origin"
);
}
else
{
header
.
put
(
"资讯类型"
,
"classificationType"
);
lists
=
ExcelExportUtil
.
readExcelXlsx
(
new
ByteArrayInputStream
(
fileData
),
true
,
1
,
7
);
header
.
put
(
"原文链接"
,
"sourceAddress"
);
}
header
.
put
(
"发布时间"
,
"publishDate"
);
informationService
.
importDataInfo
(
lists
,
subjectId
);
header
.
put
(
"正文内容"
,
"content"
);
reader
.
setHeaderAlias
(
header
);
List
<
FileDataVO
>
informationList
=
reader
.
read
(
0
,
1
,
FileDataVO
.
class
);
informationService
.
importDataInfo
(
informationList
,
subjectId
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
});
});
return
Result
.
OK
(
"
正在进行处理
"
);
return
Result
.
OK
(
"
数据正在处理,请稍后查看
"
);
}
else
{
}
else
{
return
Result
.
FAIL
(
500
,
"不支持的文件类型"
);
return
Result
.
FAIL
(
500
,
"不支持的文件类型"
);
}
}
...
...
src/main/java/com/zzsn/event/controller/common/InformationController.java
浏览文件 @
9a26e983
...
@@ -12,9 +12,8 @@ import com.zzsn.event.entity.SubjectUserCondition;
...
@@ -12,9 +12,8 @@ import com.zzsn.event.entity.SubjectUserCondition;
import
com.zzsn.event.enums.LabelTypeEnum
;
import
com.zzsn.event.enums.LabelTypeEnum
;
import
com.zzsn.event.es.EsService
;
import
com.zzsn.event.es.EsService
;
import
com.zzsn.event.service.*
;
import
com.zzsn.event.service.*
;
import
com.zzsn.event.util.HttpUtil
;
import
com.zzsn.event.util.PythonUtil
;
import
com.zzsn.event.util.PythonUtil
;
import
com.zzsn.event.util.
user.AuthUtil
;
import
com.zzsn.event.util.
tree.Node
;
import
com.zzsn.event.util.user.UserUtil
;
import
com.zzsn.event.util.user.UserUtil
;
import
com.zzsn.event.util.user.UserVo
;
import
com.zzsn.event.util.user.UserVo
;
import
com.zzsn.event.vo.*
;
import
com.zzsn.event.vo.*
;
...
@@ -24,11 +23,9 @@ import org.apache.commons.collections4.CollectionUtils;
...
@@ -24,11 +23,9 @@ import org.apache.commons.collections4.CollectionUtils;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.jsoup.Jsoup
;
import
org.jsoup.Jsoup
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
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
;
...
@@ -56,6 +53,8 @@ public class InformationController {
...
@@ -56,6 +53,8 @@ public class InformationController {
@Autowired
@Autowired
private
SysBaseLabelTypeService
sysBaseLabelTypeService
;
private
SysBaseLabelTypeService
sysBaseLabelTypeService
;
@Autowired
@Autowired
private
SubjectDictMapService
subjectDictMapService
;
@Autowired
private
PythonUtil
pythonUtil
;
private
PythonUtil
pythonUtil
;
...
@@ -349,6 +348,20 @@ public class InformationController {
...
@@ -349,6 +348,20 @@ public class InformationController {
}
}
/**
/**
* 编辑标签
*
* @param bindLabelFrom 参数
* @author lkg
* @date 2024/12/19
*/
@PostMapping
(
value
=
"/modifyLabel"
)
public
Result
<?>
modifyLabel
(
@RequestBody
DataBindLabelFrom
bindLabelFrom
)
{
List
<
DictVO
>
nodes
=
subjectDictMapService
.
boundList
(
bindLabelFrom
.
getSubjectId
());
informationService
.
modifyLabel
(
bindLabelFrom
,
nodes
);
return
Result
.
OK
();
}
/**
* 批量删除-专题库(逻辑删除)
* 批量删除-专题库(逻辑删除)
*
*
* @param map 删除参数
* @param map 删除参数
...
...
src/main/java/com/zzsn/event/controller/common/RelationBindController.java
浏览文件 @
9a26e983
...
@@ -47,6 +47,8 @@ public class RelationBindController {
...
@@ -47,6 +47,8 @@ public class RelationBindController {
private
InfoSourceGroupService
infoSourceGroupService
;
private
InfoSourceGroupService
infoSourceGroupService
;
@Autowired
@Autowired
private
SubjectService
subjectService
;
private
SubjectService
subjectService
;
@Autowired
private
SubjectDictMapService
subjectDictMapService
;
/**
/**
* 项目列表
* 项目列表
...
@@ -267,5 +269,30 @@ public class RelationBindController {
...
@@ -267,5 +269,30 @@ public class RelationBindController {
return
Result
.
OK
(
bindKeyWordsList
);
return
Result
.
OK
(
bindKeyWordsList
);
}
}
/**
* 专题绑定标签(用于人工打标)
*
* @param bindLabelParam 绑定参数
* @author lkg
* @date 2025/3/28
*/
@PostMapping
(
"/bindLabels"
)
public
Result
<?>
bindLabels
(
@RequestBody
SubjectBindLabelParam
bindLabelParam
){
subjectDictMapService
.
modify
(
bindLabelParam
);
return
Result
.
OK
();
}
/**
* 专题已经绑定的标签(用于人工打标)
*
* @param subjectId 专题id
* @author lkg
* @date 2025/3/28
*/
@GetMapping
(
"/boundLabelList"
)
public
Result
<?>
boundLabelList
(
@RequestParam
String
subjectId
){
List
<
DictVO
>
boundList
=
subjectDictMapService
.
boundList
(
subjectId
);
return
Result
.
OK
(
boundList
);
}
}
}
src/main/java/com/zzsn/event/controller/common/StatisticalAnalysisController.java
浏览文件 @
9a26e983
...
@@ -45,7 +45,7 @@ public class StatisticalAnalysisController {
...
@@ -45,7 +45,7 @@ public class StatisticalAnalysisController {
@Autowired
@Autowired
private
ClbLabelService
clbLabelService
;
private
ClbLabelService
clbLabelService
;
@Autowired
@Autowired
private
InformationService
informationService
;
private
InformationService
informationService
;
/**
/**
* 概述分析
* 概述分析
...
@@ -106,8 +106,8 @@ public class StatisticalAnalysisController {
...
@@ -106,8 +106,8 @@ public class StatisticalAnalysisController {
public
Result
<
List
<
CountVO
>>
dataTrend
(
@RequestBody
InfoDataSearchCondition
searchCondition
)
{
public
Result
<
List
<
CountVO
>>
dataTrend
(
@RequestBody
InfoDataSearchCondition
searchCondition
)
{
List
<
CountVO
>
dataList
=
new
ArrayList
<>();
List
<
CountVO
>
dataList
=
new
ArrayList
<>();
List
<
SysDictItem
>
dictItemList
=
sysDictItemService
.
listByDictCode
(
"Thematic_Library"
);
List
<
SysDictItem
>
dictItemList
=
sysDictItemService
.
listByDictCode
(
"Thematic_Library"
);
List
<
String
>
includeValues
=
dictItemList
.
stream
().
map
(
SysDictItem:
:
getItemValue
).
collect
(
Collectors
.
toList
()
);
String
[]
includeValues
=
dictItemList
.
stream
().
map
(
SysDictItem:
:
getItemValue
).
toArray
(
String
[]::
new
);
searchCondition
.
setIncludeValues
(
includeValues
.
toArray
(
new
String
[
0
])
);
searchCondition
.
setIncludeValues
(
includeValues
);
if
(
CollectionUtils
.
isEmpty
(
searchCondition
.
getIds
())
&&
searchCondition
.
getNum
()
==
null
)
{
if
(
CollectionUtils
.
isEmpty
(
searchCondition
.
getIds
())
&&
searchCondition
.
getNum
()
==
null
)
{
dataList
=
esService
.
groupByDate
(
searchCondition
);
dataList
=
esService
.
groupByDate
(
searchCondition
);
}
else
{
}
else
{
...
...
src/main/java/com/zzsn/event/controller/thirdApi/SubjectAPi.java
deleted
100644 → 0
浏览文件 @
b9371fc8
package
com
.
zzsn
.
event
.
controller
.
thirdApi
;
import
com.zzsn.event.constant.Result
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
*
*
* @author lkg
* @date 2025/2/20
*/
@Slf4j
@RestController
@RequestMapping
(
"/subject/api"
)
public
class
SubjectAPi
{
public
Result
<?>
pageList
(
String
name
,
Integer
type
){
return
null
;
}
}
src/main/java/com/zzsn/event/entity/InfoSource.java
浏览文件 @
9a26e983
...
@@ -44,9 +44,6 @@ public class InfoSource implements Serializable {
...
@@ -44,9 +44,6 @@ public class InfoSource implements Serializable {
/**国家*/
/**国家*/
@ApiModelProperty
(
value
=
"国家"
)
@ApiModelProperty
(
value
=
"国家"
)
private
String
country
;
private
String
country
;
/**是否境外*/
@ApiModelProperty
(
value
=
"是否境外"
)
private
String
ynOther
;
/**地区*/
/**地区*/
@ApiModelProperty
(
value
=
"地区"
)
@ApiModelProperty
(
value
=
"地区"
)
private
String
area
;
private
String
area
;
...
...
src/main/java/com/zzsn/event/entity/SubjectDictMap.java
0 → 100644
浏览文件 @
9a26e983
package
com
.
zzsn
.
event
.
entity
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
lombok.*
;
import
lombok.experimental.Accessors
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* 专题-字典关系表
* @TableName subject_dict_map
*/
@Data
@TableName
(
"subject_dict_map"
)
@Accessors
(
chain
=
true
)
@EqualsAndHashCode
(
callSuper
=
false
)
@Builder
@AllArgsConstructor
@NoArgsConstructor
public
class
SubjectDictMap
implements
Serializable
{
/**
* 主键id
*/
@TableId
(
"id"
)
private
String
id
;
/**
* 专题id
*/
@TableField
(
"subject_id"
)
private
String
subjectId
;
/**
* 字典id
*/
@TableField
(
"dict_id"
)
private
String
dictId
;
/**
* 创建人
*/
@TableField
(
"create_by"
)
private
String
createBy
;
/**
* 创建时间
*/
@JsonFormat
(
timezone
=
"GMT+8"
,
pattern
=
"yyyy-MM-dd"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd"
)
@TableField
(
"create_time"
)
private
Date
createTime
;
}
src/main/java/com/zzsn/event/entity/SysDictItem.java
浏览文件 @
9a26e983
package
com
.
zzsn
.
event
.
entity
;
package
com
.
zzsn
.
event
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -99,4 +100,10 @@ public class SysDictItem implements Serializable {
...
@@ -99,4 +100,10 @@ public class SysDictItem implements Serializable {
*/
*/
private
Integer
level
;
private
Integer
level
;
/**
* 字典编码
*/
@TableField
(
exist
=
false
)
private
String
dictCode
;
}
}
src/main/java/com/zzsn/event/mapper/SubjectDictMapMapper.java
0 → 100644
浏览文件 @
9a26e983
package
com
.
zzsn
.
event
.
mapper
;
import
com.zzsn.event.entity.SubjectDictMap
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.zzsn.event.util.tree.Node
;
import
com.zzsn.event.vo.DictVO
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* @author lenovo
* @description 针对表【subject_dict_map(专题-字典关系表)】的数据库操作Mapper
* @createDate 2025-03-28 11:56:32
* @Entity com.zzsn.event.entity.SubjectDictMap
*/
@Mapper
public
interface
SubjectDictMapMapper
extends
BaseMapper
<
SubjectDictMap
>
{
/**
* 专题绑定的数据字典信息
*
* @param subjectId 专题id
* @author lkg
* @date 2025/3/28
*/
List
<
DictVO
>
boundList
(
@Param
(
"subjectId"
)
String
subjectId
);
}
src/main/java/com/zzsn/event/mapper/xml/SubjectDictMapMapper.xml
0 → 100644
浏览文件 @
9a26e983
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.zzsn.event.mapper.SubjectDictMapMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.zzsn.event.entity.SubjectDictMap"
>
<id
property=
"id"
column=
"id"
jdbcType=
"VARCHAR"
/>
<result
property=
"subjectId"
column=
"subject_id"
jdbcType=
"VARCHAR"
/>
<result
property=
"dictId"
column=
"dict_id"
jdbcType=
"INTEGER"
/>
<result
property=
"createBy"
column=
"create_by"
jdbcType=
"VARCHAR"
/>
<result
property=
"createTime"
column=
"create_time"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
<select
id=
"boundList"
resultType=
"com.zzsn.event.vo.DictVO"
>
select d.id,d.dict_code as code,d.dict_name as name from subject_dict_map m
inner join clb_system.sys_dict d on m.dict_id = d.id
where m.subject_id = #{subjectId}
</select>
</mapper>
src/main/java/com/zzsn/event/service/InformationService.java
浏览文件 @
9a26e983
...
@@ -4,6 +4,7 @@ import com.alibaba.fastjson2.JSONObject;
...
@@ -4,6 +4,7 @@ import com.alibaba.fastjson2.JSONObject;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.zzsn.event.constant.Result
;
import
com.zzsn.event.constant.Result
;
import
com.zzsn.event.entity.ClbFileOperationLog
;
import
com.zzsn.event.entity.ClbFileOperationLog
;
import
com.zzsn.event.util.tree.Node
;
import
com.zzsn.event.util.user.UserVo
;
import
com.zzsn.event.util.user.UserVo
;
import
com.zzsn.event.vo.*
;
import
com.zzsn.event.vo.*
;
import
com.zzsn.event.vo.es.DisplayInfo
;
import
com.zzsn.event.vo.es.DisplayInfo
;
...
@@ -123,6 +124,16 @@ public interface InformationService {
...
@@ -123,6 +124,16 @@ public interface InformationService {
void
updateInfo
(
JSONObject
jsonObject
,
UserVo
userVo
);
void
updateInfo
(
JSONObject
jsonObject
,
UserVo
userVo
);
/**
/**
* 资讯绑定标签
*
* @param dataBindLabelFrom 绑定参数
* @param boundList 专题绑定的标签(数据字典)集合
* @author lkg
* @date 2025/3/31
*/
void
modifyLabel
(
DataBindLabelFrom
dataBindLabelFrom
,
List
<
DictVO
>
boundList
);
/**
* 审核
* 审核
*
*
* @param map 审核参数
* @param map 审核参数
...
@@ -206,7 +217,7 @@ public interface InformationService {
...
@@ -206,7 +217,7 @@ public interface InformationService {
* @author lkg
* @author lkg
* @date 2025/2/5
* @date 2025/2/5
*/
*/
void
importDataInfo
(
List
<
List
<
String
>
>
lists
,
String
subjectId
);
void
importDataInfo
(
List
<
FileDataVO
>
lists
,
String
subjectId
);
/**
/**
* 移除专题下的数据-研究中心
* 移除专题下的数据-研究中心
...
...
src/main/java/com/zzsn/event/service/SubjectDictMapService.java
0 → 100644
浏览文件 @
9a26e983
package
com
.
zzsn
.
event
.
service
;
import
com.zzsn.event.entity.SubjectDictMap
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.zzsn.event.util.tree.Node
;
import
com.zzsn.event.vo.DictVO
;
import
com.zzsn.event.vo.SubjectBindLabelParam
;
import
java.util.List
;
/**
* @author lenovo
* @description 针对表【subject_dict_map(专题-字典关系表)】的数据库操作Service
* @createDate 2025-03-28 11:56:32
*/
public
interface
SubjectDictMapService
extends
IService
<
SubjectDictMap
>
{
/**
* 专题绑定数据字典
*
* @param bindLabelParam 绑定参数
* @author lkg
* @date 2025/3/28
*/
void
modify
(
SubjectBindLabelParam
bindLabelParam
);
/**
* 专题绑定的数据字典信息
*
* @param subjectId 专题id
* @author lkg
* @date 2025/3/28
*/
List
<
DictVO
>
boundList
(
String
subjectId
);
}
src/main/java/com/zzsn/event/service/impl/InformationServiceImpl.java
浏览文件 @
9a26e983
...
@@ -20,6 +20,7 @@ import com.zzsn.event.es.EsService;
...
@@ -20,6 +20,7 @@ import com.zzsn.event.es.EsService;
import
com.zzsn.event.mapper.SubjectMapper
;
import
com.zzsn.event.mapper.SubjectMapper
;
import
com.zzsn.event.service.*
;
import
com.zzsn.event.service.*
;
import
com.zzsn.event.util.*
;
import
com.zzsn.event.util.*
;
import
com.zzsn.event.util.tree.Node
;
import
com.zzsn.event.util.user.AuthUtil
;
import
com.zzsn.event.util.user.AuthUtil
;
import
com.zzsn.event.util.user.UserUtil
;
import
com.zzsn.event.util.user.UserUtil
;
import
com.zzsn.event.util.user.UserVo
;
import
com.zzsn.event.util.user.UserVo
;
...
@@ -350,7 +351,7 @@ public class InformationServiceImpl implements InformationService {
...
@@ -350,7 +351,7 @@ public class InformationServiceImpl implements InformationService {
info
.
setContent
(
contentNoTag2
);
info
.
setContent
(
contentNoTag2
);
}
}
info
.
setPublishDate
(
EsDateUtil
.
esFieldDateMapping
(
info
.
getPublishDate
()));
info
.
setPublishDate
(
EsDateUtil
.
esFieldDateMapping
(
info
.
getPublishDate
()));
if
(
type
==
2
)
{
if
(
null
!=
type
&&
type
==
2
)
{
//获取附件信息
//获取附件信息
if
(
info
.
getAttachmentIds
()
!=
null
&&
info
.
getAttachmentIds
().
size
()
>
0
)
{
if
(
info
.
getAttachmentIds
()
!=
null
&&
info
.
getAttachmentIds
().
size
()
>
0
)
{
List
<
AttachmentInfo
>
attachmentInfoList
=
new
ArrayList
<>();
List
<
AttachmentInfo
>
attachmentInfoList
=
new
ArrayList
<>();
...
@@ -374,9 +375,8 @@ public class InformationServiceImpl implements InformationService {
...
@@ -374,9 +375,8 @@ public class InformationServiceImpl implements InformationService {
info
.
setAttachmentInfos
(
attachmentInfoList
);
info
.
setAttachmentInfos
(
attachmentInfoList
);
info
.
setYnArticle
(
false
);
info
.
setYnArticle
(
false
);
}
}
CompletableFuture
.
runAsync
(()
->
addReadNum
(
info
,
index
));
}
}
CompletableFuture
.
runAsync
(()
->
addReadNum
(
info
,
index
));
return
info
;
return
info
;
}
}
...
@@ -610,6 +610,42 @@ public class InformationServiceImpl implements InformationService {
...
@@ -610,6 +610,42 @@ public class InformationServiceImpl implements InformationService {
}
}
@Override
@Override
public
void
modifyLabel
(
DataBindLabelFrom
dataBindLabelFrom
,
List
<
DictVO
>
boundList
)
{
DisplayInfo
info
=
(
DisplayInfo
)
esOpUtil
.
getInfoById
(
dataBindLabelFrom
.
getIndex
(),
dataBindLabelFrom
.
getId
(),
DisplayInfo
.
class
);
if
(
info
!=
null
)
{
List
<
Label
>
newLabels
=
new
ArrayList
<>();
List
<
SysDictItem
>
dictItemList
=
dataBindLabelFrom
.
getDictItemList
();
for
(
SysDictItem
sysDictItem
:
dictItemList
)
{
Label
label
=
new
Label
();
label
.
setRelationId
(
sysDictItem
.
getId
());
label
.
setLabelMark
(
sysDictItem
.
getDictCode
());
label
.
setRelationName
(
sysDictItem
.
getItemText
());
newLabels
.
add
(
label
);
}
List
<
Label
>
labels
=
info
.
getLabels
();
if
(
CollectionUtils
.
isNotEmpty
(
labels
))
{
List
<
String
>
dictCodes
=
new
ArrayList
<>();
boundList
.
forEach
(
node
->
dictCodes
.
add
(
node
.
getCode
()));
List
<
Label
>
collect
=
labels
.
stream
().
filter
(
label
->
dictCodes
.
contains
(
label
.
getLabelMark
())).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isNotEmpty
(
collect
))
{
List
<
String
>
dictItemIds
=
new
ArrayList
<>();
dictItemList
.
forEach
(
sysDictItem
->
dictItemIds
.
add
(
sysDictItem
.
getId
()));
for
(
Label
label
:
collect
)
{
if
(
dictItemIds
.
contains
(
label
.
getRelationId
()))
{
newLabels
.
add
(
label
);
}
}
}
List
<
Label
>
otherCollect
=
labels
.
stream
().
filter
(
label
->
!
dictCodes
.
contains
(
label
.
getLabelMark
())).
collect
(
Collectors
.
toList
());
newLabels
.
addAll
(
otherCollect
);
}
List
<
Label
>
finalList
=
newLabels
.
stream
().
collect
(
Collectors
.
collectingAndThen
(
Collectors
.
toMap
(
Label:
:
getRelationId
,
p
->
p
,
(
p1
,
p2
)
->
p1
),
map
->
new
ArrayList
<>(
map
.
values
())));
info
.
setLabels
(
finalList
);
esOpUtil
.
docUpdateById
(
dataBindLabelFrom
.
getIndex
(),
info
.
getId
(),
JSON
.
toJSONString
(
info
));
}
}
@Override
public
void
checkInfo
(
Map
<
String
,
Object
>
map
,
UserVo
userVo
)
{
public
void
checkInfo
(
Map
<
String
,
Object
>
map
,
UserVo
userVo
)
{
List
<
Map
<
String
,
String
>>
ids
=
(
List
<
Map
<
String
,
String
>>)
map
.
get
(
"ids"
);
List
<
Map
<
String
,
String
>>
ids
=
(
List
<
Map
<
String
,
String
>>)
map
.
get
(
"ids"
);
Integer
checkStatus
=
(
Integer
)
map
.
get
(
"checkStatus"
);
Integer
checkStatus
=
(
Integer
)
map
.
get
(
"checkStatus"
);
...
@@ -888,7 +924,7 @@ public class InformationServiceImpl implements InformationService {
...
@@ -888,7 +924,7 @@ public class InformationServiceImpl implements InformationService {
}
}
specialInformation
.
setCreateDate
(
cn
.
hutool
.
core
.
date
.
DateUtil
.
format
(
new
Date
(),
"yyyy-MM-dd'T'HH:mm:ss"
));
specialInformation
.
setCreateDate
(
cn
.
hutool
.
core
.
date
.
DateUtil
.
format
(
new
Date
(),
"yyyy-MM-dd'T'HH:mm:ss"
));
specialInformation
.
setProcessDate
(
specialInformation
.
getCreateDate
());
specialInformation
.
setProcessDate
(
specialInformation
.
getCreateDate
());
String
index
=
Constants
.
SUBJECT_INDEX
;
String
index
=
Constants
.
SUBJECT_INDEX
+
"_"
+
DateUtils
.
getYear
()
;
esOpUtil
.
docSavaByEntity
(
index
,
specialInformation
.
getId
(),
specialInformation
);
esOpUtil
.
docSavaByEntity
(
index
,
specialInformation
.
getId
(),
specialInformation
);
clbFileOperationLog
.
getClbFileOperationLogDetails
().
add
(
clbFileOperationLogDetailsService
.
buildFailDetails
(
info
.
get
(
1
),
info
.
get
(
5
),
info
.
get
(
7
)));
clbFileOperationLog
.
getClbFileOperationLogDetails
().
add
(
clbFileOperationLogDetailsService
.
buildFailDetails
(
info
.
get
(
1
),
info
.
get
(
5
),
info
.
get
(
7
)));
}
catch
(
NumberFormatException
e
)
{
}
catch
(
NumberFormatException
e
)
{
...
@@ -901,25 +937,25 @@ public class InformationServiceImpl implements InformationService {
...
@@ -901,25 +937,25 @@ public class InformationServiceImpl implements InformationService {
}
}
@Override
@Override
public
void
importDataInfo
(
List
<
List
<
String
>
>
lists
,
String
subjectId
)
{
public
void
importDataInfo
(
List
<
FileDataVO
>
lists
,
String
subjectId
)
{
if
(
CollectionUtil
.
isNotEmpty
(
lists
))
{
if
(
CollectionUtil
.
isNotEmpty
(
lists
))
{
String
index
=
Constants
.
SUBJECT_INDEX
;
String
index
=
Constants
.
SUBJECT_INDEX
+
"_"
+
DateUtils
.
getYear
()
;
List
<
SpecialInformation
>
dataList
=
new
ArrayList
<>();
List
<
SpecialInformation
>
dataList
=
new
ArrayList
<>();
for
(
List
<
String
>
info
:
lists
)
{
for
(
FileDataVO
info
:
lists
)
{
SpecialInformation
specialInformation
=
new
SpecialInformation
();
SpecialInformation
specialInformation
=
new
SpecialInformation
();
specialInformation
.
setId
(
codeGenerateUtil
.
geneIdNo
(
Constants
.
DATA_ADD_ID
,
8
));
specialInformation
.
setId
(
codeGenerateUtil
.
geneIdNo
(
Constants
.
DATA_ADD_ID
,
8
));
if
(
StringUtils
.
isNotEmpty
(
info
.
get
(
0
)))
{
if
(
StringUtils
.
isNotEmpty
(
info
.
get
Title
(
)))
{
specialInformation
.
setTitle
(
info
.
get
(
0
));
specialInformation
.
setTitle
(
info
.
get
Title
(
));
}
}
if
(
StringUtils
.
isNotEmpty
(
info
.
get
(
1
)))
{
if
(
StringUtils
.
isNotEmpty
(
info
.
get
Author
(
)))
{
specialInformation
.
setAuthor
(
info
.
get
(
1
));
specialInformation
.
setAuthor
(
info
.
get
Author
(
));
}
}
if
(
StringUtils
.
isNotEmpty
(
info
.
get
(
2
)))
{
if
(
StringUtils
.
isNotEmpty
(
info
.
get
Origin
(
)))
{
specialInformation
.
setOrigin
(
info
.
get
(
2
));
specialInformation
.
setOrigin
(
info
.
get
Origin
(
));
specialInformation
.
setSid
(
info
.
get
(
2
));
specialInformation
.
setSid
(
info
.
get
Origin
(
));
}
}
if
(
StringUtils
.
isNotEmpty
(
info
.
get
(
3
)))
{
String
library
=
info
.
getClassificationType
();
String
library
=
info
.
get
(
3
);
if
(
StringUtils
.
isNotEmpty
(
library
))
{
SysDictItem
dictItem
=
sysDictItemService
.
dictItemInfoByName
(
"Thematic_Library"
,
library
);
SysDictItem
dictItem
=
sysDictItemService
.
dictItemInfoByName
(
"Thematic_Library"
,
library
);
if
(
dictItem
!=
null
)
{
if
(
dictItem
!=
null
)
{
specialInformation
.
setClassificationType
(
Integer
.
parseInt
(
dictItem
.
getItemValue
()));
specialInformation
.
setClassificationType
(
Integer
.
parseInt
(
dictItem
.
getItemValue
()));
...
@@ -929,19 +965,20 @@ public class InformationServiceImpl implements InformationService {
...
@@ -929,19 +965,20 @@ public class InformationServiceImpl implements InformationService {
}
else
{
}
else
{
specialInformation
.
setClassificationType
(
0
);
specialInformation
.
setClassificationType
(
0
);
}
}
if
(
StringUtils
.
isNotEmpty
(
info
.
get
(
4
)))
{
if
(
StringUtils
.
isNotEmpty
(
info
.
get
SourceAddress
(
)))
{
specialInformation
.
setSourceAddress
(
info
.
get
(
4
));
specialInformation
.
setSourceAddress
(
info
.
get
SourceAddress
(
));
}
}
if
(
StringUtils
.
isNotEmpty
(
info
.
get
(
5
)))
{
if
(
StringUtils
.
isNotEmpty
(
info
.
get
PublishDate
(
)))
{
specialInformation
.
setPublishDate
(
EsDateUtil
.
esFieldDateFormat
(
info
.
get
(
5
)));
specialInformation
.
setPublishDate
(
EsDateUtil
.
esFieldDateFormat
(
info
.
get
PublishDate
(
)));
}
}
if
(
StringUtils
.
isNotEmpty
(
info
.
get
(
6
)))
{
if
(
StringUtils
.
isNotEmpty
(
info
.
get
Content
(
)))
{
specialInformation
.
setContent
(
info
.
get
(
6
));
specialInformation
.
setContent
(
info
.
get
Content
(
));
}
}
specialInformation
.
setCheckStatus
(
1
);
specialInformation
.
setCheckStatus
(
1
);
specialInformation
.
setDeleteFlag
(
0
);
specialInformation
.
setDeleteFlag
(
0
);
specialInformation
.
setTopNum
(
0
);
specialInformation
.
setTopNum
(
0
);
specialInformation
.
setDataFrom
(
1
);
specialInformation
.
setDataFrom
(
1
);
specialInformation
.
setScore
(
0
D
);
specialInformation
.
setSubjectId
(
subjectId
);
specialInformation
.
setSubjectId
(
subjectId
);
String
format
=
DateUtil
.
dateToString
(
new
Date
(),
"yyyy-MM-dd'T'HH:mm:ss"
);
String
format
=
DateUtil
.
dateToString
(
new
Date
(),
"yyyy-MM-dd'T'HH:mm:ss"
);
specialInformation
.
setCreateDate
(
format
);
specialInformation
.
setCreateDate
(
format
);
...
@@ -1156,7 +1193,11 @@ public class InformationServiceImpl implements InformationService {
...
@@ -1156,7 +1193,11 @@ public class InformationServiceImpl implements InformationService {
if
(
StringUtils
.
isNotEmpty
(
origin
))
{
if
(
StringUtils
.
isNotEmpty
(
origin
))
{
LambdaQueryWrapper
<
InfoSource
>
queryWrapper
=
Wrappers
.
lambdaQuery
();
LambdaQueryWrapper
<
InfoSource
>
queryWrapper
=
Wrappers
.
lambdaQuery
();
queryWrapper
.
eq
(
InfoSource:
:
getSiteName
,
origin
);
queryWrapper
.
eq
(
InfoSource:
:
getSiteName
,
origin
);
InfoSource
infoSource
=
infoSourceService
.
getOne
(
queryWrapper
);
List
<
InfoSource
>
list
=
infoSourceService
.
list
(
queryWrapper
);
InfoSource
infoSource
=
null
;
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
infoSource
=
list
.
get
(
0
);
}
if
(
infoSource
!=
null
)
{
if
(
infoSource
!=
null
)
{
String
sid
=
infoSource
.
getId
();
String
sid
=
infoSource
.
getId
();
sidList
.
add
(
sid
);
sidList
.
add
(
sid
);
...
...
src/main/java/com/zzsn/event/service/impl/SubjectDictMapServiceImpl.java
0 → 100644
浏览文件 @
9a26e983
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.SubjectDictMap
;
import
com.zzsn.event.service.SubjectDictMapService
;
import
com.zzsn.event.mapper.SubjectDictMapMapper
;
import
com.zzsn.event.util.tree.Node
;
import
com.zzsn.event.vo.DictVO
;
import
com.zzsn.event.vo.SubjectBindLabelParam
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* @author lenovo
* @description 针对表【subject_dict_map(专题-字典关系表)】的数据库操作Service实现
* @createDate 2025-03-28 11:56:32
*/
@Service
public
class
SubjectDictMapServiceImpl
extends
ServiceImpl
<
SubjectDictMapMapper
,
SubjectDictMap
>
implements
SubjectDictMapService
{
@Override
public
void
modify
(
SubjectBindLabelParam
bindLabelParam
)
{
String
subjectId
=
bindLabelParam
.
getSubjectId
();
List
<
String
>
dictIdList
=
bindLabelParam
.
getDictIdList
();
LambdaQueryWrapper
<
SubjectDictMap
>
queryWrapper
=
Wrappers
.
lambdaQuery
();
queryWrapper
.
eq
(
SubjectDictMap:
:
getSubjectId
,
subjectId
);
int
count
=
this
.
count
(
queryWrapper
);
if
(
count
>
0
)
{
this
.
remove
(
queryWrapper
);
}
List
<
SubjectDictMap
>
subjectDictMaps
=
new
ArrayList
<>();
for
(
String
dictId
:
dictIdList
)
{
SubjectDictMap
subjectDictMap
=
new
SubjectDictMap
();
subjectDictMap
.
setSubjectId
(
subjectId
);
subjectDictMap
.
setDictId
(
dictId
);
subjectDictMaps
.
add
(
subjectDictMap
);
}
this
.
saveBatch
(
subjectDictMaps
);
}
@Override
public
List
<
DictVO
>
boundList
(
String
subjectId
)
{
return
baseMapper
.
boundList
(
subjectId
);
}
}
src/main/java/com/zzsn/event/vo/DataBindLabelFrom.java
0 → 100644
浏览文件 @
9a26e983
package
com
.
zzsn
.
event
.
vo
;
import
com.zzsn.event.entity.SysDictItem
;
import
lombok.Data
;
import
java.util.List
;
/**
* 资讯绑定标签请求参数
*
* @author lkg
* @date 2025/3/28
*/
@Data
public
class
DataBindLabelFrom
{
/**索引*/
private
String
index
;
/**资讯id*/
private
String
id
;
/**专题id*/
private
String
subjectId
;
/**字典id*/
private
List
<
SysDictItem
>
dictItemList
;
}
src/main/java/com/zzsn/event/vo/DictVO.java
0 → 100644
浏览文件 @
9a26e983
package
com
.
zzsn
.
event
.
vo
;
import
lombok.Data
;
/**
*
*
* @author lkg
* @date 2025/4/1
*/
@Data
public
class
DictVO
{
private
String
id
;
private
String
code
;
private
String
name
;
}
src/main/java/com/zzsn/event/vo/FileDataVO.java
0 → 100644
浏览文件 @
9a26e983
package
com
.
zzsn
.
event
.
vo
;
import
lombok.Data
;
/**
*
*
* @author lkg
* @date 2025/4/1
*/
@Data
public
class
FileDataVO
{
private
String
title
;
private
String
content
;
private
String
author
;
private
String
origin
;
private
String
sourceAddress
;
private
String
classificationType
;
private
String
publishDate
;
}
src/main/java/com/zzsn/event/vo/SubjectBindLabelParam.java
0 → 100644
浏览文件 @
9a26e983
package
com
.
zzsn
.
event
.
vo
;
import
lombok.Data
;
import
java.util.List
;
/**
* 专题绑定标签参数
*
* @author lkg
* @date 2025/3/28
*/
@Data
public
class
SubjectBindLabelParam
{
/**专题id*/
private
String
subjectId
;
/**数据字典id集合*/
private
List
<
String
>
dictIdList
;
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论