Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
T
think-tank
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
张京坤
think-tank
Commits
667c3375
提交
667c3375
authored
8月 05, 2025
作者:
925993793@qq.com
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
智库绑定信息源功能迭代
上级
fc5fc0ab
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
29 个修改的文件
包含
1133 行增加
和
39 行删除
+1133
-39
pom.xml
pom.xml
+6
-0
MybatisPlusConfig.java
...ain/java/com/zzsn/thinktank/config/MybatisPlusConfig.java
+30
-0
ThinktankBasicInfoController.java
...sn/thinktank/controller/ThinktankBasicInfoController.java
+0
-0
ThinktankBindController.java
...om/zzsn/thinktank/controller/ThinktankBindController.java
+0
-0
InfoSourceGroupMap.java
...in/java/com/zzsn/thinktank/entity/InfoSourceGroupMap.java
+4
-0
SysDictItem.java
src/main/java/com/zzsn/thinktank/entity/SysDictItem.java
+110
-0
BindTypeEnum.java
src/main/java/com/zzsn/thinktank/enums/BindTypeEnum.java
+121
-0
InfoSourceMapper.java
...main/java/com/zzsn/thinktank/mapper/InfoSourceMapper.java
+98
-4
SysDictItemMapper.java
...ain/java/com/zzsn/thinktank/mapper/SysDictItemMapper.java
+22
-0
InfoSourceGroupMapService.java
...com/zzsn/thinktank/service/InfoSourceGroupMapService.java
+19
-0
InfoSourceService.java
...in/java/com/zzsn/thinktank/service/InfoSourceService.java
+93
-3
SysDictItemService.java
...n/java/com/zzsn/thinktank/service/SysDictItemService.java
+19
-0
ThinktankBasicInfoService.java
...com/zzsn/thinktank/service/ThinktankBasicInfoService.java
+1
-1
InfoSourceGroupMapServiceImpl.java
...thinktank/service/impl/InfoSourceGroupMapServiceImpl.java
+0
-0
InfoSourceServiceImpl.java
...om/zzsn/thinktank/service/impl/InfoSourceServiceImpl.java
+160
-6
SysDictItemServiceImpl.java
...m/zzsn/thinktank/service/impl/SysDictItemServiceImpl.java
+28
-0
ThinktankBasicInfoServiceImpl.java
...thinktank/service/impl/ThinktankBasicInfoServiceImpl.java
+86
-19
BindInfoSourceColumnVO.java
...in/java/com/zzsn/thinktank/vo/BindInfoSourceColumnVO.java
+54
-0
BindInfoSourceVO.java
src/main/java/com/zzsn/thinktank/vo/BindInfoSourceVO.java
+44
-0
BindLabelVo.java
src/main/java/com/zzsn/thinktank/vo/BindLabelVo.java
+15
-0
BindSourceDetailVO.java
src/main/java/com/zzsn/thinktank/vo/BindSourceDetailVO.java
+17
-0
BindVO.java
src/main/java/com/zzsn/thinktank/vo/BindVO.java
+26
-0
InfoSearchCondition.java
src/main/java/com/zzsn/thinktank/vo/InfoSearchCondition.java
+43
-0
InfoSourceGroupVO.java
src/main/java/com/zzsn/thinktank/vo/InfoSourceGroupVO.java
+35
-0
InfoSourceLabelVO.java
src/main/java/com/zzsn/thinktank/vo/InfoSourceLabelVO.java
+48
-0
ThinktankBasicInfoVo.java
...main/java/com/zzsn/thinktank/vo/ThinktankBasicInfoVo.java
+2
-2
application.yml
src/main/resources/application.yml
+43
-4
InfoSourceMapper.xml
src/main/resources/mapper/InfoSourceMapper.xml
+0
-0
SysDictItemMapper.xml
src/main/resources/mapper/SysDictItemMapper.xml
+9
-0
没有找到文件。
pom.xml
浏览文件 @
667c3375
...
...
@@ -45,6 +45,12 @@
<artifactId>
mysql-connector-java
</artifactId>
<version>
8.0.21
</version>
</dependency>
<!-- 动态数据源 -->
<dependency>
<groupId>
com.baomidou
</groupId>
<artifactId>
dynamic-datasource-spring-boot-starter
</artifactId>
<version>
3.2.0
</version>
</dependency>
<!-- excel工具包 -->
<dependency>
...
...
src/main/java/com/zzsn/thinktank/config/MybatisPlusConfig.java
0 → 100644
浏览文件 @
667c3375
package
com
.
zzsn
.
thinktank
.
config
;
import
com.baomidou.mybatisplus.extension.incrementer.OracleKeyGenerator
;
import
com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor
;
import
com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor
;
import
com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor
;
import
org.mybatis.spring.annotation.MapperScan
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.transaction.annotation.EnableTransactionManagement
;
/**
* @author
* @description: mybatis-plus配置
* @date
*/
@Configuration
public
class
MybatisPlusConfig
{
/**
* mybatis-plus分页配置
*/
@Bean
public
MybatisPlusInterceptor
mybatisPlusInterceptor
()
{
MybatisPlusInterceptor
interceptor
=
new
MybatisPlusInterceptor
();
interceptor
.
addInnerInterceptor
(
new
PaginationInnerInterceptor
());
return
interceptor
;
}
}
src/main/java/com/zzsn/thinktank/controller/ThinktankBasicInfoController.java
浏览文件 @
667c3375
差异被折叠。
点击展开。
src/main/java/com/zzsn/thinktank/controller/ThinktankBindController.java
浏览文件 @
667c3375
差异被折叠。
点击展开。
src/main/java/com/zzsn/thinktank/entity/InfoSourceGroupMap.java
浏览文件 @
667c3375
...
...
@@ -35,6 +35,10 @@ public class InfoSourceGroupMap implements Serializable {
/**信息源id*/
@Excel
(
name
=
"信息源id"
,
width
=
15
)
private
String
sourceId
;
/**标签值编码(专题绑定信息源标签时特有的字段)*/
private
String
sourceItemId
;
/**绑定的信息源类型*/
private
Integer
type
;
/**创建人*/
private
String
createBy
;
/**创建日期*/
...
...
src/main/java/com/zzsn/thinktank/entity/SysDictItem.java
0 → 100644
浏览文件 @
667c3375
package
com
.
zzsn
.
thinktank
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
org.jeecgframework.poi.excel.annotation.Excel
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* <p>
*
* </p>
*
* @Author zhangweijian
* @since 2018-12-28
*/
@Data
@TableName
(
"sys_dict_item"
)
@EqualsAndHashCode
(
callSuper
=
false
)
@Accessors
(
chain
=
true
)
public
class
SysDictItem
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* id
*/
@TableId
(
type
=
IdType
.
ASSIGN_ID
)
private
String
id
;
/**
* 字典id
*/
private
String
dictId
;
/**
* 字典项文本
*/
@Excel
(
name
=
"字典项文本"
,
width
=
20
)
private
String
itemText
;
/**
* 字典项值
*/
@Excel
(
name
=
"字典项值"
,
width
=
30
)
private
String
itemValue
;
/**
* 描述
*/
@Excel
(
name
=
"描述"
,
width
=
40
)
private
String
description
;
/**
* 排序
*/
@Excel
(
name
=
"排序"
,
width
=
15
,
type
=
4
)
private
Integer
sortOrder
;
/**
* 状态(1启用 0不启用)
*/
private
Integer
status
;
private
String
createBy
;
private
Date
createTime
;
private
String
updateBy
;
private
Date
updateTime
;
/**
* 字典id
*/
private
String
pid
;
/**
* 字典id
*/
private
String
hasChild
;
/**
* 字典id
*/
private
String
pathIds
;
private
String
names
;
/**
* 字典id
*/
private
String
dictItemCode
;
/**
* 层级
*/
private
Integer
level
;
/**
* 字典编码
*/
@TableField
(
exist
=
false
)
private
String
dictCode
;
}
src/main/java/com/zzsn/thinktank/enums/BindTypeEnum.java
0 → 100644
浏览文件 @
667c3375
package
com
.
zzsn
.
thinktank
.
enums
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* @author zs
* @Description 信息源/信息源组 枚举
* @since 2021/12/9
*/
public
enum
BindTypeEnum
{
INFO_SOURCE
(
1
,
"绑定的通用信息源栏目"
),
INFO_SOURCE_GROUP
(
2
,
"绑定的通用信息源栏目组"
),
EXCLUDE_INFO_SOURCE
(
3
,
"排除的信息源栏目"
),
EXCLUDE_INFO_SOURCE_GROUP
(
4
,
"排除的信息源栏目组"
),
DIRECTIONA_INFO_SOURCE_GROUP
(
5
,
"定向的信息源栏目组"
),
DIRECTIONA_INFO_SOURCE
(
6
,
"定向的信息源栏目"
),
INFO_SOURCE_LABEL
(
12
,
"通用信息源栏目标签"
),
EXCLUDE_INFO_SOURCE_LABEL
(
14
,
"排除信息源栏目标签"
),
DIRECTIONA_INFO_SOURCE_LABEL
(
15
,
"定向信息源栏目标签"
),
INFO_MAIN_SOURCE
(
31
,
"绑定的通用信息源"
),
INFO_MAIN_SOURCE_GROUP
(
32
,
"绑定的通用信息源组"
),
EXCLUDE_MAIN_INFO_SOURCE
(
33
,
"排除的信息源"
),
EXCLUDE_MAIN_INFO_SOURCE_GROUP
(
34
,
"排除的信息源组"
),
DIRECTIONA_MAIN_INFO_SOURCE_GROUP
(
35
,
"定向的信息源组"
),
DIRECTIONA_MAIN_INFO_SOURCE
(
36
,
"定向的信息源"
),
INFO_SOURCE_MAIN_LABEL
(
312
,
"通用信息源标签"
),
EXCLUDE_INFO_MAIN_SOURCE_LABEL
(
314
,
"排除信息源标签"
),
DIRECTIONA_INFO_MAIN_SOURCE_LABEL
(
315
,
"定向信息源标签"
)
;
private
Integer
value
;
private
String
des
;
BindTypeEnum
(
int
value
,
String
des
)
{
this
.
value
=
value
;
this
.
des
=
des
;
}
public
Integer
getvalue
()
{
return
value
;
}
public
String
getDes
()
{
return
des
;
}
//定向、通用、屏蔽信息源栏目组类型返回
public
static
List
<
Integer
>
getInfoSourceGroupType
()
{
List
<
Integer
>
values
=
new
ArrayList
<>();
values
.
add
(
BindTypeEnum
.
INFO_SOURCE_GROUP
.
getvalue
());
values
.
add
(
BindTypeEnum
.
EXCLUDE_INFO_SOURCE_GROUP
.
getvalue
());
values
.
add
(
BindTypeEnum
.
DIRECTIONA_INFO_SOURCE_GROUP
.
getvalue
());
return
values
;
}
//定向、通用、屏蔽信息源类栏目型返回
public
static
List
<
Integer
>
getInfoSourceType
()
{
List
<
Integer
>
values
=
new
ArrayList
<>();
values
.
add
(
BindTypeEnum
.
INFO_SOURCE
.
getvalue
());
values
.
add
(
BindTypeEnum
.
EXCLUDE_INFO_SOURCE
.
getvalue
());
values
.
add
(
BindTypeEnum
.
DIRECTIONA_INFO_SOURCE
.
getvalue
());
return
values
;
}
//定向、通用、屏蔽 信息源栏目标签类型返回
public
static
List
<
Integer
>
getInfoSourceLabelType
()
{
List
<
Integer
>
values
=
new
ArrayList
<>();
values
.
add
(
BindTypeEnum
.
INFO_SOURCE_LABEL
.
getvalue
());
values
.
add
(
BindTypeEnum
.
EXCLUDE_INFO_SOURCE_LABEL
.
getvalue
());
values
.
add
(
BindTypeEnum
.
DIRECTIONA_INFO_SOURCE_LABEL
.
getvalue
());
return
values
;
}
//定向、通用、屏蔽信息源组类型返回
public
static
List
<
Integer
>
getInfoSourceMainGroupType
()
{
List
<
Integer
>
values
=
new
ArrayList
<>();
values
.
add
(
BindTypeEnum
.
INFO_MAIN_SOURCE_GROUP
.
getvalue
());
values
.
add
(
BindTypeEnum
.
EXCLUDE_MAIN_INFO_SOURCE_GROUP
.
getvalue
());
values
.
add
(
BindTypeEnum
.
DIRECTIONA_MAIN_INFO_SOURCE_GROUP
.
getvalue
());
return
values
;
}
//定向、通用、屏蔽信息源类型返回
public
static
List
<
Integer
>
getInfoSourceMainType
()
{
List
<
Integer
>
values
=
new
ArrayList
<>();
values
.
add
(
BindTypeEnum
.
INFO_MAIN_SOURCE
.
getvalue
());
values
.
add
(
BindTypeEnum
.
EXCLUDE_MAIN_INFO_SOURCE
.
getvalue
());
values
.
add
(
BindTypeEnum
.
DIRECTIONA_MAIN_INFO_SOURCE
.
getvalue
());
return
values
;
}
//定向、通用、屏蔽 信息源标签类型返回
public
static
List
<
Integer
>
getInfoSourceMainLabelType
()
{
List
<
Integer
>
values
=
new
ArrayList
<>();
values
.
add
(
BindTypeEnum
.
INFO_SOURCE_MAIN_LABEL
.
getvalue
());
values
.
add
(
BindTypeEnum
.
EXCLUDE_INFO_MAIN_SOURCE_LABEL
.
getvalue
());
values
.
add
(
BindTypeEnum
.
DIRECTIONA_INFO_MAIN_SOURCE_LABEL
.
getvalue
());
return
values
;
}
public
static
BindTypeEnum
getEnumByValue
(
Integer
value
)
{
for
(
BindTypeEnum
bindTypeEnum
:
BindTypeEnum
.
values
())
{
if
(
bindTypeEnum
.
getvalue
().
equals
(
value
))
{
return
bindTypeEnum
;
}
}
return
null
;
}
}
src/main/java/com/zzsn/thinktank/mapper/InfoSourceMapper.java
浏览文件 @
667c3375
package
com
.
zzsn
.
thinktank
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.zzsn.thinktank.entity.InfoSource
;
import
com.zzsn.thinktank.vo.
InfoSourceVo
;
import
com.zzsn.thinktank.vo.
*
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
...
...
@@ -21,11 +23,103 @@ public interface InfoSourceMapper extends BaseMapper<InfoSource> {
Integer
totalCountByGroupId
(
@Param
(
"infoSourceVo"
)
InfoSourceVo
infoSourceVo
,
@Param
(
"ynBind"
)
Integer
ynBind
,
@Param
(
"groupId"
)
String
groupId
);
List
<
InfoSourceVo
>
pageList
(
@Param
(
"customerId"
)
String
customerId
,
@Param
(
"userId"
)
String
userId
,
@Param
(
"infoSourceVo"
)
InfoSourceVo
infoSourceVo
,
@Param
(
"typeIds"
)
List
<
String
>
typeIds
,
@Param
(
"offset"
)
Integer
offset
,
@Param
(
"pageSize"
)
Integer
pageSize
);
List
<
InfoSourceVo
>
pageList
(
@Param
(
"customerId"
)
String
customerId
,
@Param
(
"userId"
)
String
userId
,
@Param
(
"infoSourceVo"
)
InfoSourceVo
infoSourceVo
,
@Param
(
"typeIds"
)
List
<
String
>
typeIds
,
@Param
(
"offset"
)
Integer
offset
,
@Param
(
"pageSize"
)
Integer
pageSize
);
List
<
InfoSourceVo
>
listBySidList
(
@Param
(
"customerId"
)
String
customerId
,
@Param
(
"userId"
)
String
userId
,
List
<
String
>
collect
);
List
<
InfoSourceVo
>
listBySidList
(
@Param
(
"customerId"
)
String
customerId
,
@Param
(
"userId"
)
String
userId
,
List
<
String
>
collect
);
Integer
totalCount
(
@Param
(
"customerId"
)
String
customerId
,
@Param
(
"userId"
)
String
userId
,
@Param
(
"infoSourceVo"
)
InfoSourceVo
infoSourceVo
,
@Param
(
"typeIds"
)
List
<
String
>
typeIds
);
Integer
totalCount
(
@Param
(
"customerId"
)
String
customerId
,
@Param
(
"userId"
)
String
userId
,
@Param
(
"infoSourceVo"
)
InfoSourceVo
infoSourceVo
,
@Param
(
"typeIds"
)
List
<
String
>
typeIds
);
List
<
String
>
listByGroupId
(
@Param
(
"groupId"
)
String
groupId
);
/**
* 智库绑定信息源分页列表
*
* @param thinkTankId 智库id
* @param infoSearchCondition 检索条件
* @param page 分页信息
* @author lkg
* @date 2025/8/2
*/
IPage
<
BindInfoSourceVO
>
bindInfoSourcePageList
(
@Param
(
"thinkTankId"
)
String
thinkTankId
,
@Param
(
"infoSearchCondition"
)
InfoSearchCondition
infoSearchCondition
,
Page
<
BindInfoSourceVO
>
page
);
/**
* 智库绑定信息源栏目分页列表
*
* @param thinkTankId 智库id
* @param infoSearchCondition 检索条件
* @param page 分页信息
* @author lkg
* @date 2025/8/2
*/
IPage
<
BindInfoSourceColumnVO
>
bindInfoSourceColumnPageList
(
@Param
(
"thinkTankId"
)
String
thinkTankId
,
@Param
(
"infoSearchCondition"
)
InfoSearchCondition
infoSearchCondition
,
Page
<
BindInfoSourceColumnVO
>
page
);
/**
* 智库绑定信息源栏目列表
*
* @param thinkTankId 智库id
* @param infoSearchCondition 检索条件
* @author lkg
* @date 2025/8/2
*/
List
<
BindInfoSourceColumnVO
>
bindInfoSourceColumnPageList
(
@Param
(
"thinkTankId"
)
String
thinkTankId
,
@Param
(
"infoSearchCondition"
)
InfoSearchCondition
infoSearchCondition
);
/**
* 智库绑定信息源组列表
*
* @param thinkTankId 智库id
* @param types 信息源类型
* @author lkg
* @date 2025/8/2
*/
List
<
InfoSourceGroupVO
>
bindInfoSourceGroupList
(
@Param
(
"thinkTankId"
)
String
thinkTankId
,
@Param
(
"types"
)
List
<
Integer
>
types
);
/**
* 智库绑定信息源列表
*
* @param thinkTankId 智库id
* @param types 信息源类型
* @author lkg
* @date 2025/8/2
*/
List
<
BindInfoSourceVO
>
bindInfoSourceList
(
@Param
(
"thinkTankId"
)
String
thinkTankId
,
@Param
(
"types"
)
List
<
Integer
>
types
);
/**
* 智库绑定信息源/信息源栏目标签列表
*
* @param thinkTankId 智库id
* @param types 信息源类型
* @author lkg
* @date 2025/8/2
*/
List
<
InfoSourceLabelVO
>
bindInfoSourceLabelList
(
@Param
(
"thinkTankId"
)
String
thinkTankId
,
@Param
(
"types"
)
List
<
Integer
>
types
);
/**
* 智库绑定信息源栏目组列表
*
* @param thinkTankId 智库id
* @param types 信息源类型
* @author lkg
* @date 2025/8/2
*/
List
<
InfoSourceGroupVO
>
bindInfoSourceColumnGroupList
(
@Param
(
"thinkTankId"
)
String
thinkTankId
,
@Param
(
"types"
)
List
<
Integer
>
types
);
/**
* 智库绑定信息源栏目列表
*
* @param thinkTankId 智库id
* @param types 信息源类型
* @author lkg
* @date 2025/8/2
*/
List
<
BindInfoSourceColumnVO
>
bindInfoSourceColumnList
(
@Param
(
"thinkTankId"
)
String
thinkTankId
,
@Param
(
"types"
)
List
<
Integer
>
types
);
/**
* 获取智库绑定信息源的数量
*
* @param thinkTankIds 智库id集合
* @author lkg
* @date 2025/8/5
*/
List
<
BindSourceDetailVO
>
bindSourceCount
(
@Param
(
"thinkTankIds"
)
List
<
String
>
thinkTankIds
);
}
src/main/java/com/zzsn/thinktank/mapper/SysDictItemMapper.java
0 → 100644
浏览文件 @
667c3375
package
com
.
zzsn
.
thinktank
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.zzsn.thinktank.entity.SysDictItem
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* <p>
* Mapper 接口
* </p>
*
* @Author zhangweijian
* @since 2018-12-28
*/
@Mapper
public
interface
SysDictItemMapper
extends
BaseMapper
<
SysDictItem
>
{
List
<
SysDictItem
>
listByDictCode
(
@Param
(
"dictCode"
)
String
dictCode
);
}
src/main/java/com/zzsn/thinktank/service/InfoSourceGroupMapService.java
浏览文件 @
667c3375
...
...
@@ -2,6 +2,7 @@ package com.zzsn.thinktank.service;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.zzsn.thinktank.entity.InfoSourceGroupMap
;
import
com.zzsn.thinktank.vo.BindVO
;
import
com.zzsn.thinktank.vo.ThinkTankSourceVO
;
import
java.util.List
;
...
...
@@ -30,4 +31,22 @@ public interface InfoSourceGroupMapService extends IService<InfoSourceGroupMap>
* @date 2024/8/23
*/
List
<
ThinkTankSourceVO
>
listOfThinkTank
(
List
<
String
>
groupIds
);
/**
* 绑定信息源
*
* @param bindVO 绑定信息
* @author lkg
* @date 2025/8/2
*/
void
bind
(
BindVO
bindVO
);
/**
* 解绑信息源
*
* @param bindVO 绑定信息
* @author lkg
* @date 2025/8/5
*/
void
unBind
(
BindVO
bindVO
);
}
src/main/java/com/zzsn/thinktank/service/InfoSourceService.java
浏览文件 @
667c3375
package
com
.
zzsn
.
thinktank
.
service
;
import
com.alibaba.fastjson2.JSONObject
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.zzsn.thinktank.entity.InfoSource
;
import
com.zzsn.thinktank.vo.
InfoSourceVo
;
import
com.zzsn.thinktank.vo.
*
;
import
java.util.List
;
...
...
@@ -17,15 +18,104 @@ public interface InfoSourceService extends IService<InfoSource> {
/**
* 根据分类id获取信息源列表(ynBind=0 :查询没有绑定该组的信息源列表 ynBind=1 :查询绑定该组的信息源列表 )
*/
IPage
<
InfoSourceVo
>
pageListByGroupId
(
InfoSourceVo
infoSourceVo
,
Integer
ynBind
,
String
groupId
,
Integer
pageNo
,
Integer
pageSize
);
IPage
<
InfoSourceVo
>
pageListByGroupId
(
InfoSourceVo
infoSourceVo
,
Integer
ynBind
,
String
groupId
,
Integer
pageNo
,
Integer
pageSize
);
/**
* 根据分类id获取信息源列表
*/
IPage
<
InfoSourceVo
>
pageListByTypeId
(
String
customerId
,
String
userId
,
InfoSourceVo
infoSourceVo
,
Integer
pageNo
,
Integer
pageSize
,
String
infoSourceTypeId
);
IPage
<
InfoSourceVo
>
pageListByTypeId
(
String
customerId
,
String
userId
,
InfoSourceVo
infoSourceVo
,
Integer
pageNo
,
Integer
pageSize
,
String
infoSourceTypeId
);
/**
* 获取信息源组下的信息源id集合
*/
List
<
String
>
listByGroupId
(
String
groupId
);
/**
* 智库绑定信息源分页列表
*
* @param thinkTankId 智库id
* @param infoSearchCondition 检索条件
* @param pageNo 页码
* @param pageSize 每页条数
* @author lkg
* @date 2025/8/2
*/
IPage
<
BindInfoSourceVO
>
bindInfoSourcePageList
(
String
thinkTankId
,
InfoSearchCondition
infoSearchCondition
,
Integer
pageNo
,
Integer
pageSize
);
/**
* 智库绑定信息源栏目分页列表
*
* @param thinkTankId 智库id
* @param infoSearchCondition 检索条件
* @param pageNo 页码
* @param pageSize 每页条数
* @author lkg
* @date 2025/8/2
*/
IPage
<
BindInfoSourceColumnVO
>
bindInfoSourceColumnPageList
(
String
thinkTankId
,
InfoSearchCondition
infoSearchCondition
,
Integer
pageNo
,
Integer
pageSize
);
/**
* 智库绑定信息源栏目列表
*
* @param thinkTankId 智库id
* @param infoSearchCondition 检索条件
* @author lkg
* @date 2025/8/4
*/
List
<
BindInfoSourceColumnVO
>
bindInfoSourceColumnPageList
(
String
thinkTankId
,
InfoSearchCondition
infoSearchCondition
);
/**
* 智库绑定信息源组列表
*
* @param thinkTankId 智库id
* @author lkg
* @date 2025/8/2
*/
JSONObject
bindInfoSourceGroupList
(
String
thinkTankId
);
/**
* 智库绑定信息源列表
*
* @param thinkTankId 智库id
* @author lkg
* @date 2025/8/2
*/
JSONObject
bindInfoSourceList
(
String
thinkTankId
);
/**
* 智库绑定信息源标签列表
*
* @param thinkTankId 智库id
* @param category 类型(1-信息源栏目;2-信息源)
* @author lkg
* @date 2025/8/2
*/
JSONObject
bindInfoSourceLabelList
(
String
thinkTankId
,
Integer
category
);
/**
* 智库绑定信息源栏目组列表
*
* @param thinkTankId 智库id
* @author lkg
* @date 2025/8/2
*/
JSONObject
bindInfoSourceColumnGroupList
(
String
thinkTankId
);
/**
* 智库绑定信息源栏目列表
*
* @param thinkTankId 智库id
* @author lkg
* @date 2025/8/2
*/
JSONObject
bindInfoSourceColumnList
(
String
thinkTankId
);
/**
* 获取智库绑定信息源的数量
*
* @param thinkTankIds 智库id集合
* @author lkg
* @date 2025/8/5
*/
List
<
BindSourceDetailVO
>
bindSourceCount
(
List
<
String
>
thinkTankIds
);
}
src/main/java/com/zzsn/thinktank/service/SysDictItemService.java
0 → 100644
浏览文件 @
667c3375
package
com
.
zzsn
.
thinktank
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.zzsn.thinktank.entity.SysDictItem
;
import
java.util.List
;
/**
* <p>
* 服务类
* </p>
*
* @Author zhangweijian
* @since 2018-12-28
*/
public
interface
SysDictItemService
extends
IService
<
SysDictItem
>
{
List
<
SysDictItem
>
listByDictCode
(
String
dictCode
);
}
src/main/java/com/zzsn/thinktank/service/ThinktankBasicInfoService.java
浏览文件 @
667c3375
...
...
@@ -27,7 +27,7 @@ public interface ThinktankBasicInfoService extends IService<ThinktankBasicInfo>
void
downloadTemplate
(
HttpServletResponse
response
);
Result
<?>
getListBaseData
(
String
id
,
Integer
pageNo
,
Integer
pageSize
,
Integer
office
);
Result
<?>
getListBaseData
(
String
id
,
Integer
pageNo
,
Integer
pageSize
);
/**
* 批量导入智库信息
...
...
src/main/java/com/zzsn/thinktank/service/impl/InfoSourceGroupMapServiceImpl.java
浏览文件 @
667c3375
差异被折叠。
点击展开。
src/main/java/com/zzsn/thinktank/service/impl/InfoSourceServiceImpl.java
浏览文件 @
667c3375
package
com
.
zzsn
.
thinktank
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.alibaba.fastjson2.JSONObject
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.zzsn.thinktank.entity.InfoSource
;
import
com.zzsn.thinktank.entity.SysDictItem
;
import
com.zzsn.thinktank.enums.BindTypeEnum
;
import
com.zzsn.thinktank.mapper.InfoSourceMapper
;
import
com.zzsn.thinktank.service.InfoSourceService
;
import
com.zzsn.thinktank.service.SysDictItemService
;
import
com.zzsn.thinktank.util.PageBuilderParser
;
import
com.zzsn.thinktank.vo.InfoSourceVo
;
import
com.zzsn.thinktank.vo.*
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.StringUtils
;
import
org.w3c.dom.Document
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -28,6 +32,8 @@ import java.util.stream.Collectors;
@Service
public
class
InfoSourceServiceImpl
extends
ServiceImpl
<
InfoSourceMapper
,
InfoSource
>
implements
InfoSourceService
{
@Autowired
private
SysDictItemService
sysDictItemService
;
/**
* 根据分类id获取信息源列表(ynBind=0 :查询没有绑定该组的信息源列表 ynBind=1 :查询绑定该组的信息源列表 )
...
...
@@ -192,4 +198,152 @@ public class InfoSourceServiceImpl extends ServiceImpl<InfoSourceMapper, InfoSou
public
List
<
String
>
listByGroupId
(
String
groupId
)
{
return
baseMapper
.
listByGroupId
(
groupId
);
}
@Override
public
IPage
<
BindInfoSourceVO
>
bindInfoSourcePageList
(
String
thinkTankId
,
InfoSearchCondition
infoSearchCondition
,
Integer
pageNo
,
Integer
pageSize
)
{
Page
<
BindInfoSourceVO
>
page
=
new
Page
<>(
pageNo
,
pageSize
);
return
baseMapper
.
bindInfoSourcePageList
(
thinkTankId
,
infoSearchCondition
,
page
);
}
@Override
public
IPage
<
BindInfoSourceColumnVO
>
bindInfoSourceColumnPageList
(
String
thinkTankId
,
InfoSearchCondition
infoSearchCondition
,
Integer
pageNo
,
Integer
pageSize
)
{
Page
<
BindInfoSourceColumnVO
>
page
=
new
Page
<>(
pageNo
,
pageSize
);
return
baseMapper
.
bindInfoSourceColumnPageList
(
thinkTankId
,
infoSearchCondition
,
page
);
}
@Override
public
List
<
BindInfoSourceColumnVO
>
bindInfoSourceColumnPageList
(
String
thinkTankId
,
InfoSearchCondition
infoSearchCondition
)
{
return
baseMapper
.
bindInfoSourceColumnPageList
(
thinkTankId
,
infoSearchCondition
);
}
@Override
public
JSONObject
bindInfoSourceGroupList
(
String
thinkTankId
)
{
JSONObject
jsonObject
=
new
JSONObject
();
List
<
InfoSourceGroupVO
>
groupList
=
baseMapper
.
bindInfoSourceGroupList
(
thinkTankId
,
BindTypeEnum
.
getInfoSourceMainGroupType
());
Map
<
Integer
,
List
<
InfoSourceGroupVO
>>
collect
=
groupList
.
stream
().
collect
(
Collectors
.
groupingBy
(
InfoSourceGroupVO:
:
getSourceType
));
collect
.
forEach
((
k
,
v
)->
{
BindTypeEnum
enumByValue
=
BindTypeEnum
.
getEnumByValue
(
k
);
if
(
ObjectUtil
.
isNotNull
(
enumByValue
))
{
//合并相同信息源组
List
<
InfoSourceGroupVO
>
list
=
new
ArrayList
<>();
for
(
InfoSourceGroupVO
groupPage
:
v
)
{
Optional
<
InfoSourceGroupVO
>
first
=
list
.
stream
().
filter
(
f
->
StrUtil
.
equals
(
f
.
getId
(),
groupPage
.
getId
())).
findFirst
();
if
(
first
.
isPresent
()){
InfoSourceGroupVO
infoSourceGroupVO
=
first
.
get
();
infoSourceGroupVO
.
setGroupTypeName
(
infoSourceGroupVO
.
getGroupTypeName
()+
"、"
+
groupPage
.
getGroupTypeName
());
}
else
{
list
.
add
(
groupPage
);
}
}
jsonObject
.
put
(
enumByValue
.
toString
(),
list
);
}
});
return
jsonObject
;
}
@Override
public
JSONObject
bindInfoSourceList
(
String
thinkTankId
)
{
JSONObject
jsonObject
=
new
JSONObject
();
List
<
BindInfoSourceVO
>
infoSourceVos
=
baseMapper
.
bindInfoSourceList
(
thinkTankId
,
BindTypeEnum
.
getInfoSourceMainType
());
if
(
CollectionUtil
.
isEmpty
(
infoSourceVos
))
{
return
jsonObject
;
}
Map
<
Integer
,
List
<
BindInfoSourceVO
>>
collect
=
infoSourceVos
.
stream
().
collect
(
Collectors
.
groupingBy
(
BindInfoSourceVO:
:
getSourceType
));
collect
.
forEach
((
k
,
v
)->
{
BindTypeEnum
enumByValue
=
BindTypeEnum
.
getEnumByValue
(
k
);
if
(
ObjectUtil
.
isNotNull
(
enumByValue
))
{
jsonObject
.
put
(
enumByValue
.
toString
(),
v
);
}
});
return
jsonObject
;
}
@Override
public
JSONObject
bindInfoSourceLabelList
(
String
thinkTankId
,
Integer
category
)
{
JSONObject
jsonObject
=
new
JSONObject
();
List
<
Integer
>
typeList
=
null
;
if
(
category
==
1
)
{
typeList
=
BindTypeEnum
.
getInfoSourceLabelType
();
}
else
if
(
category
==
2
)
{
typeList
=
BindTypeEnum
.
getInfoSourceMainLabelType
();
}
List
<
InfoSourceLabelVO
>
infoSourceLabelVOS
=
baseMapper
.
bindInfoSourceLabelList
(
thinkTankId
,
typeList
);
if
(
CollectionUtil
.
isEmpty
(
infoSourceLabelVOS
))
{
return
jsonObject
;
}
//字典类的标签处理层级关系
List
<
String
>
dictCodes
=
infoSourceLabelVOS
.
stream
().
filter
(
f
->
"3"
.
equals
(
f
.
getBusinessCaliber
())).
map
(
InfoSourceLabelVO:
:
getDictCode
).
collect
(
Collectors
.
toList
());
dictCodes
.
forEach
(
e
->
{
List
<
SysDictItem
>
dictList
=
sysDictItemService
.
listByDictCode
(
e
);
infoSourceLabelVOS
.
forEach
(
ee
->
{
if
(
"3"
.
equals
(
ee
.
getBusinessCaliber
())){
//标签使用的字典
Optional
<
SysDictItem
>
first
=
dictList
.
stream
().
filter
(
f
->
f
.
getItemValue
().
equals
(
ee
.
getLabelItemCode
())).
findFirst
();
if
(
first
.
isPresent
())
{
SysDictItem
dictItem
=
first
.
get
();
if
(
StrUtil
.
isNotBlank
(
dictItem
.
getNames
()))
{
ee
.
setLabelItemName
(
dictItem
.
getNames
());
}
else
{
ee
.
setLabelItemName
(
dictItem
.
getItemText
());
}
}
}
});
});
Map
<
Integer
,
List
<
InfoSourceLabelVO
>>
collect
=
infoSourceLabelVOS
.
stream
().
collect
(
Collectors
.
groupingBy
(
InfoSourceLabelVO:
:
getSourceType
));
collect
.
forEach
((
k
,
v
)->
{
BindTypeEnum
enumByValue
=
BindTypeEnum
.
getEnumByValue
(
k
);
if
(
ObjectUtil
.
isNotNull
(
enumByValue
))
{
jsonObject
.
put
(
enumByValue
.
toString
(),
v
);
}
});
return
jsonObject
;
}
@Override
public
JSONObject
bindInfoSourceColumnGroupList
(
String
thinkTankId
)
{
JSONObject
jsonObject
=
new
JSONObject
();
List
<
InfoSourceGroupVO
>
groupList
=
baseMapper
.
bindInfoSourceColumnGroupList
(
thinkTankId
,
BindTypeEnum
.
getInfoSourceGroupType
());
Map
<
Integer
,
List
<
InfoSourceGroupVO
>>
collect
=
groupList
.
stream
().
collect
(
Collectors
.
groupingBy
(
InfoSourceGroupVO:
:
getSourceType
));
collect
.
forEach
((
k
,
v
)->
{
BindTypeEnum
enumByValue
=
BindTypeEnum
.
getEnumByValue
(
k
);
if
(
ObjectUtil
.
isNotNull
(
enumByValue
))
{
//合并相同信息源组
List
<
InfoSourceGroupVO
>
list
=
new
ArrayList
<>();
for
(
InfoSourceGroupVO
groupPage
:
v
)
{
Optional
<
InfoSourceGroupVO
>
first
=
list
.
stream
().
filter
(
f
->
StrUtil
.
equals
(
f
.
getId
(),
groupPage
.
getId
())).
findFirst
();
if
(
first
.
isPresent
()){
InfoSourceGroupVO
infoSourceGroupVO
=
first
.
get
();
infoSourceGroupVO
.
setGroupTypeName
(
infoSourceGroupVO
.
getGroupTypeName
()+
"、"
+
groupPage
.
getGroupTypeName
());
}
else
{
list
.
add
(
groupPage
);
}
}
jsonObject
.
put
(
enumByValue
.
toString
(),
list
);
}
});
return
jsonObject
;
}
@Override
public
JSONObject
bindInfoSourceColumnList
(
String
thinkTankId
)
{
List
<
BindInfoSourceColumnVO
>
infoSourceVos
=
baseMapper
.
bindInfoSourceColumnList
(
thinkTankId
,
BindTypeEnum
.
getInfoSourceType
());
JSONObject
jsonObject
=
new
JSONObject
();
if
(
CollectionUtil
.
isEmpty
(
infoSourceVos
))
{
return
jsonObject
;
}
Map
<
Integer
,
List
<
BindInfoSourceColumnVO
>>
collect
=
infoSourceVos
.
stream
().
collect
(
Collectors
.
groupingBy
(
BindInfoSourceColumnVO:
:
getSourceType
));
collect
.
forEach
((
k
,
v
)->
{
BindTypeEnum
enumByValue
=
BindTypeEnum
.
getEnumByValue
(
k
);
if
(
ObjectUtil
.
isNotNull
(
enumByValue
))
{
jsonObject
.
put
(
enumByValue
.
toString
(),
v
);
}
});
return
jsonObject
;
}
@Override
public
List
<
BindSourceDetailVO
>
bindSourceCount
(
List
<
String
>
thinkTankIds
)
{
return
baseMapper
.
bindSourceCount
(
thinkTankIds
);
}
}
src/main/java/com/zzsn/thinktank/service/impl/SysDictItemServiceImpl.java
0 → 100644
浏览文件 @
667c3375
package
com
.
zzsn
.
thinktank
.
service
.
impl
;
import
com.baomidou.dynamic.datasource.annotation.DS
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.zzsn.thinktank.mapper.SysDictItemMapper
;
import
com.zzsn.thinktank.service.SysDictItemService
;
import
com.zzsn.thinktank.entity.SysDictItem
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* <p>
* 服务实现类
* </p>
*
* @Author zhangweijian
* @since 2018-12-28
*/
@Service
@DS
(
"slave"
)
public
class
SysDictItemServiceImpl
extends
ServiceImpl
<
SysDictItemMapper
,
SysDictItem
>
implements
SysDictItemService
{
@Override
public
List
<
SysDictItem
>
listByDictCode
(
String
dictCode
)
{
return
this
.
baseMapper
.
listByDictCode
(
dictCode
);
}
}
src/main/java/com/zzsn/thinktank/service/impl/ThinktankBasicInfoServiceImpl.java
浏览文件 @
667c3375
...
...
@@ -31,6 +31,7 @@ import javax.servlet.http.HttpServletResponse;
import
java.io.*
;
import
java.net.URLEncoder
;
import
java.util.*
;
import
java.util.concurrent.CompletableFuture
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
...
...
@@ -68,6 +69,9 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf
InfoSourceGroupMapService
infoSourceGroupMapService
;
@Autowired
private
InfoSourceService
infoSourceService
;
@Autowired
EsUtil
esUtil
;
@Resource
...
...
@@ -265,6 +269,78 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf
@Override
public
Result
<?>
getList
(
ThinktankBasicInfoListVo
thinktankBasicInfoListVo
)
{
IPage
page
=
new
Page
();
thinktankBasicInfoListVo
.
setColumn
(
StringUtil
.
humpToLine
(
thinktankBasicInfoListVo
.
getColumn
()));
//查询列表
List
<
ThinktankBasicInfoVo
>
list
=
thinktankBasicInfoMapper
.
getList
(
thinktankBasicInfoListVo
);
page
.
setRecords
(
list
);
//查询总数
Integer
total
=
thinktankBasicInfoMapper
.
getCount
(
thinktankBasicInfoListVo
);
page
.
setTotal
(
total
);
Integer
pageNo
=
thinktankBasicInfoListVo
.
getPageNo
();
Integer
pageSize
=
thinktankBasicInfoListVo
.
getPageSize
();
page
.
setCurrent
(
pageNo
);
page
.
setSize
(
pageSize
);
if
(
list
.
size
()
==
0
)
{
return
Result
.
OK
(
page
);
}
//智库id集合
List
<
String
>
groupIds
=
list
.
stream
().
map
(
ThinktankBasicInfoVo:
:
getId
).
collect
(
Collectors
.
toList
());
//智库绑定信息源栏目详细情况
List
<
BindSourceDetailVO
>
bindSourceDetailList
=
infoSourceService
.
bindSourceCount
(
groupIds
);
//按智库分组
Map
<
String
,
List
<
BindSourceDetailVO
>>
collect
=
bindSourceDetailList
.
stream
().
collect
(
Collectors
.
groupingBy
(
BindSourceDetailVO:
:
getThinkTankId
));
//所有绑定的信息源栏目id集合
List
<
String
>
sidList
=
bindSourceDetailList
.
stream
().
map
(
BindSourceDetailVO:
:
getSourceId
).
collect
(
Collectors
.
toList
());
//智库绑定信息源栏目采集资讯的数量
Map
<
String
,
Integer
>
groupCount
=
new
HashMap
<>();
//查询es
BoolQueryBuilder
boolQuerylist
=
QueryBuilders
.
boolQuery
();
boolQuerylist
.
must
(
QueryBuilders
.
termsQuery
(
"sid"
,
sidList
));
try
{
Map
<
String
,
Long
>
mapGroup
=
esUtil
.
groupBy
(
"basedata"
,
"sid"
,
boolQuerylist
,
sidList
.
size
());
for
(
Map
.
Entry
<
String
,
List
<
BindSourceDetailVO
>>
entry
:
collect
.
entrySet
())
{
String
thinkTankId
=
entry
.
getKey
();
List
<
String
>
bindSidList
=
entry
.
getValue
().
stream
().
map
(
BindSourceDetailVO:
:
getSourceId
).
collect
(
Collectors
.
toList
());
long
count
=
0
;
for
(
Map
.
Entry
<
String
,
Long
>
longEntry
:
mapGroup
.
entrySet
())
{
if
(
bindSidList
.
contains
(
longEntry
.
getKey
()))
{
count
+=
longEntry
.
getValue
();
}
}
groupCount
.
put
(
thinkTankId
,
Math
.
toIntExact
(
count
));
}
}
catch
(
IOException
e
)
{
log
.
error
(
"ES查询失败"
);
e
.
printStackTrace
();
}
for
(
ThinktankBasicInfoVo
thinktankBasicInfoVo
:
list
)
{
String
id
=
thinktankBasicInfoVo
.
getId
();
List
<
BindSourceDetailVO
>
bindSourceDetailVOS
=
collect
.
get
(
id
);
if
(
CollectionUtils
.
isEmpty
(
bindSourceDetailVOS
))
{
continue
;
}
thinktankBasicInfoVo
.
setInfoSourceCount
(
bindSourceDetailVOS
.
size
());
Integer
count
=
groupCount
.
get
(
id
);
if
(
count
==
null
)
{
continue
;
}
thinktankBasicInfoVo
.
setCollectionCount
(
count
);
}
CompletableFuture
.
runAsync
(()->{
//记录热门标签
String
tagId
=
thinktankBasicInfoListVo
.
getTagId
();
if
(
tagId
!=
null
&&
tagId
.
length
()
>
0
)
{
String
[]
tagIdArr
=
tagId
.
split
(
","
);
for
(
String
s
:
tagIdArr
)
{
thinktankTagService
.
addTagTop
(
s
);
}
}
});
return
Result
.
OK
(
page
);
}
public
Result
<?>
getList_old
(
ThinktankBasicInfoListVo
thinktankBasicInfoListVo
)
{
IPage
page
=
new
Page
();
thinktankBasicInfoListVo
.
setColumn
(
StringUtil
.
humpToLine
(
thinktankBasicInfoListVo
.
getColumn
()));
//查询列表
...
...
@@ -386,39 +462,30 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf
}
@Override
public
Result
<?>
getListBaseData
(
String
id
,
Integer
pageNo
,
Integer
pageSize
,
Integer
office
)
{
List
<
InfoSourceGroupMap
>
infoSourceGroupMapList
=
infoSourceGroupMapService
.
getSourceGroupMap
(
Arrays
.
asList
(
id
));
List
<
String
>
sidList
=
new
ArrayList
<>();
for
(
InfoSourceGroupMap
infoSourceGroupMap
:
infoSourceGroupMapList
)
{
sidList
.
add
(
infoSourceGroupMap
.
getSourceId
());
}
public
Result
<?>
getListBaseData
(
String
id
,
Integer
pageNo
,
Integer
pageSize
)
{
List
<
BindInfoSourceColumnVO
>
sourceColumnList
=
infoSourceService
.
bindInfoSourceColumnPageList
(
id
,
null
);
List
<
String
>
sidList
=
sourceColumnList
.
stream
().
map
(
BindInfoSourceColumnVO:
:
getId
).
collect
(
Collectors
.
toList
());
//设置分页参数
SearchSourceBuilder
searchSourceBuilder
=
new
SearchSourceBuilder
();
// searchSourceBuilder.size(pageSize);
// searchSourceBuilder.from(office);
searchSourceBuilder
.
trackTotalHits
(
true
);
//排序
searchSourceBuilder
.
sort
(
"createDate"
,
SortOrder
.
ASC
);
//查询es
BoolQueryBuilder
boolQuery
=
QueryBuilders
.
boolQuery
();
boolQuery
.
must
(
QueryBuilders
.
termsQuery
(
"sid"
,
sidList
));
//查询数据
searchSourceBuilder
.
query
(
boolQuery
);
Page
<
TransferData
>
page
=
null
;
Page
<
TransferData
>
page
=
new
Page
<>(
pageNo
,
pageSize
);
try
{
page
=
esUtil
.
queryPage
(
"basedata"
,
searchSourceBuilder
,
TransferData
.
class
,
pageNo
,
pageSize
);
for
(
TransferData
transferData
:
page
.
getRecords
())
{
transferData
.
setCreateDate
(
EsDateUtil
.
esFieldDateMapping
(
transferData
.
getCreateDate
()));
transferData
.
setPublishDate
(
EsDateUtil
.
esFieldDateMapping
(
transferData
.
getPublishDate
()));
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
for
(
TransferData
transferData
:
page
.
getRecords
())
{
transferData
.
setCreateDate
(
EsDateUtil
.
esFieldDateMapping
(
transferData
.
getCreateDate
()));
transferData
.
setPublishDate
(
EsDateUtil
.
esFieldDateMapping
(
transferData
.
getPublishDate
()));
}
return
Result
.
OK
(
page
);
}
...
...
@@ -649,7 +716,7 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf
Map
<
String
,
Long
>
monthlyCountMap
=
new
HashMap
<>();
try
{
//所有
totalCountMap
=
esUtil
.
groupBy
(
"basedata"
,
"sid"
,
boolQuerylist
,
100
);
totalCountMap
=
esUtil
.
groupBy
(
"basedata"
,
"sid"
,
boolQuerylist
,
sourceIds
.
size
()
);
//近一个月
DateTime
yesterday
=
cn
.
hutool
.
core
.
date
.
DateUtil
.
yesterday
();
DateTime
startTime
=
cn
.
hutool
.
core
.
date
.
DateUtil
.
offsetDay
(
yesterday
,
-
30
);
...
...
src/main/java/com/zzsn/thinktank/vo/BindInfoSourceColumnVO.java
0 → 100644
浏览文件 @
667c3375
package
com
.
zzsn
.
thinktank
.
vo
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
lombok.Data
;
/**
* <p>
* 信息源表
* </p>
*
* @author obcy
* @since 2025-06-19
*/
@Data
public
class
BindInfoSourceColumnVO
{
/**
* 信息源栏目id
*/
private
String
id
;
/**
* 信息源栏目编码
*/
private
String
infoSourceCode
;
/**
* 信息源栏目名称
*/
private
String
siteName
;
/**
* 信息源栏目地址
*/
private
String
siteUri
;
/**
* 信息源名称
*/
private
String
webSiteName
;
/**
* 信息源栏目状态
*/
private
Integer
status
;
/**
* 绑定的信息源类型
*/
private
Integer
sourceType
;
}
src/main/java/com/zzsn/thinktank/vo/BindInfoSourceVO.java
0 → 100644
浏览文件 @
667c3375
package
com
.
zzsn
.
thinktank
.
vo
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
lombok.Data
;
/**
* <p>
* 信息源表
* </p>
*
* @author obcy
* @since 2025-06-19
*/
@Data
public
class
BindInfoSourceVO
{
/**
* 信息源id
*/
private
String
id
;
/**
* 信息源编码
*/
private
String
code
;
/**
* 信息源名称
*/
private
String
infoName
;
/**
* 地址
*/
private
String
infoAddress
;
/**
* 绑定的信息源类型
*/
private
Integer
sourceType
;
}
src/main/java/com/zzsn/thinktank/vo/BindLabelVo.java
0 → 100644
浏览文件 @
667c3375
package
com
.
zzsn
.
thinktank
.
vo
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
BindLabelVo
{
private
String
labelCode
;
private
String
labelItemCode
;
private
List
<
BindLabelVo
>
labelItems
;
}
src/main/java/com/zzsn/thinktank/vo/BindSourceDetailVO.java
0 → 100644
浏览文件 @
667c3375
package
com
.
zzsn
.
thinktank
.
vo
;
import
lombok.Data
;
/**
* 智库绑定信息源数量对象
*
* @author lkg
* @date 2025/8/5
*/
@Data
public
class
BindSourceDetailVO
{
private
String
thinkTankId
;
private
String
sourceId
;
}
src/main/java/com/zzsn/thinktank/vo/BindVO.java
0 → 100644
浏览文件 @
667c3375
package
com
.
zzsn
.
thinktank
.
vo
;
import
lombok.Data
;
import
java.util.List
;
/**
* 绑定信息源对象
*
* @author lkg
* @date 2025/8/2
*/
@Data
public
class
BindVO
{
//智库id
private
String
thinkTankId
;
//id(可以是信息源/信息源栏目组id集合,可以是信息源/信息源栏目id集合)
private
List
<
String
>
bindIds
;
//信息源标签
private
List
<
BindLabelVo
>
bindLabels
;
//绑定类型类型(1:通用 2:定向)
private
Integer
sourceBindType
;
//信息源类型(1:信息源栏目组 2:信息源栏目 3:信息源栏目标签 4:信息源组 5:信息源 6:信息源标签)
private
Integer
sourceType
;
}
src/main/java/com/zzsn/thinktank/vo/InfoSearchCondition.java
0 → 100644
浏览文件 @
667c3375
package
com
.
zzsn
.
thinktank
.
vo
;
import
lombok.Data
;
/**
* 绑定信息源的检索条件
*
* @author lkg
* @date 2025/8/2
*/
@Data
public
class
InfoSearchCondition
{
/**
* 信息源编码
*/
private
String
code
;
/**
* 信息源名称
*/
private
String
infoName
;
/**
* 信息源URL
*/
private
String
infoAddress
;
/**
* 信息源栏目名称
*/
private
String
siteName
;
/**
* 信息源栏目URL
*/
private
String
siteUri
;
/**
* 信息源栏目状态
*/
private
String
status
;
/**
* 爬虫类别
*/
private
Integer
crawlType
;
}
src/main/java/com/zzsn/thinktank/vo/InfoSourceGroupVO.java
0 → 100644
浏览文件 @
667c3375
package
com
.
zzsn
.
thinktank
.
vo
;
import
lombok.Data
;
/**
* 信息源组信息
*
* @author lkg
* @date 2025/8/2
*/
@Data
public
class
InfoSourceGroupVO
{
/**
* 信息源组id
*/
private
String
id
;
/**
* 信息源组编码
*/
private
String
groupCode
;
/**
* 信息源组名称
*/
private
String
groupName
;
/**
* 信息源组名称
*/
private
Integer
sourceType
;
/**
* 信息源组分类名称
*/
private
String
groupTypeName
;
}
src/main/java/com/zzsn/thinktank/vo/InfoSourceLabelVO.java
0 → 100644
浏览文件 @
667c3375
package
com
.
zzsn
.
thinktank
.
vo
;
import
lombok.Data
;
/**
* 信息源标签信息
*
* @author lkg
* @date 2025/8/2
*/
@Data
public
class
InfoSourceLabelVO
{
/**
* 标签值id
*/
private
String
id
;
/**
* 标签编码
*/
private
String
labelCode
;
/**
* 标签名称
*/
private
String
labelName
;
/**
* 业务口径(1自定义,2实体表引用,3字典引用)
*/
private
String
businessCaliber
;
/**
* 引用数据字典的编码
*/
private
String
dictCode
;
/**
* 标签值编码
*/
private
String
labelItemCode
;
/**
* 标签值名称
*/
private
String
labelItemName
;
/**
* 绑定的信息源类型
*/
private
Integer
sourceType
;
}
src/main/java/com/zzsn/thinktank/vo/ThinktankBasicInfoVo.java
浏览文件 @
667c3375
...
...
@@ -78,9 +78,9 @@ public class ThinktankBasicInfoVo extends Model<ThinktankBasicInfoVo> {
private
Date
updateTime
;
//采集信息总量
private
Integer
collectionCount
;
private
Integer
collectionCount
=
0
;
//绑定信息源个数
private
Integer
infoSourceCount
;
private
Integer
infoSourceCount
=
0
;
//语言
private
String
lang
;
...
...
src/main/resources/application.yml
浏览文件 @
667c3375
...
...
@@ -10,11 +10,50 @@ spring:
max-file-size
:
100MB
#总上传文件大小
max-request-size
:
1000MB
datasource
:
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
druid
:
stat-view-servlet
:
enabled
:
true
loginUsername
:
admin
loginPassword
:
123456667
allow
:
web-stat-filter
:
enabled
:
true
dynamic
:
druid
:
# 全局druid参数,绝大部分值和默认保持一致。(现已支持的参数如下,不清楚含义不要乱设置)
# 连接池的配置信息
# 初始化大小,最小,最大
initial-size
:
5
min-idle
:
10
maxActive
:
100
# 配置获取连接等待超时的时间
maxWait
:
60000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
timeBetweenEvictionRunsMillis
:
60000
# 配置一个连接在池中最小生存的时间,单位是毫秒
minEvictableIdleTimeMillis
:
600000
validationQuery
:
SELECT 1 FROM DUAL
testWhileIdle
:
true
testOnBorrow
:
false
testOnReturn
:
false
# 打开PSCache,并且指定每个连接上PSCache的大小
poolPreparedStatements
:
true
maxPoolPreparedStatementPerConnectionSize
:
20
# 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
filters
:
stat,wall,slf4j
# 通过connectProperties属性来打开mergeSql功能;慢SQL记录
connectionProperties
:
druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
datasource
:
master
:
driver-class-name
:
com.mysql.cj.jdbc.Driver
url
:
jdbc:mysql://1.95.14.228:3306/clb_project?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true
username
:
ciglobal
password
:
_PSuWVQ4CLpX
slave
:
driver-class-name
:
com.mysql.cj.jdbc.Driver
url
:
jdbc:mysql://1.95.14.228:3306/clb_system?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true
username
:
ciglobal
password
:
_PSuWVQ4CLpX
redis
:
database
:
0
host
:
1.95.69.2
...
...
src/main/resources/mapper/InfoSourceMapper.xml
浏览文件 @
667c3375
差异被折叠。
点击展开。
src/main/resources/mapper/SysDictItemMapper.xml
0 → 100644
浏览文件 @
667c3375
<?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.thinktank.mapper.SysDictItemMapper"
>
<select
id=
"listByDictCode"
resultType=
"com.zzsn.thinktank.entity.SysDictItem"
>
select * from sys_dict_item item inner join sys_dict dict on item.dict_id = dict.id
where dict.dict_code = #{dictCode} and item.status = 1
</select>
</mapper>
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论