Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
E
event
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
陈世强
event
Commits
6ba8a2c5
提交
6ba8a2c5
authored
6月 21, 2025
作者:
obcy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
【信息源组相关】
上级
c3127196
隐藏空白字符变更
内嵌
并排
正在显示
44 个修改的文件
包含
3118 行增加
和
13 行删除
+3118
-13
TreeNodeInfo.java
src/main/java/com/zzsn/event/constant/TreeNodeInfo.java
+19
-0
RelationBindController.java
.../zzsn/event/controller/common/RelationBindController.java
+11
-0
GroupMainTypeController.java
.../event/controller/infosource/GroupMainTypeController.java
+134
-0
InfoSourceMainController.java
...event/controller/infosource/InfoSourceMainController.java
+81
-0
InfoSourceMainGroupController.java
.../controller/infosource/InfoSourceMainGroupController.java
+333
-0
GroupMainType.java
src/main/java/com/zzsn/event/entity/GroupMainType.java
+81
-0
GroupMainTypeMap.java
src/main/java/com/zzsn/event/entity/GroupMainTypeMap.java
+63
-0
InfoSourceGroup.java
src/main/java/com/zzsn/event/entity/InfoSourceGroup.java
+25
-1
InfoSourceMain.java
src/main/java/com/zzsn/event/entity/InfoSourceMain.java
+156
-0
InfoSourceMainGroup.java
src/main/java/com/zzsn/event/entity/InfoSourceMainGroup.java
+67
-0
InfoSourceMainGroupMap.java
...in/java/com/zzsn/event/entity/InfoSourceMainGroupMap.java
+63
-0
SysDictItem.java
src/main/java/com/zzsn/event/entity/SysDictItem.java
+1
-0
BindTypeEnum.java
src/main/java/com/zzsn/event/enums/BindTypeEnum.java
+51
-9
CodePrefixEnum.java
src/main/java/com/zzsn/event/enums/CodePrefixEnum.java
+2
-1
RemoteSystemService.java
...in/java/com/zzsn/event/feign/api/RemoteSystemService.java
+6
-0
GroupMainTypeMapMapper.java
...in/java/com/zzsn/event/mapper/GroupMainTypeMapMapper.java
+17
-0
GroupMainTypeMapper.java
src/main/java/com/zzsn/event/mapper/GroupMainTypeMapper.java
+21
-0
InfoSourceGroupMapper.java
...ain/java/com/zzsn/event/mapper/InfoSourceGroupMapper.java
+2
-0
InfoSourceMainGroupMapMapper.java
...a/com/zzsn/event/mapper/InfoSourceMainGroupMapMapper.java
+15
-0
InfoSourceMainGroupMapper.java
...java/com/zzsn/event/mapper/InfoSourceMainGroupMapper.java
+49
-0
InfoSourceMainMapper.java
...main/java/com/zzsn/event/mapper/InfoSourceMainMapper.java
+28
-0
GroupMainTypeMapper.xml
...in/java/com/zzsn/event/mapper/xml/GroupMainTypeMapper.xml
+13
-0
InfoSourceGroupMapper.xml
.../java/com/zzsn/event/mapper/xml/InfoSourceGroupMapper.xml
+29
-0
InfoSourceMainGroupMapper.xml
...a/com/zzsn/event/mapper/xml/InfoSourceMainGroupMapper.xml
+220
-0
InfoSourceMainMapper.xml
...n/java/com/zzsn/event/mapper/xml/InfoSourceMainMapper.xml
+138
-0
InfoSourceMapper.xml
src/main/java/com/zzsn/event/mapper/xml/InfoSourceMapper.xml
+127
-0
IGroupMainTypeMapService.java
...java/com/zzsn/event/service/IGroupMainTypeMapService.java
+16
-0
IGroupMainTypeService.java
...in/java/com/zzsn/event/service/IGroupMainTypeService.java
+36
-0
IInfoSourceMainGroupMapService.java
...om/zzsn/event/service/IInfoSourceMainGroupMapService.java
+15
-0
InfoSourceGroupService.java
...n/java/com/zzsn/event/service/InfoSourceGroupService.java
+11
-1
InfoSourceMainGroupService.java
...va/com/zzsn/event/service/InfoSourceMainGroupService.java
+55
-0
InfoSourceMainService.java
...in/java/com/zzsn/event/service/InfoSourceMainService.java
+25
-0
GroupMainTypeMapServiceImpl.java
.../zzsn/event/service/impl/GroupMainTypeMapServiceImpl.java
+17
-0
GroupMainTypeServiceImpl.java
...com/zzsn/event/service/impl/GroupMainTypeServiceImpl.java
+403
-0
InfoSourceGroupMainServiceImpl.java
...sn/event/service/impl/InfoSourceGroupMainServiceImpl.java
+285
-0
InfoSourceGroupServiceImpl.java
...m/zzsn/event/service/impl/InfoSourceGroupServiceImpl.java
+11
-0
InfoSourceMainGroupMapServiceImpl.java
...event/service/impl/InfoSourceMainGroupMapServiceImpl.java
+18
-0
InfoSourceMainServiceImpl.java
...om/zzsn/event/service/impl/InfoSourceMainServiceImpl.java
+173
-0
SubjectServiceImpl.java
.../java/com/zzsn/event/service/impl/SubjectServiceImpl.java
+72
-0
ExcelExportUtil.java
src/main/java/com/zzsn/event/util/ExcelExportUtil.java
+36
-0
GroupMainTypeVo.java
src/main/java/com/zzsn/event/vo/GroupMainTypeVo.java
+65
-0
InfoSourceGroupPage.java
src/main/java/com/zzsn/event/vo/InfoSourceGroupPage.java
+1
-1
InfoSourceMainGroupPage.java
src/main/java/com/zzsn/event/vo/InfoSourceMainGroupPage.java
+110
-0
InfoSourceVo.java
src/main/java/com/zzsn/event/vo/InfoSourceVo.java
+17
-0
没有找到文件。
src/main/java/com/zzsn/event/constant/TreeNodeInfo.java
0 → 100644
浏览文件 @
6ba8a2c5
package
com
.
zzsn
.
event
.
constant
;
/**
* Description:
*
* @author: EDY
* @since: 2024/8/23
*/
public
class
TreeNodeInfo
{
/**根节点父ID的值*/
public
static
final
String
ROOT_PID_VALUE
=
"0"
;
/**树节点有子节点状态值*/
public
static
final
String
HAS_CHILD
=
"1"
;
/**树节点无子节点状态值*/
public
static
final
String
NO_CHILD
=
"0"
;
}
src/main/java/com/zzsn/event/controller/common/RelationBindController.java
浏览文件 @
6ba8a2c5
...
...
@@ -180,6 +180,17 @@ public class RelationBindController {
List
<
GroupTreeVO
>
tree
=
infoSourceGroupService
.
GroupAndTypeTree
();
return
Result
.
OK
(
tree
);
}
/**
* 信息源组和分类组成的树型结构(专题/事件配置页)
*
* @author lkg
* @date 2024/12/23
*/
@GetMapping
(
"/infourceMainGroupAndTypeTree"
)
public
Result
<?>
infourceMainGroupAndTypeTree
()
{
List
<
GroupTreeVO
>
tree
=
infoSourceGroupService
.
infourceMainGroupAndTypeTree
();
return
Result
.
OK
(
tree
);
}
/**
* 专题/事件信息源绑定(专题/事件配置页)
...
...
src/main/java/com/zzsn/event/controller/infosource/GroupMainTypeController.java
0 → 100644
浏览文件 @
6ba8a2c5
package
com
.
zzsn
.
event
.
controller
.
infosource
;
import
com.zzsn.event.constant.Result
;
import
com.zzsn.event.entity.GroupMainType
;
import
com.zzsn.event.service.IGroupMainTypeService
;
import
com.zzsn.event.vo.GroupMainTypeVo
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.Arrays
;
import
java.util.List
;
@Api
(
tags
=
"信息源组类别"
)
@RestController
@RequestMapping
(
"/groupMainType"
)
public
class
GroupMainTypeController
{
@Autowired
private
IGroupMainTypeService
groupTypeService
;
/**
* 通过父级id列表查询
*
* @param subjectId
* @return
*/
// @AutoLog(value = "信息源组类别-通过父级id列表查询")
@ApiOperation
(
value
=
"信息源组类别-通过父级id列表查询"
,
notes
=
"信息源组类别-通过父级id列表查询"
)
@GetMapping
(
value
=
"/listByParentId"
)
public
Result
<?>
listByParentId
(
@RequestParam
(
name
=
"subjectId"
,
defaultValue
=
"0"
)
String
subjectId
,
@RequestParam
(
name
=
"parentId"
,
defaultValue
=
"0"
)
String
parentId
)
{
List
<
GroupMainTypeVo
>
allList
=
groupTypeService
.
listByParentId
(
parentId
);
return
Result
.
OK
(
allList
);
}
/**
* 通过id删除
*
* @param id
* @return
*/
// @AutoLog(value = "信息源组类别-通过id删除")
@ApiOperation
(
value
=
"信息源组类别-通过id删除"
,
notes
=
"信息源组类别-通过id删除"
)
@DeleteMapping
(
value
=
"/delete"
)
public
Result
<?>
delete
(
@RequestParam
(
name
=
"id"
,
required
=
true
)
String
id
)
{
groupTypeService
.
deleteGroupType
(
id
);
return
Result
.
OK
(
"删除成功!"
);
}
/**
* 批量删除
*
* @param ids
* @return
*/
@ApiOperation
(
value
=
"信息源组类别-批量删除"
,
notes
=
"信息源组类别-批量删除"
)
@DeleteMapping
(
value
=
"/deleteBatch"
)
public
Result
<?>
deleteBatch
(
@RequestParam
(
name
=
"ids"
,
required
=
true
)
String
ids
)
{
groupTypeService
.
deleteGroupTypeByIds
(
Arrays
.
asList
(
ids
.
split
(
","
)));
return
Result
.
OK
(
"批量删除成功!"
);
}
/**
* 添加
*
* @param groupMainType
* @return
*/
@ApiOperation
(
value
=
"信息源组类别-添加"
,
notes
=
"信息源组类别-添加"
)
@PostMapping
(
value
=
"/add"
)
public
Result
<?>
add
(
@RequestBody
GroupMainType
groupMainType
)
{
return
groupTypeService
.
addGroupType
(
groupMainType
);
}
/**
* 编辑
*
* @param groupMainType
* @return
*/
@ApiOperation
(
value
=
"信息源组类别-编辑"
,
notes
=
"信息源组类别-编辑"
)
@PutMapping
(
value
=
"/edit"
)
public
Result
<?>
edit
(
@RequestBody
GroupMainType
groupMainType
)
{
return
groupTypeService
.
updateGroupType
(
groupMainType
);
}
/**
* 信息源组分类据源组树结构
*
* @return
*/
@ApiOperation
(
value
=
"信息源组分类据源组树结构"
,
notes
=
"信息源组分类据源组树结构"
)
@GetMapping
(
value
=
"/getInfoGroupTypeTree"
)
public
Result
<?>
getInfoGroupTypeTree
()
{
return
groupTypeService
.
getInfoGroupTypeTree
();
}
/**
* 列表查询
*
* @param groupName
* @return
*/
@ApiOperation
(
value
=
"信息源组表-列表查询"
,
notes
=
"信息源组表-列表查询"
)
@GetMapping
(
value
=
"/sourceGroupPermissionQueryList"
)
public
Result
<?>
permissionQueryList
(
String
groupName
)
{
return
groupTypeService
.
sourceGroupPermissionQueryList
(
groupName
);
}
/**
* 列表查询
*
* @param contain
* @param subjectId
* @return
*/
@ApiOperation
(
value
=
"信息源组类别-列表查询"
,
notes
=
"信息源组类别-列表查询"
)
@GetMapping
(
value
=
"/rootListNoPage"
)
public
Result
<?>
queryPageListNoPage
(
@RequestParam
(
name
=
"contain"
,
defaultValue
=
"false"
)
Boolean
contain
,
@RequestParam
(
name
=
"keywords"
,
required
=
false
)
String
keywords
,
@RequestParam
(
name
=
"subjectId"
,
defaultValue
=
"0"
)
String
subjectId
)
{
List
<
GroupMainTypeVo
>
allList
=
groupTypeService
.
allList
(
contain
,
subjectId
,
keywords
);
return
Result
.
OK
(
allList
);
}
}
src/main/java/com/zzsn/event/controller/infosource/InfoSourceMainController.java
0 → 100644
浏览文件 @
6ba8a2c5
package
com
.
zzsn
.
event
.
controller
.
infosource
;
import
com.alibaba.fastjson2.JSONObject
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.zzsn.event.constant.Result
;
import
com.zzsn.event.entity.InfoSourceMain
;
import
com.zzsn.event.service.InfoSourceMainService
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* <p>
* 信息源表 前端控制器
* </p>
*
* @author obcy
* @since 2025-06-19
*/
@RestController
@RequestMapping
(
"/infoSourceMain"
)
public
class
InfoSourceMainController
{
@Autowired
InfoSourceMainService
infoSourceMainService
;
/**
* 查询专题绑定的信息源列表
*/
@ApiOperation
(
value
=
"专题绑定的信息源列表"
,
notes
=
"专题绑定的信息源列表"
)
@GetMapping
(
value
=
"/subjectBindList"
)
public
Result
<?>
subjectBindList
(
InfoSourceMain
infoSourceMain
,
@RequestParam
(
name
=
"subjectId"
,
defaultValue
=
"0"
)
String
subjectId
,
@RequestParam
(
name
=
"pageNo"
,
defaultValue
=
"1"
)
Integer
pageNo
,
@RequestParam
(
name
=
"pageSize"
,
defaultValue
=
"10"
)
Integer
pageSize
)
{
IPage
<
InfoSourceMain
>
pageList
=
infoSourceMainService
.
subjectBindList
(
infoSourceMain
,
subjectId
,
pageNo
,
pageSize
);
return
Result
.
OK
(
pageList
);
}
/**
* 专题绑定的信息源组列表
*
* @param id
* @return
*/
@ApiOperation
(
value
=
"专题绑定/排除的信息源组列表"
,
notes
=
"专题绑定/排除的信息源组列表"
)
@GetMapping
(
value
=
"/bindInfoSourceMainGroupList"
)
public
Result
<?>
bindInfoSourceMainGroupList
(
@RequestParam
(
name
=
"id"
)
String
id
)
{
JSONObject
infoSourceGroupPages
=
infoSourceMainService
.
bindInfoSourceMainGroupList
(
id
);
return
Result
.
OK
(
infoSourceGroupPages
);
}
/**
* 专题绑定的信息源组列表
*
* @param id
* @return
*/
@ApiOperation
(
value
=
"专题绑定/排除的信息源列表"
,
notes
=
"专题绑定/排除的信息源列表"
)
@GetMapping
(
value
=
"/bindInfoSourceMainList"
)
public
Result
<?>
bindInfoSourceMainList
(
@RequestParam
(
name
=
"id"
)
String
id
)
{
JSONObject
infoSourceGroupPages
=
infoSourceMainService
.
bindInfoSourceMainList
(
id
);
return
Result
.
OK
(
infoSourceGroupPages
);
}
/**
* 专题绑定的信息源组列表
*
* @param id
* @return
*/
@ApiOperation
(
value
=
"专题绑定/排除的标签列表"
,
notes
=
"专题绑定/排除的标签列表"
)
@GetMapping
(
value
=
"/bindInfoSourceMainLabelList"
)
public
Result
<?>
bindInfoSourceLabelListNew
(
@RequestParam
(
name
=
"id"
)
String
id
)
{
JSONObject
infoSourceGroupPages
=
infoSourceMainService
.
bindInfoSourceMainLabelList
(
id
);
return
Result
.
OK
(
infoSourceGroupPages
);
}
}
src/main/java/com/zzsn/event/controller/infosource/InfoSourceMainGroupController.java
0 → 100644
浏览文件 @
6ba8a2c5
package
com
.
zzsn
.
event
.
controller
.
infosource
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.zzsn.event.constant.Result
;
import
com.zzsn.event.entity.InfoSourceMain
;
import
com.zzsn.event.entity.InfoSourceMainGroup
;
import
com.zzsn.event.entity.InfoSourceMainGroupMap
;
import
com.zzsn.event.service.IInfoSourceMainGroupMapService
;
import
com.zzsn.event.service.InfoSourceMainGroupService
;
import
com.zzsn.event.util.ExcelExportUtil
;
import
com.zzsn.event.util.ObsUtil
;
import
com.zzsn.event.vo.InfoSourceGroupPage
;
import
com.zzsn.event.vo.InfoSourceMainGroupPage
;
import
com.zzsn.event.vo.InfoSourceVo
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.poi.xssf.usermodel.XSSFWorkbook
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartHttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.*
;
import
java.net.URLEncoder
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.concurrent.CompletableFuture
;
import
java.util.stream.Collectors
;
@Api
(
tags
=
"信息源组"
)
@RestController
@RequestMapping
(
"/groupMain"
)
public
class
InfoSourceMainGroupController
{
@Autowired
InfoSourceMainGroupService
infoSourceMainGroupService
;
@Autowired
IInfoSourceMainGroupMapService
infoSourceMainGroupMapService
;
@Autowired
private
ObsUtil
obsUtil
;
/**
* 分页列表查询
*
* @param infoSourceMainGroup
* @param pageNo
* @param pageSize
* @return
*/
@ApiOperation
(
value
=
"信息源组表-分页列表查询"
,
notes
=
"信息源组表-分页列表查询"
)
@GetMapping
(
value
=
"/listByTypeId"
)
public
Result
<?>
queryPageListByTypeId
(
InfoSourceMainGroup
infoSourceMainGroup
,
@RequestParam
(
name
=
"pageNo"
,
defaultValue
=
"1"
)
Integer
pageNo
,
@RequestParam
(
name
=
"pageSize"
,
defaultValue
=
"10"
)
Integer
pageSize
,
@RequestParam
(
name
=
"groupTypeId"
,
defaultValue
=
""
)
String
groupTypeId
)
{
IPage
<
InfoSourceMainGroupPage
>
pageList
=
infoSourceMainGroupService
.
pageByTypeId
(
infoSourceMainGroup
,
pageNo
,
pageSize
,
groupTypeId
);
return
Result
.
OK
(
pageList
);
}
/**
* 通过id查询
*
* @param id
* @return
*/
@ApiOperation
(
value
=
"信息源组表-通过id查询"
,
notes
=
"信息源组表-通过id查询"
)
@GetMapping
(
value
=
"/queryById"
)
public
Result
<?>
queryById
(
@RequestParam
(
name
=
"id"
,
required
=
true
)
String
id
)
{
InfoSourceMainGroupPage
infoSourceGroup
=
infoSourceMainGroupService
.
getGroupById
(
id
);
if
(
StrUtil
.
isNotBlank
(
infoSourceGroup
.
getGroupTypeId
()))
{
infoSourceGroup
.
setGroupTypeIds
(
Arrays
.
asList
(
infoSourceGroup
.
getGroupTypeId
().
split
(
","
)));
}
if
(
infoSourceGroup
==
null
)
{
return
Result
.
FAIL
(
"未找到对应数据"
);
}
return
Result
.
OK
(
infoSourceGroup
);
}
/**
* 通过id删除
*
* @param id
* @return
*/
@ApiOperation
(
value
=
"信息源组表-通过id删除"
,
notes
=
"信息源组表-通过id删除"
)
@DeleteMapping
(
value
=
"/delete"
)
public
Result
<?>
delete
(
@RequestParam
(
name
=
"id"
,
required
=
true
)
String
id
)
{
infoSourceMainGroupService
.
deleteMain
(
id
);
return
Result
.
OK
(
"删除成功!"
);
}
/**
* 批量删除
*
* @param ids
* @return
*/
@ApiOperation
(
value
=
"信息源组表-批量删除"
,
notes
=
"信息源组表-批量删除"
)
@DeleteMapping
(
value
=
"/deleteBatch"
)
public
Result
<?>
deleteBatch
(
@RequestParam
(
name
=
"ids"
,
required
=
true
)
String
ids
)
{
this
.
infoSourceMainGroupService
.
deleteMainByIds
(
Arrays
.
asList
(
ids
.
split
(
","
)));
return
Result
.
OK
(
"批量删除成功!"
);
}
/**
* 导出绑定的信息源列表
*
* @param groupIds 信息源组id,多个逗号分割
* @author lkg
* @date 2025/1/21
*/
@GetMapping
(
"/exportBindList"
)
public
void
exportBindList
(
@RequestParam
String
groupIds
,
HttpServletResponse
response
)
throws
Exception
{
List
<
InfoSourceVo
>
infoSourceVos
=
infoSourceMainGroupService
.
bindListByGroupIds
(
Arrays
.
asList
(
groupIds
.
split
(
","
)));
String
[]
headers
=
new
String
[]{
"信息源id"
,
"信息源编码"
,
"信息源名称"
,
"信息源地址"
};
XSSFWorkbook
workbook
=
new
XSSFWorkbook
();
Map
<
String
,
List
<
InfoSourceVo
>>
collect
=
infoSourceVos
.
stream
().
collect
(
Collectors
.
groupingBy
(
InfoSourceVo:
:
getGroupName
));
int
sheetNum
=
0
;
for
(
Map
.
Entry
<
String
,
List
<
InfoSourceVo
>>
entry
:
collect
.
entrySet
())
{
String
groupName
=
entry
.
getKey
();
List
<
InfoSourceVo
>
value
=
entry
.
getValue
();
List
<
List
<
String
>>
dataList
=
value
.
stream
().
map
(
InfoSourceVo:
:
toExcelList
).
collect
(
Collectors
.
toList
());
ExcelExportUtil
.
exportExcelData
(
workbook
,
sheetNum
,
Arrays
.
asList
(
headers
),
dataList
,
groupName
);
sheetNum
++;
}
// 将Workbook写入字节流
ByteArrayOutputStream
outStream
=
new
ByteArrayOutputStream
();
workbook
.
write
(
outStream
);
// 将字节流转换为InputStream
byte
[]
bytes
=
outStream
.
toByteArray
();
String
filename
=
URLEncoder
.
encode
(
"绑定的信息源列表.xls"
,
"UTF-8"
).
replace
(
"+"
,
" "
);
response
.
setHeader
(
"Access-Control-Expose-Headers"
,
"Content-Disposition"
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment;filename="
+
filename
);
response
.
setContentLength
(
bytes
.
length
);
OutputStream
out
=
response
.
getOutputStream
();
out
.
write
(
bytes
);
out
.
flush
();
out
.
close
();
}
/**
* 编辑
*
* @param infoSourceMainGroupPage
* @return
*/
@ApiOperation
(
value
=
"信息源组表-编辑"
,
notes
=
"信息源组表-编辑"
)
@PutMapping
(
value
=
"/edit"
)
public
Result
<?>
edit
(
@RequestBody
InfoSourceMainGroupPage
infoSourceMainGroupPage
)
{
InfoSourceMainGroup
infoSourceGroup
=
new
InfoSourceMainGroup
();
BeanUtils
.
copyProperties
(
infoSourceMainGroupPage
,
infoSourceGroup
);
infoSourceMainGroupService
.
updateMain
(
infoSourceGroup
,
infoSourceMainGroupPage
.
getGroupTypeIds
());
return
Result
.
OK
(
"编辑成功!"
);
}
/**
* 添加
*
* @param infoSourceMainGroupPage
* @return
*/
@ApiOperation
(
value
=
"信息源组表-添加"
,
notes
=
"信息源组表-添加"
)
@PostMapping
(
value
=
"/add"
)
public
Result
<?>
add
(
@RequestBody
InfoSourceMainGroupPage
infoSourceMainGroupPage
)
{
InfoSourceMainGroup
infoSourceGroup
=
new
InfoSourceMainGroup
();
BeanUtils
.
copyProperties
(
infoSourceMainGroupPage
,
infoSourceGroup
);
infoSourceMainGroupService
.
saveMain
(
infoSourceGroup
,
infoSourceMainGroupPage
.
getGroupTypeIds
());
return
Result
.
OK
(
"添加成功!"
);
}
/**
* 查询信息源组的绑定列别
*/
@ApiOperation
(
value
=
"信息源信息源组关联表-绑定"
,
notes
=
"信息源信息源组关联表-绑定"
)
@GetMapping
(
value
=
"/bindList"
)
public
Result
<?>
bindList
(
InfoSourceVo
infoSourceVo
,
@RequestParam
(
name
=
"ynBind"
,
required
=
true
)
Integer
ynBind
,
@RequestParam
(
name
=
"groupId"
,
required
=
true
)
String
groupId
,
@RequestParam
(
name
=
"pageNo"
,
defaultValue
=
"1"
)
Integer
pageNo
,
@RequestParam
(
name
=
"pageSize"
,
defaultValue
=
"10"
)
Integer
pageSize
)
{
IPage
<
InfoSourceVo
>
pageList
=
infoSourceMainGroupService
.
pageListByGroupId
(
infoSourceVo
,
ynBind
,
groupId
,
pageNo
,
pageSize
);
return
Result
.
OK
(
pageList
);
}
/**
* 绑定信息源
*/
@ApiOperation
(
value
=
"信息源信息源组关联表-绑定"
,
notes
=
"信息源信息源组关联表-绑定"
)
@PostMapping
(
value
=
"/bind"
)
public
Result
<?>
bind
(
@RequestBody
InfoSourceGroupPage
infoSourceGroupPage
)
{
String
message
=
infoSourceMainGroupService
.
bind
(
infoSourceGroupPage
.
getId
(),
infoSourceGroupPage
.
getInfoSourceIds
());
return
Result
.
OK
(
message
);
}
/**
* 解绑信息源
*/
@ApiOperation
(
value
=
"信息源信息源组关联表-解绑"
,
notes
=
"信息源信息源组关联表-解绑"
)
@PostMapping
(
value
=
"/unBound"
)
public
Result
<?>
unBound
(
@RequestBody
InfoSourceGroupPage
infoSourceGroupPage
)
{
infoSourceMainGroupService
.
unBind
(
infoSourceGroupPage
.
getId
(),
infoSourceGroupPage
.
getInfoSourceIds
());
return
Result
.
OK
(
"解绑成功!"
);
}
/**
* 查询信息源列表
*/
@ApiOperation
(
value
=
"信息源信息源组关联表-绑定"
,
notes
=
"信息源信息源组关联表-绑定"
)
@GetMapping
(
value
=
"/infosourceMainList"
)
public
Result
<?>
infosourceMainList
(
InfoSourceMain
infoSourceMain
,
@RequestParam
(
name
=
"pageNo"
,
defaultValue
=
"1"
)
Integer
pageNo
,
@RequestParam
(
name
=
"pageSize"
,
defaultValue
=
"10"
)
Integer
pageSize
)
{
IPage
<
InfoSourceMain
>
pageList
=
infoSourceMainGroupService
.
infosourceMainList
(
infoSourceMain
,
pageNo
,
pageSize
);
return
Result
.
OK
(
pageList
);
}
/**
* 批量绑定模板下载
*
* @author lkg
* @date 2025/01/20
*/
@GetMapping
(
"/downloadTemplate"
)
public
void
downloadTemplate
(
HttpServletResponse
response
)
{
String
filePath
=
"bindInfoSource/绑定信息源模板main.xlsx"
;
download
(
filePath
,
response
);
}
public
void
download
(
String
filePath
,
HttpServletResponse
response
)
{
BufferedInputStream
bis
=
null
;
BufferedOutputStream
bos
=
null
;
byte
[]
bytes
=
obsUtil
.
getObjectByte
(
filePath
);
ByteArrayInputStream
inputStream
=
new
ByteArrayInputStream
(
bytes
);
try
{
OutputStream
outs
=
response
.
getOutputStream
();
bos
=
new
BufferedOutputStream
(
outs
);
bis
=
new
BufferedInputStream
(
inputStream
);
int
i
;
while
((
i
=
bis
.
read
(
bytes
))
!=
-
1
)
{
bos
.
write
(
bytes
,
0
,
i
);
}
bos
.
flush
();
bos
.
close
();
bis
.
close
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
finally
{
try
{
bos
.
flush
();
bos
.
close
();
bis
.
close
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
/**
* 批量绑定信息源
*
* @author lkg
* @date 2025/01/20
*/
@PostMapping
(
"/bindByFile"
)
public
Result
<?>
bindByFile
(
HttpServletRequest
request
)
{
MultipartHttpServletRequest
multipartRequest
=
(
MultipartHttpServletRequest
)
request
;
Map
<
String
,
MultipartFile
>
fileMap
=
multipartRequest
.
getFileMap
();
if
(
fileMap
.
size
()
<
1
)
{
return
Result
.
FAIL
(
500
,
"请上传excel文件"
);
}
String
groupId
=
request
.
getParameter
(
"groupId"
);
if
(
StringUtils
.
isEmpty
(
groupId
))
{
return
Result
.
FAIL
(
500
,
"请选择信息源组"
);
}
MultipartFile
multipartFile
=
fileMap
.
get
(
new
ArrayList
<>(
fileMap
.
keySet
()).
get
(
0
));
int
index
=
multipartFile
.
getOriginalFilename
().
lastIndexOf
(
"."
);
String
fileSuffix
=
multipartFile
.
getOriginalFilename
().
substring
(
index
+
1
);
if
(
"xls"
.
equals
(
fileSuffix
)
||
"xlsx"
.
equals
(
fileSuffix
))
{
CompletableFuture
.
runAsync
(()->{
try
{
//读取文件内容
List
<
List
<
String
>>
lists
=
ExcelExportUtil
.
readExcel
(
multipartFile
.
getInputStream
(),
1
,
4
);
if
(
CollectionUtil
.
isNotEmpty
(
lists
))
{
List
<
InfoSourceMainGroupMap
>
dataList
=
new
ArrayList
<>();
for
(
List
<
String
>
list
:
lists
)
{
String
sourceId
=
list
.
get
(
0
);
if
(
StringUtils
.
isEmpty
(
sourceId
)){
//忽略空数据
continue
;
}
InfoSourceMainGroupMap
infoSourceGroupMap
=
new
InfoSourceMainGroupMap
();
infoSourceGroupMap
.
setGroupId
(
groupId
);
infoSourceGroupMap
.
setSourceId
(
sourceId
);
LambdaQueryWrapper
<
InfoSourceMainGroupMap
>
queryWrapper
=
Wrappers
.
lambdaQuery
();
queryWrapper
.
eq
(
InfoSourceMainGroupMap:
:
getGroupId
,
groupId
).
eq
(
InfoSourceMainGroupMap:
:
getSourceId
,
sourceId
);
int
count
=
infoSourceMainGroupMapService
.
count
(
queryWrapper
);
if
(
count
==
0
)
{
dataList
.
add
(
infoSourceGroupMap
);
}
}
infoSourceMainGroupMapService
.
saveBatch
(
dataList
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
});
return
Result
.
OK
(
"正在导入中,请稍后查看..."
);
}
else
{
return
Result
.
FAIL
(
500
,
"请上传excel文件"
);
}
}
}
src/main/java/com/zzsn/event/entity/GroupMainType.java
0 → 100644
浏览文件 @
6ba8a2c5
package
com
.
zzsn
.
event
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
org.jeecgframework.poi.excel.annotation.Excel
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* @Description: 信息源组类别
* @Author: jeecg-boot
* @Date: 2021-11-25
* @Version: V1.0
*/
@Data
@TableName
(
"group_main_type"
)
@ApiModel
(
value
=
"group_type对象"
,
description
=
"信息源组类别"
)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public
class
GroupMainType
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**主键*/
@TableId
(
type
=
IdType
.
ASSIGN_ID
)
@ApiModelProperty
(
value
=
"主键"
)
private
String
id
;
/**类别名称*/
@Excel
(
name
=
"类别名称"
,
width
=
15
)
@ApiModelProperty
(
value
=
"类别名称"
)
private
String
typeName
;
/**创建人*/
@ApiModelProperty
(
value
=
"创建人"
)
private
String
createBy
;
/**创建日期*/
@JsonFormat
(
timezone
=
"GMT+8"
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty
(
value
=
"创建日期"
)
private
Date
createTime
;
/**更新人*/
@ApiModelProperty
(
value
=
"更新人"
)
private
String
updateBy
;
/**更新日期*/
@JsonFormat
(
timezone
=
"GMT+8"
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty
(
value
=
"更新日期"
)
private
Date
updateTime
;
/**所属部门*/
@ApiModelProperty
(
value
=
"所属部门"
)
private
String
sysOrgCode
;
/**父级节点*/
@Excel
(
name
=
"父级节点"
,
width
=
15
)
@ApiModelProperty
(
value
=
"父级节点"
)
private
String
pid
;
/**是否有子节点*/
@Excel
(
name
=
"是否有子节点"
,
width
=
15
,
dicCode
=
"yn"
)
@ApiModelProperty
(
value
=
"是否有子节点"
)
private
String
hasChild
;
/**
* 节点绝对路径
*/
private
String
pathIds
;
/**
* 状态(1启用 0不启用)
*/
private
Integer
status
;
/**所属客户*/
@ApiModelProperty
(
value
=
"所属客户"
)
private
String
customerId
;
}
src/main/java/com/zzsn/event/entity/GroupMainTypeMap.java
0 → 100644
浏览文件 @
6ba8a2c5
package
com
.
zzsn
.
event
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
org.jeecgframework.poi.excel.annotation.Excel
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* @Description: 信息源组-类别关联表
* @Author: jeecg-boot
* @Date: 2021-11-25
* @Version: V1.0
*/
@Data
@TableName
(
"group_main_type_map"
)
@Accessors
(
chain
=
true
)
@EqualsAndHashCode
(
callSuper
=
false
)
@ApiModel
(
value
=
"group_type_map对象"
,
description
=
"信息源组-类别关联表"
)
public
class
GroupMainTypeMap
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**主键*/
@TableId
(
type
=
IdType
.
ASSIGN_ID
)
@ApiModelProperty
(
value
=
"主键"
)
private
String
id
;
/**信息源组id*/
@Excel
(
name
=
"信息源组id"
,
width
=
15
)
@ApiModelProperty
(
value
=
"信息源组id"
)
private
String
groupId
;
/**类别id*/
@Excel
(
name
=
"类别id"
,
width
=
15
)
@ApiModelProperty
(
value
=
"类别id"
)
private
String
typeId
;
/**创建人*/
@ApiModelProperty
(
value
=
"创建人"
)
private
String
createBy
;
/**创建日期*/
@JsonFormat
(
timezone
=
"GMT+8"
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty
(
value
=
"创建日期"
)
private
Date
createTime
;
/**更新人*/
@ApiModelProperty
(
value
=
"更新人"
)
private
String
updateBy
;
/**更新日期*/
@JsonFormat
(
timezone
=
"GMT+8"
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty
(
value
=
"更新日期"
)
private
Date
updateTime
;
/**所属部门*/
@ApiModelProperty
(
value
=
"所属部门"
)
private
String
sysOrgCode
;
}
src/main/java/com/zzsn/event/entity/InfoSourceGroup.java
浏览文件 @
6ba8a2c5
...
...
@@ -4,9 +4,12 @@ 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
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
java.io.Serializable
;
...
...
@@ -34,7 +37,28 @@ public class InfoSourceGroup implements Serializable {
private
String
groupRemark
;
/**状态*/
private
Integer
status
;
/**创建人*/
@ApiModelProperty
(
value
=
"创建人"
)
private
java
.
lang
.
String
createBy
;
/**创建日期*/
@JsonFormat
(
timezone
=
"GMT+8"
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty
(
value
=
"创建日期"
)
private
java
.
util
.
Date
createTime
;
/**更新人*/
@ApiModelProperty
(
value
=
"更新人"
)
private
java
.
lang
.
String
updateBy
;
/**更新日期*/
@JsonFormat
(
timezone
=
"GMT+8"
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty
(
value
=
"更新日期"
)
private
java
.
util
.
Date
updateTime
;
/**所属部门*/
@ApiModelProperty
(
value
=
"所属部门"
)
private
java
.
lang
.
String
sysOrgCode
;
/**所属客户*/
@ApiModelProperty
(
value
=
"所属客户"
)
private
String
customerId
;
/**分类id,逗号拼接*/
@TableField
(
exist
=
false
)
...
...
src/main/java/com/zzsn/event/entity/InfoSourceMain.java
0 → 100644
浏览文件 @
6ba8a2c5
package
com
.
zzsn
.
event
.
entity
;
import
com.baomidou.mybatisplus.annotation.*
;
import
com.baomidou.mybatisplus.extension.activerecord.Model
;
import
java.util.Date
;
import
java.io.Serializable
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
/**
* <p>
* 信息源表
* </p>
*
* @author obcy
* @since 2025-06-19
*/
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
@TableName
(
"info_source_main"
)
public
class
InfoSourceMain
extends
Model
<
InfoSourceMain
>
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 主键
*/
@TableId
(
value
=
"id"
,
type
=
IdType
.
ASSIGN_ID
)
private
String
id
;
/**
* 信息源编码
*/
@TableField
(
"code"
)
private
String
code
;
/**
* 信息源名称
*/
@TableField
(
"info_name"
)
private
String
infoName
;
/**
* 类型
*/
@TableField
(
"type"
)
private
Integer
type
;
/**
* 地址
*/
@TableField
(
"info_address"
)
private
String
infoAddress
;
/**
* 别名
*/
@TableField
(
"alias"
)
private
String
alias
;
/**
* 是否原创性校验1 校验 0否
*/
@TableField
(
"original_check"
)
private
Integer
originalCheck
;
/**
* 校验列表
*/
@TableField
(
"check_list"
)
private
String
checkList
;
/**
* 主办单位
*/
@TableField
(
"organizer"
)
private
String
organizer
;
/**
* 地区全路径
*/
@TableField
(
"area_full_paths"
)
private
String
areaFullPaths
;
/**
* 地区名称
*/
@TableField
(
"area"
)
private
String
area
;
/**
* 是否翻墙
*/
@TableField
(
"skip_wall"
)
private
Integer
skipWall
;
/**
* 网站刷新速度
*/
@TableField
(
"refresh_speed"
)
private
Integer
refreshSpeed
;
/**
* 创建时间
*/
@TableField
(
"create_time"
)
private
Date
createTime
;
/**
* 更新时间
*/
@TableField
(
"update_time"
)
private
Date
updateTime
;
/**
* 创建人
*/
@TableField
(
"create_by"
)
private
String
createBy
;
/**
* 更新人
*/
@TableField
(
"update_by"
)
private
String
updateBy
;
@TableField
(
"del_flag"
)
@TableLogic
private
Integer
delFlag
;
/**是否免过关键词 0否 1是*/
@TableField
(
exist
=
false
)
private
Integer
isExemptKeyword
;
/**是否免审核 0否 1是*/
@TableField
(
exist
=
false
)
private
Integer
isFreeCheck
;
/**专题绑定的信息源的类型,定向或者非定向*/
@TableField
(
exist
=
false
)
private
String
subjectInfoSourceType
;
/**
* 信息源类别
*/
@TableField
(
exist
=
false
)
private
Integer
sourceType
;
/**
* 专题绑定信息源的主键id
*/
@TableField
(
exist
=
false
)
private
String
subjectInfoSourceId
;
@Override
protected
Serializable
pkVal
()
{
return
this
.
id
;
}
}
src/main/java/com/zzsn/event/entity/InfoSourceMainGroup.java
0 → 100644
浏览文件 @
6ba8a2c5
package
com
.
zzsn
.
event
.
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
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
java.io.Serializable
;
/**
* @Description: 信息源组表
* @Author: jeecg-boot
* @Date: 2021-11-25
* @Version: V1.0
*/
@Data
@TableName
(
"info_source_main_group"
)
@Accessors
(
chain
=
true
)
@EqualsAndHashCode
(
callSuper
=
false
)
public
class
InfoSourceMainGroup
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**主键*/
@TableId
(
type
=
IdType
.
ASSIGN_ID
)
private
String
id
;
/**组编码*/
private
String
groupCode
;
/**信息源组名称*/
private
String
groupName
;
/**分组说明*/
private
String
groupRemark
;
/**状态*/
private
Integer
status
;
/**创建人*/
@ApiModelProperty
(
value
=
"创建人"
)
private
java
.
lang
.
String
createBy
;
/**创建日期*/
@JsonFormat
(
timezone
=
"GMT+8"
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty
(
value
=
"创建日期"
)
private
java
.
util
.
Date
createTime
;
/**更新人*/
@ApiModelProperty
(
value
=
"更新人"
)
private
java
.
lang
.
String
updateBy
;
/**更新日期*/
@JsonFormat
(
timezone
=
"GMT+8"
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty
(
value
=
"更新日期"
)
private
java
.
util
.
Date
updateTime
;
/**所属部门*/
@ApiModelProperty
(
value
=
"所属部门"
)
private
java
.
lang
.
String
sysOrgCode
;
/**所属客户*/
@ApiModelProperty
(
value
=
"所属客户"
)
private
String
customerId
;
/**分类id,逗号拼接*/
@TableField
(
exist
=
false
)
private
String
groupTypeIds
;
}
src/main/java/com/zzsn/event/entity/InfoSourceMainGroupMap.java
0 → 100644
浏览文件 @
6ba8a2c5
package
com
.
zzsn
.
event
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
org.jeecgframework.poi.excel.annotation.Excel
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* @Description: 信息源组和信息源关联表
* @Author: jeecg-boot
* @Date: 2021-11-24
* @Version: V1.0
*/
@Data
@TableName
(
"info_source_main_group_map"
)
@Accessors
(
chain
=
true
)
@EqualsAndHashCode
(
callSuper
=
false
)
@ApiModel
(
value
=
"info_source_group_map对象"
,
description
=
"信息源组和信息源关联表"
)
public
class
InfoSourceMainGroupMap
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**主键*/
@TableId
(
type
=
IdType
.
ASSIGN_ID
)
@ApiModelProperty
(
value
=
"主键"
)
private
String
id
;
/**信息源组id*/
@Excel
(
name
=
"信息源组id"
,
width
=
15
)
@ApiModelProperty
(
value
=
"信息源组id"
)
private
String
groupId
;
/**信息源id*/
@Excel
(
name
=
"信息源id"
,
width
=
15
)
@ApiModelProperty
(
value
=
"信息源id"
)
private
String
sourceId
;
/**创建人*/
@ApiModelProperty
(
value
=
"创建人"
)
private
String
createBy
;
/**创建日期*/
@JsonFormat
(
timezone
=
"GMT+8"
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty
(
value
=
"创建日期"
)
private
Date
createTime
;
/**更新人*/
@ApiModelProperty
(
value
=
"更新人"
)
private
String
updateBy
;
/**更新日期*/
@JsonFormat
(
timezone
=
"GMT+8"
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty
(
value
=
"更新日期"
)
private
Date
updateTime
;
/**所属部门*/
@ApiModelProperty
(
value
=
"所属部门"
)
private
String
sysOrgCode
;
}
src/main/java/com/zzsn/event/entity/SysDictItem.java
浏览文件 @
6ba8a2c5
...
...
@@ -90,6 +90,7 @@ public class SysDictItem implements Serializable {
* 字典id
*/
private
String
pathIds
;
private
String
names
;
/**
* 字典id
*/
...
...
src/main/java/com/zzsn/event/enums/BindTypeEnum.java
浏览文件 @
6ba8a2c5
...
...
@@ -11,19 +11,37 @@ import java.util.List;
public
enum
BindTypeEnum
{
INFO_SOURCE
(
1
,
"绑定的通用信息源"
),
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
,
"定向信息源标签"
)
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
,
"定向信息源标签"
)
;
private
Integer
value
;
...
...
@@ -68,6 +86,30 @@ public enum BindTypeEnum {
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
;
}
...
...
src/main/java/com/zzsn/event/enums/CodePrefixEnum.java
浏览文件 @
6ba8a2c5
...
...
@@ -12,7 +12,8 @@ public enum CodePrefixEnum {
PROJECT_DEFAULT
(
"PJ"
,
"项目编码默认前缀"
),
CUSTOMER_DEFAULT
(
"CS"
,
"客户编码默认前缀"
),
SPECIAL_INFO_SOURCE_DEFAULT
(
"PY"
,
"信息源编码默认前缀"
),
INFO_SOURCE_GROUP_DEFAULT
(
"ING"
,
"信息源组编码默认前缀"
),
INFO_SOURCE_GROUP_DEFAULT
(
"ING"
,
"信息源栏目组编码默认前缀"
),
INFO_SOURCE_MAIN_GROUP_DEFAULT
(
"INGM"
,
"信息源组编码默认前缀"
),
KEY_WORDS_DEFAULT
(
"EVENT_KW"
,
"关键词默认前缀"
),
QCC_ENTERPRISE_ID_DEFAULT
(
"QCC"
,
"老企业库ID"
),
COLUMN_CODE_DEFAULT
(
"COL"
,
"栏目编码默认前缀"
),
...
...
src/main/java/com/zzsn/event/feign/api/RemoteSystemService.java
浏览文件 @
6ba8a2c5
...
...
@@ -9,6 +9,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import
org.springframework.web.bind.annotation.RequestParam
;
import
java.util.List
;
import
java.util.Map
;
@FeignClient
(
value
=
"jeecg-system"
)
public
interface
RemoteSystemService
{
...
...
@@ -19,4 +20,9 @@ public interface RemoteSystemService {
@GetMapping
(
"/sys/dictType/treeListContainsDict"
)
Result
<
List
<
Tree
<
String
>>>
treeListContainsDict
();
@GetMapping
(
"/sys/api/listItemByDictCode"
)
Object
getDictList
(
@RequestParam
(
"dictCode"
)
String
dictCode
);
}
src/main/java/com/zzsn/event/mapper/GroupMainTypeMapMapper.java
0 → 100644
浏览文件 @
6ba8a2c5
package
com
.
zzsn
.
event
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.zzsn.event.entity.GroupMainTypeMap
;
import
org.apache.ibatis.annotations.Mapper
;
/**
* @Description: 信息源组-类别关联表
* @Author: jeecg-boot
* @Date: 2021-11-25
* @Version: V1.0
*/
@Mapper
public
interface
GroupMainTypeMapMapper
extends
BaseMapper
<
GroupMainTypeMap
>
{
}
src/main/java/com/zzsn/event/mapper/GroupMainTypeMapper.java
0 → 100644
浏览文件 @
6ba8a2c5
package
com
.
zzsn
.
event
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.zzsn.event.entity.GroupMainType
;
import
com.zzsn.event.vo.InfoSourceMainGroupPage
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* @Description: 信息源组类别
* @Author: jeecg-boot
* @Date: 2021-11-25
* @Version: V1.0
*/
@Mapper
public
interface
GroupMainTypeMapper
extends
BaseMapper
<
GroupMainType
>
{
List
<
InfoSourceMainGroupPage
>
sourceGroupPermissionQueryList
(
@Param
(
"groupName"
)
String
groupName
);
}
src/main/java/com/zzsn/event/mapper/InfoSourceGroupMapper.java
浏览文件 @
6ba8a2c5
...
...
@@ -47,4 +47,6 @@ public interface InfoSourceGroupMapper extends BaseMapper<InfoSourceGroup> {
* @date 2024/12/23
*/
List
<
GroupTreeVO
>
groupAndTypeTree
();
List
<
GroupTreeVO
>
infourceMainGroupAndTypeTree
();
}
src/main/java/com/zzsn/event/mapper/InfoSourceMainGroupMapMapper.java
0 → 100644
浏览文件 @
6ba8a2c5
package
com
.
zzsn
.
event
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.zzsn.event.entity.InfoSourceMainGroupMap
;
import
org.apache.ibatis.annotations.Mapper
;
/**
* @author 张宗涵
* @date 2024/5/22
*/
@Mapper
public
interface
InfoSourceMainGroupMapMapper
extends
BaseMapper
<
InfoSourceMainGroupMap
>
{
}
src/main/java/com/zzsn/event/mapper/InfoSourceMainGroupMapper.java
0 → 100644
浏览文件 @
6ba8a2c5
package
com
.
zzsn
.
event
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.zzsn.event.entity.InfoSourceMain
;
import
com.zzsn.event.entity.InfoSourceMainGroup
;
import
com.zzsn.event.vo.InfoSourceGroupPage
;
import
com.zzsn.event.vo.InfoSourceMainGroupPage
;
import
com.zzsn.event.vo.InfoSourceVo
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* @Description: 信息源组表
* @Author: jeecg-boot
* @Date: 2021-11-25
* @Version: V1.0
*/
@Mapper
public
interface
InfoSourceMainGroupMapper
extends
BaseMapper
<
InfoSourceMainGroup
>
{
List
<
InfoSourceMainGroupPage
>
listByTypeId
(
@Param
(
"list"
)
List
<
String
>
list
,
@Param
(
"status"
)
int
status
);
Integer
countListByTypeAndIdList
(
@Param
(
"finalIdList"
)
List
<
String
>
finalIdList
,
@Param
(
"status"
)
String
status
);
List
<
InfoSourceMainGroupPage
>
pageList
(
@Param
(
"infoSourceMainGroup"
)
InfoSourceMainGroup
infoSourceMainGroup
,
@Param
(
"typeIds"
)
List
<
String
>
typeIds
,
@Param
(
"offset"
)
int
offset
,
@Param
(
"pageSize"
)
Integer
pageSize
);
Integer
totalCount
(
@Param
(
"infoSourceMainGroup"
)
InfoSourceMainGroup
infoSourceMainGroup
,
@Param
(
"typeIds"
)
List
<
String
>
typeIds
);
List
<
InfoSourceMainGroupPage
>
countList
(
@Param
(
"groupIds"
)
List
<
String
>
groupIds
);
InfoSourceMainGroupPage
selectGroupById
(
@Param
(
"groupId"
)
String
groupId
);
List
<
String
>
selectInfoSourceByGroupIds
(
@Param
(
"groupIds"
)
List
<
String
>
groupIds
);
List
<
InfoSourceVo
>
bindListByGroupIds
(
@Param
(
"groupIds"
)
List
<
String
>
groupIds
);
List
<
InfoSourceMainGroupPage
>
listByTypeIdList
(
@Param
(
"groupTypeIdList"
)
List
<
String
>
groupTypeIdList
,
@Param
(
"subjectId"
)
String
subjectId
,
@Param
(
"status"
)
int
status
,
@Param
(
"keywords"
)
String
keywords
);
List
<
InfoSourceVo
>
pageListByGroupId
(
@Param
(
"infoSourceVo"
)
InfoSourceVo
infoSourceVo
,
@Param
(
"ynBind"
)
Integer
ynBind
,
@Param
(
"groupId"
)
String
groupId
,
@Param
(
"offset"
)
int
offset
,
@Param
(
"pageSize"
)
Integer
pageSize
);
Integer
totalCountByGroupId
(
@Param
(
"infoSourceVo"
)
InfoSourceVo
infoSourceVo
,
@Param
(
"ynBind"
)
Integer
ynBind
,
@Param
(
"groupId"
)
String
groupId
);
List
<
InfoSourceMainGroupPage
>
bindInfoSourceMainGroupList
(
@Param
(
"subjectId"
)
String
subjectId
,
@Param
(
"types"
)
List
<
Integer
>
types
);
List
<
InfoSourceMain
>
bindInfoSourceMainList
(
@Param
(
"subjectId"
)
String
subjectId
,
@Param
(
"types"
)
List
<
Integer
>
types
);
List
<
InfoSourceMainGroupPage
>
bindInfoSourceMainLabelList
(
@Param
(
"subjectId"
)
String
subjectId
,
@Param
(
"types"
)
List
<
Integer
>
types
);
}
src/main/java/com/zzsn/event/mapper/InfoSourceMainMapper.java
0 → 100644
浏览文件 @
6ba8a2c5
package
com
.
zzsn
.
event
.
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.event.entity.InfoSourceMain
;
import
com.zzsn.event.vo.InfoSourceVo
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* <p>
* 信息源表 Mapper 接口
* </p>
*
* @author obcy
* @since 2025-06-19
*/
@Mapper
public
interface
InfoSourceMainMapper
extends
BaseMapper
<
InfoSourceMain
>
{
IPage
<
InfoSourceMain
>
subjectBindIdPageList
(
@Param
(
"page"
)
Page
<
InfoSourceMain
>
page
,
@Param
(
"infoSourceMain"
)
InfoSourceMain
infoSourceMain
,
@Param
(
"subjectId"
)
String
subjectId
);
List
<
InfoSourceMain
>
bindGroupSourceIdList
(
@Param
(
"subjectId"
)
String
subjectId
,
@Param
(
"sourceIds"
)
List
<
String
>
sourceIds
);
}
src/main/java/com/zzsn/event/mapper/xml/GroupMainTypeMapper.xml
0 → 100644
浏览文件 @
6ba8a2c5
<?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.GroupMainTypeMapper"
>
<select
id=
"sourceGroupPermissionQueryList"
resultType=
"com.zzsn.event.vo.InfoSourceMainGroupPage"
>
select d.id,d.group_name,d.group_code,gm.type_id from info_source_main_group d
LEFT JOIN group_main_type_map gm ON d.id= gm.group_id
<if
test=
"groupName!=null and groupName != ''"
>
and d.group_name like CONCAT('%',#{groupName},'%')
</if>
</select>
</mapper>
\ No newline at end of file
src/main/java/com/zzsn/event/mapper/xml/InfoSourceGroupMapper.xml
浏览文件 @
6ba8a2c5
...
...
@@ -66,4 +66,33 @@
) x
order by x.create_time desc
</select>
<select
id=
"infourceMainGroupAndTypeTree"
resultType=
"com.zzsn.event.vo.GroupTreeVO"
>
select x.*
from (
select s.id,
s.type_name as name,
s.pid,
'false' as ynGroup,
s.create_time
from group_main_type s
where s.status = 1
union
select n.id, n.name, m.id as pid, 'true' as ynGroup,n.create_time
from (
select s.id, s.type_name as name, s.pid
from group_main_type s
where s.status = 1
) m
inner join group_main_type_map stm on m.id = stm.type_id
inner join
(
select s.id,
s.group_name as name,
s.create_time
from info_source_main_group s
) n on stm.group_id = n.id
) x
order by x.create_time desc
</select>
</mapper>
src/main/java/com/zzsn/event/mapper/xml/InfoSourceMainGroupMapper.xml
0 → 100644
浏览文件 @
6ba8a2c5
<?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.InfoSourceMainGroupMapper"
>
<select
id=
"listByTypeId"
resultType=
"com.zzsn.event.vo.InfoSourceMainGroupPage"
>
SELECT a.* ,b.type_id groupTypeId FROM
info_source_main_group a
INNER JOIN group_main_type_map b ON a.id = b.group_id
WHERE b.type_id in
<foreach
collection=
"list"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
and a.status = #{status}
</select>
<select
id=
"countListByTypeAndIdList"
resultType=
"java.lang.Integer"
>
SELECT count(1) FROM info_source_main_group a
INNER JOIN group_main_type_map b ON a.id = b.group_id
WHERE b.type_id in
<foreach
item=
"typeId"
collection=
"finalIdList"
open=
"("
separator=
","
close=
")"
>
#{typeId}
</foreach>
and a.status = #{status}
</select>
<select
id=
"pageList"
resultType=
"com.zzsn.event.vo.InfoSourceMainGroupPage"
>
SELECT d.* , GROUP_CONCAT(b.type_id SEPARATOR ',') as typeIds, GROUP_CONCAT(a.type_name SEPARATOR ',') as groupTypeNames from
info_source_main_group d
LEFT JOIN group_main_type_map b ON b.group_id = d.id
LEFT JOIN group_main_type a ON b.type_id = a.id
where 1 = 1
<if
test=
"typeIds!=null and typeIds.size()>0"
>
and b.type_id in
<foreach
collection=
"typeIds"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
<if
test=
"infoSourceMainGroup.groupName!=null and infoSourceMainGroup.groupName != ''"
>
and d.group_name like CONCAT('%',#{infoSourceMainGroup.groupName},'%')
</if>
<if
test=
"infoSourceMainGroup.groupCode!=null and infoSourceMainGroup.groupCode != ''"
>
and d.groupCode like CONCAT('%',#{infoSourceMainGroup.groupCode},'%')
</if>
<if
test=
"infoSourceMainGroup.status!=null"
>
and d.status = #{infoSourceMainGroup.status}
</if>
group by d.id
order by d.create_time desc
limit #{offset}, #{pageSize}
</select>
<select
id=
"totalCount"
resultType=
"java.lang.Integer"
>
SELECT count(1) from
info_source_main_group d
LEFT JOIN group_main_type_map b ON b.group_id = d.id
where 1 = 1
<if
test=
"typeIds!=null and typeIds.size()>0"
>
and b.type_id in
<foreach
collection=
"typeIds"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
<if
test=
"infoSourceMainGroup.groupName!=null and infoSourceMainGroup.groupName != ''"
>
and d.group_name like CONCAT('%',#{infoSourceMainGroup.groupName},'%')
</if>
<if
test=
"infoSourceMainGroup.status!=null"
>
and d.status = #{infoSourceMainGroup.status}
</if>
</select>
<select
id=
"countList"
resultType=
"com.zzsn.event.vo.InfoSourceMainGroupPage"
>
SELECT group_id id, count(1) infoSourceNum from info_source_main_group_map b
inner join info_source_main a on b.source_id = a.id and a.del_flag = 0
where b.group_id in
<foreach
collection=
"groupIds"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
group by b.group_id
</select>
<select
id=
"selectGroupById"
resultType=
"com.zzsn.event.vo.InfoSourceMainGroupPage"
>
SELECT a.*, GROUP_CONCAT(b.type_id SEPARATOR ',') as groupTypeId FROM info_source_main_group a
LEFT JOIN group_main_type_map b ON a.id = b.group_id
WHERE a.id = #{groupId}
</select>
<select
id=
"selectInfoSourceByGroupIds"
resultType=
"java.lang.String"
>
SELECT DISTINCT source_id from info_source_main_group_map
where 1=1
<if
test=
"groupIds!=null and groupIds.size()>0"
>
and group_id in
<foreach
collection=
"groupIds"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
</select>
<select
id=
"bindListByGroupIds"
resultType=
"com.zzsn.event.vo.InfoSourceVo"
>
SELECT a.id,a.code,a.info_name,a.info_address,b.group_id,g.group_name
from info_source_main_group g
inner join info_source_main_group_map b on g.id = b.group_id
inner join info_source_main a on b.source_id = a.id
where 1=1 and a.del_flag = 0
<if
test=
"groupIds!=null and groupIds.size()>0"
>
and b.group_id in
<foreach
collection=
"groupIds"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
</select>
<select
id=
"listByTypeIdList"
resultType=
"com.zzsn.event.vo.InfoSourceMainGroupPage"
>
SELECT a.* ,b.type_id FROM
info_source_main_group a
INNER JOIN group_main_type_map b ON a.id = b.group_id
WHERE
a.status = #{status}
<if
test=
"groupTypeIdList!=null and groupTypeIdList.size()>0"
>
and b.type_id in
<foreach
collection=
"groupTypeIdList"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
and a.id not in (select source_id from subject_info_source_map where subject_id = #{subjectId} and type in (2,4))
<if
test=
"keywords !=null and keywords !='' "
>
and a.group_name like concat('%',#{keywords},'%')
</if>
</select>
<select
id=
"pageListByGroupId"
resultType=
"com.zzsn.event.vo.InfoSourceVo"
>
SELECT a.*,b.type_name as infoSourceTypeName ,b.id as infoSourceTypeId from info_source_main a
LEFT JOIN info_source_type b ON b.id = a.type
where 1 = 1
<if
test=
"ynBind == 0"
>
and a.id not in (SELECT distinct source_id FROM info_source_main_group_map WHERE group_id = #{groupId})
</if>
<if
test=
"ynBind == 1"
>
and a.id in (SELECT distinct source_id FROM info_source_main_group_map WHERE group_id = #{groupId})
</if>
<if
test=
"infoSourceVo.infoSourceTypeId!=null and infoSourceVo.infoSourceTypeId>0"
>
and b.id = #{infoSourceVo.infoSourceTypeId}
</if>
<if
test=
"infoSourceVo.infoName!=null and infoSourceVo.infoName != ''"
>
and a.info_name like CONCAT('%',#{infoSourceVo.infoName},'%')
</if>
<if
test=
"infoSourceVo.code!=null and infoSourceVo.code != ''"
>
and a.code like CONCAT('%',#{infoSourceVo.code},'%')
</if>
<if
test=
"infoSourceVo.infoAddress!=null and infoSourceVo.infoAddress != ''"
>
and a.info_address like CONCAT('%',#{infoSourceVo.infoAddress},'%')
</if>
<if
test=
"infoSourceVo.status!=null and infoSourceVo.status != ''"
>
and a.status = #{infoSourceVo.status}
</if>
and a.del_flag = 0
limit #{offset}, #{pageSize}
</select>
<select
id=
"totalCountByGroupId"
resultType=
"java.lang.Integer"
>
SELECT count(1) from info_source_main a
LEFT JOIN info_source_type b ON b.id = a.type
where 1 = 1
<if
test=
"ynBind == 0"
>
and a.id not in (SELECT distinct source_id FROM info_source_main_group_map WHERE group_id = #{groupId})
</if>
<if
test=
"ynBind == 1"
>
and a.id in (SELECT distinct source_id FROM info_source_main_group_map WHERE group_id = #{groupId})
</if>
<if
test=
"infoSourceVo.infoSourceTypeId!=null and infoSourceVo.infoSourceTypeId>0"
>
and b.id = #{infoSourceVo.infoSourceTypeId}
</if>
<if
test=
"infoSourceVo.infoName!=null and infoSourceVo.infoName != ''"
>
and a.info_name like CONCAT('%',#{infoSourceVo.infoName},'%')
</if>
<if
test=
"infoSourceVo.code!=null and infoSourceVo.code != ''"
>
and a.code like CONCAT('%',#{infoSourceVo.code},'%')
</if>
<if
test=
"infoSourceVo.infoAddress!=null and infoSourceVo.infoAddress != ''"
>
and a.info_address like CONCAT('%',#{infoSourceVo.infoAddress},'%')
</if>
<if
test=
"infoSourceVo.status!=null and infoSourceVo.status != ''"
>
and a.status = #{infoSourceVo.status}
</if>
and a.del_flag = 0
</select>
<select
id=
"bindInfoSourceMainGroupList"
resultType=
"com.zzsn.event.vo.InfoSourceMainGroupPage"
>
SELECT b.*, a.type as sourceType, d.type_name as groupTypeNames, a.weight as weight, a.id as subjectInfoSourceId ,a.is_exempt_keyword,a.is_free_check
FROM subject_info_source_map a
LEFT JOIN info_source_main_group b on a.source_id = b.id
LEFT JOIN group_main_type_map c on b.id = c.group_id
LEFT JOIN group_main_type d on d.id = c.type_id
where a.subject_id = #{subjectId}
<if
test=
"types != null and types.size() > 0"
>
and a.type in
<foreach
collection=
"types"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
</select>
<select
id=
"bindInfoSourceMainList"
resultType=
"com.zzsn.event.entity.InfoSourceMain"
>
SELECT b.*,a.type as sourceType, a.id as subjectInfoSourceId,a.is_exempt_keyword,a.is_free_check
FROM subject_info_source_map a
LEFT JOIN info_source_main b on a.source_id = b.id
WHERE a.subject_id = #{subjectId}
<if
test=
"types != null and types.size() > 0"
>
and a.type in
<foreach
collection=
"types"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
</select>
<select
id=
"bindInfoSourceMainLabelList"
resultType=
"com.zzsn.event.vo.InfoSourceMainGroupPage"
>
SELECT item.id, m.source_id label_code, label.label_name, label.business_caliber,label.dict_code, m.source_item_id label_item_code, item.label_item_name , m.type as sourceType, m.weight as weight, m.id as subjectInfoSourceId ,m.is_exempt_keyword,m.is_free_check
FROM subject_info_source_map m
left join clb_label_item item on m.source_item_id = item.label_item_code
left join clb_label label on m.source_id = label.label_code
where m.subject_id = #{subjectId}
<if
test=
"types != null and types.size() > 0"
>
and m.type in
<foreach
collection=
"types"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
</select>
</mapper>
\ No newline at end of file
src/main/java/com/zzsn/event/mapper/xml/InfoSourceMainMapper.xml
0 → 100644
浏览文件 @
6ba8a2c5
<?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.InfoSourceMainMapper"
>
<select
id=
"subjectBindIdPageList"
resultType=
"com.zzsn.event.entity.InfoSourceMain"
>
SELECT
a.*
FROM
info_source_main a
LEFT JOIN (
SELECT DISTINCT
bind.id
FROM
(
SELECT
im.id
FROM
subject_info_source_map sm
INNER JOIN info_source_main im ON im.id = sm.source_id
WHERE
sm.type IN ( 31, 36 )
AND sm.subject_id = #{subjectId} UNION
SELECT
im.id
FROM
subject_info_source_map sm
INNER JOIN info_source_main_group_map m ON m.group_id = sm.source_id
INNER JOIN info_source_main im ON im.id = m.source_id
WHERE
sm.type IN ( 32, 35 )
AND sm.subject_id = #{subjectId} UNION
SELECT
im.id
FROM
subject_info_source_map sm
INNER JOIN clb_label_main_source_map lam ON sm.source_id = lam.label_code
AND sm.source_item_id = lam.label_item_code
INNER JOIN info_source_main im ON lam.entity_code = im.id
WHERE
sm.type IN ( 312, 315 )
AND sm.subject_id = #{subjectId}
) bind
WHERE
1 = 1
AND bind.id NOT IN (
SELECT
im.id
FROM
subject_info_source_map sm
INNER JOIN info_source_main_group_map m ON m.group_id = sm.source_id
INNER JOIN info_source_main im ON im.id = m.source_id
WHERE
sm.type = 34
AND sm.subject_id = #{subjectId} UNION
SELECT
im.id
FROM
subject_info_source_map sm
INNER JOIN info_source_main im ON im.id = sm.source_id
WHERE
sm.type = 33
AND sm.subject_id = #{subjectId} UNION
SELECT
im.id
FROM
subject_info_source_map sm
INNER JOIN clb_label_main_source_map lam ON sm.source_id = lam.label_code
AND sm.source_item_id = lam.label_item_code
INNER JOIN info_source_main im ON lam.entity_code = im.id
WHERE
sm.type = 314
AND sm.subject_id = #{subjectId}
)
) b ON a.id = b.id
WHERE
b.id IS NOT NULL
<if
test=
"infoSourceMain.infoAddress!=null and infoSourceMain.infoAddress != ''"
>
and a.infoAddress like CONCAT('%',#{infoSourceMain.infoAddress},'%')
</if>
<if
test=
"infoSourceMain.infoName!=null and infoSourceMain.infoName != ''"
>
and a.infoName like CONCAT('%',#{infoSourceMain.infoName},'%')
</if>
<if
test=
"infoSourceMain.code!=null and infoSourceMain.code != ''"
>
and a.code like CONCAT('%',#{infoSourceMain.code},'%')
</if>
<if
test=
"infoSourceMain.type!=null"
>
and a.type = #{infoSourceMain.type}
</if>
</select>
<select
id=
"bindGroupSourceIdList"
resultType=
"com.zzsn.event.entity.InfoSourceMain"
>
SELECT
im.*,
bind.is_free_check,
bind.is_exempt_keyword,
bind.subjectInfoSourceType
FROM
info_source_main im
left join
(
SELECT
im.*,
sm.is_free_check,
sm.is_exempt_keyword,
sm.type AS subjectInfoSourceType
FROM
subject_info_source_map sm
INNER JOIN info_source_main im ON im.id = sm.source_id
WHERE
sm.type = 31
AND sm.subject_id = #{subjectId} UNION
SELECT
im.*,
sm.is_free_check,
sm.is_exempt_keyword,
sm.type AS subjectInfoSourceType
FROM
subject_info_source_map sm
INNER JOIN info_source_main_group_map m ON m.group_id = sm.source_id
INNER JOIN info_source_main im ON im.id = m.source_id
WHERE
sm.type = 32
AND sm.subject_id = #{subjectId}
) bind on im.id = bind.id
WHERE
1 = 1
<if
test=
"sourceIds != null and sourceIds.size() > 0"
>
and im.id in
<foreach
collection=
"sourceIds"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
</select>
</mapper>
\ No newline at end of file
src/main/java/com/zzsn/event/mapper/xml/InfoSourceMapper.xml
浏览文件 @
6ba8a2c5
...
...
@@ -138,6 +138,19 @@
</foreach>
</if>
union
select iso.id as source_id from
subject_info_source_map sim
INNER JOIN info_source_main_group_map m ON m.group_id = sim.source_id
INNER JOIN info_source_main im ON im.id = m.source_id
INNER JOIN info_source iso ON im.id = iso.info_source_id
where sim.type IN ( 32, 35 )
<if
test=
"subjectIds != null and subjectIds.size() > 0"
>
and sim.subject_id in
<foreach
collection=
"subjectIds"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
union
select sm.source_id from subject_info_source_map sm where sm.type in(1,6)
<if
test=
"subjectIds != null and subjectIds.size() > 0"
>
and sm.subject_id in
...
...
@@ -146,6 +159,19 @@
</foreach>
</if>
union
select iso.id as source_id FROM
subject_info_source_map sm
INNER JOIN info_source_main im ON im.id = sm.source_id
INNER JOIN info_source iso ON im.id = iso.info_source_id
WHERE
sm.type IN ( 31, 36 )
<if
test=
"subjectIds != null and subjectIds.size() > 0"
>
and sm.subject_id in
<foreach
collection=
"subjectIds"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
union
select m.entity_code as source_id from subject_info_source_map n
inner join clb_label_info_source_map m on n.source_id = m.label_code and n.source_item_id = m.label_item_code
where n.type in(12,15)
...
...
@@ -155,6 +181,22 @@
#{item}
</foreach>
</if>
union
select isoo.id as source_id
FROM
subject_info_source_map smm
INNER JOIN clb_label_main_source_map lam ON smm.source_id = lam.label_code
AND smm.source_item_id = lam.label_item_code
INNER JOIN info_source_main im ON lam.entity_code = im.id
INNER JOIN info_source isoo ON im.id = isoo.info_source_id
WHERE
smm.type IN ( 312, 315 )
<if
test=
"subjectIds != null and subjectIds.size() > 0"
>
and smm.subject_id in
<foreach
collection=
"subjectIds"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
) x) a LEFT JOIN
(select distinct x.source_id from (
select m.source_id from subject_info_source_map n
...
...
@@ -167,6 +209,22 @@
</foreach>
</if>
union
SELECT
iso.id as source_id
FROM
subject_info_source_map sim
INNER JOIN info_source_main_group_map m ON m.group_id = sim.source_id
INNER JOIN info_source_main im ON im.id = m.source_id
INNER JOIN info_source iso ON im.id = iso.info_source_id
WHERE
sim.type = 34
<if
test=
"subjectIds != null and subjectIds.size() > 0"
>
and sim.subject_id in
<foreach
collection=
"subjectIds"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
union
select sm.source_id from subject_info_source_map sm where sm.type = 3
<if
test=
"subjectIds != null and subjectIds.size() > 0"
>
and sm.subject_id in
...
...
@@ -175,6 +233,21 @@
</foreach>
</if>
union
SELECT
iso.id as source_id
FROM
subject_info_source_map sm
INNER JOIN info_source_main im ON im.id = sm.source_id
INNER JOIN info_source iso ON im.id = iso.info_source_id
WHERE
sm.type = 33
<if
test=
"subjectIds != null and subjectIds.size() > 0"
>
and sm.subject_id in
<foreach
collection=
"subjectIds"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
union
select m.entity_code as source_id from subject_info_source_map n
inner join clb_label_info_source_map m on n.source_id = m.label_code and n.source_item_id = m.label_item_code
where n.type = 14
...
...
@@ -184,6 +257,24 @@
#{item}
</foreach>
</if>
union
SELECT
isoo.id as source_id
FROM
subject_info_source_map smm
INNER JOIN clb_label_main_source_map lam ON smm.source_id = lam.label_code
AND smm.source_item_id = lam.label_item_code
INNER JOIN info_source_main im ON lam.entity_code = im.id
INNER JOIN info_source isoo ON im.id = isoo.info_source_id
WHERE
smm.type = 314
<if
test=
"subjectIds != null and subjectIds.size() > 0"
>
and smm.subject_id in
<foreach
collection=
"subjectIds"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
) x) b
on (a.source_id = b.source_id)
where b.source_id is null
...
...
@@ -293,6 +384,23 @@
</foreach>
</if>
union
SELECT
iso.id as source_id,
sm.is_exempt_keyword,
sm.is_free_check
FROM
subject_info_source_map sm
INNER JOIN info_source_main im ON im.id = sm.source_id
INNER JOIN info_source iso ON im.id = iso.info_source_id
WHERE
sm.type = 31
<if
test=
"subjectIds != null and subjectIds.size() > 0"
>
and sm.subject_id in
<foreach
collection=
"subjectIds"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
union
select m.source_id,n.is_exempt_keyword,n.is_free_check from subject_info_source_map n
inner join info_source_group_map m on n.source_id = m.group_id
where n.type = 2
...
...
@@ -302,6 +410,25 @@
#{item}
</foreach>
</if>
union
SELECT
iso.id as source_id,
sim.is_exempt_keyword,
sim.is_free_check
FROM
subject_info_source_map sim
INNER JOIN info_source_main_group_map m ON m.group_id = sim.source_id
INNER JOIN info_source_main im ON im.id = m.source_id
INNER JOIN info_source iso ON im.id = iso.info_source_id
WHERE
sim.type = 32
<if
test=
"subjectIds != null and subjectIds.size() > 0"
>
and sim.subject_id in
<foreach
collection=
"subjectIds"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
) bind on (iso.id = bind.source_id)
where bind.source_id is not null
<if
test=
"sourceIds != null and sourceIds.size() > 0"
>
...
...
src/main/java/com/zzsn/event/service/IGroupMainTypeMapService.java
0 → 100644
浏览文件 @
6ba8a2c5
package
com
.
zzsn
.
event
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.zzsn.event.entity.GroupMainTypeMap
;
/**
* @Description: 信息源组-类别关联表
* @Author: jeecg-boot
* @Date: 2021-11-25
* @Version: V1.0
*/
public
interface
IGroupMainTypeMapService
extends
IService
<
GroupMainTypeMap
>
{
}
src/main/java/com/zzsn/event/service/IGroupMainTypeService.java
0 → 100644
浏览文件 @
6ba8a2c5
package
com
.
zzsn
.
event
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.zzsn.event.constant.Result
;
import
com.zzsn.event.entity.GroupMainType
;
import
com.zzsn.event.vo.GroupMainTypeVo
;
import
java.util.List
;
/**
* @Description: 信息源组类别
* @Author: jeecg-boot
* @Date: 2021-11-25
* @Version: V1.0
*/
public
interface
IGroupMainTypeService
extends
IService
<
GroupMainType
>
{
List
<
GroupMainTypeVo
>
listByParentId
(
String
parentId
);
void
deleteGroupType
(
String
id
);
Result
<?>
addGroupType
(
GroupMainType
groupMainType
);
Result
<?>
updateGroupType
(
GroupMainType
groupMainType
);
void
deleteGroupTypeByIds
(
List
<
String
>
list
);
Result
<?>
getInfoGroupTypeTree
();
Result
<?>
sourceGroupPermissionQueryList
(
String
groupName
);
List
<
GroupMainTypeVo
>
allList
(
Boolean
contain
,
String
subjectId
,
String
keywords
);
}
src/main/java/com/zzsn/event/service/IInfoSourceMainGroupMapService.java
0 → 100644
浏览文件 @
6ba8a2c5
package
com
.
zzsn
.
event
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.zzsn.event.entity.InfoSourceMainGroupMap
;
/**
* @Description: 信息源组和信息源关联表
* @Author: jeecg-boot
* @Date: 2021-11-24
* @Version: V1.0
*/
public
interface
IInfoSourceMainGroupMapService
extends
IService
<
InfoSourceMainGroupMap
>
{
}
src/main/java/com/zzsn/event/service/InfoSourceGroupService.java
浏览文件 @
6ba8a2c5
...
...
@@ -43,10 +43,20 @@ public interface InfoSourceGroupService extends IService<InfoSourceGroup> {
List
<
InfoSourceGroupPage
>
bindInfoSourceList
(
String
subjectId
);
/**
* 信息源
组和
分类组成的树型结构
* 信息源
栏目组组和栏目组
分类组成的树型结构
*
* @author lkg
* @date 2024/12/23
*/
List
<
GroupTreeVO
>
GroupAndTypeTree
();
/**
* 新信息源组和分类组成的树型结构
*
* @author lkg
* @date 2024/12/23
*/
List
<
GroupTreeVO
>
infourceMainGroupAndTypeTree
();
}
src/main/java/com/zzsn/event/service/InfoSourceMainGroupService.java
0 → 100644
浏览文件 @
6ba8a2c5
package
com
.
zzsn
.
event
.
service
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.zzsn.event.entity.InfoSourceMain
;
import
com.zzsn.event.entity.InfoSourceMainGroup
;
import
com.zzsn.event.vo.InfoSourceGroupPage
;
import
com.zzsn.event.vo.InfoSourceMainGroupPage
;
import
com.zzsn.event.vo.InfoSourceVo
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* @Description: 信息源组表
* @Author: jeecg-boot
* @Date: 2021-11-25
* @Version: V1.0
*/
public
interface
InfoSourceMainGroupService
extends
IService
<
InfoSourceMainGroup
>
{
List
<
InfoSourceMainGroupPage
>
listByTypeId
(
List
<
String
>
list
,
int
status
);
Integer
countListByTypeAndIdList
(
List
<
String
>
oneInList
,
String
status
);
IPage
<
InfoSourceMainGroupPage
>
pageByTypeId
(
InfoSourceMainGroup
infoSourceMainGroup
,
Integer
pageNo
,
Integer
pageSize
,
String
groupTypeId
);
InfoSourceMainGroupPage
getGroupById
(
String
id
);
void
deleteMain
(
String
id
);
void
deleteMainByIds
(
List
<
String
>
list
);
List
<
InfoSourceVo
>
bindListByGroupIds
(
List
<
String
>
list
);
void
updateMain
(
InfoSourceMainGroup
infoSourceGroup
,
List
<
String
>
groupTypeIds
);
void
saveMain
(
InfoSourceMainGroup
infoSourceGroup
,
List
<
String
>
groupTypeIds
);
List
<
InfoSourceMainGroupPage
>
listByTypeIdList
(
List
<
String
>
groupTypeIdList
,
String
subjectId
,
int
status
,
String
keywords
);
IPage
<
InfoSourceVo
>
pageListByGroupId
(
InfoSourceVo
infoSourceVo
,
Integer
ynBind
,
String
groupId
,
Integer
pageNo
,
Integer
pageSize
);
String
bind
(
String
groupId
,
List
<
String
>
infoSourceIds
);
void
unBind
(
String
groupId
,
List
<
String
>
infoSourceIds
);
IPage
<
InfoSourceMain
>
infosourceMainList
(
InfoSourceMain
infoSourceVo
,
Integer
pageNo
,
Integer
pageSize
);
List
<
InfoSourceMainGroupPage
>
bindInfoSourceMainGroupList
(
String
subjectId
,
List
<
Integer
>
typeIds
);
List
<
InfoSourceMain
>
bindInfoSourceMainList
(
String
subjectId
,
List
<
Integer
>
typeIds
);
List
<
InfoSourceMainGroupPage
>
bindInfoSourceMainLabelList
(
String
subjectId
,
List
<
Integer
>
infoSourceMainLabelType
);
}
src/main/java/com/zzsn/event/service/InfoSourceMainService.java
0 → 100644
浏览文件 @
6ba8a2c5
package
com
.
zzsn
.
event
.
service
;
import
com.alibaba.fastjson2.JSONObject
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.zzsn.event.entity.InfoSourceMain
;
/**
* <p>
* 信息源表 服务类
* </p>
*
* @author obcy
* @since 2025-06-19
*/
public
interface
InfoSourceMainService
extends
IService
<
InfoSourceMain
>
{
IPage
<
InfoSourceMain
>
subjectBindList
(
InfoSourceMain
infoSourceMain
,
String
subjectId
,
Integer
pageNo
,
Integer
pageSize
);
JSONObject
bindInfoSourceMainGroupList
(
String
id
);
JSONObject
bindInfoSourceMainList
(
String
id
);
JSONObject
bindInfoSourceMainLabelList
(
String
id
);
}
src/main/java/com/zzsn/event/service/impl/GroupMainTypeMapServiceImpl.java
0 → 100644
浏览文件 @
6ba8a2c5
package
com
.
zzsn
.
event
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.zzsn.event.entity.GroupMainTypeMap
;
import
com.zzsn.event.mapper.GroupMainTypeMapMapper
;
import
com.zzsn.event.service.IGroupMainTypeMapService
;
import
org.springframework.stereotype.Service
;
/**
* @Description: 信息源组-类别关联表
* @Author: jeecg-boot
* @Date: 2021-11-25
* @Version: V1.0
*/
@Service
public
class
GroupMainTypeMapServiceImpl
extends
ServiceImpl
<
GroupMainTypeMapMapper
,
GroupMainTypeMap
>
implements
IGroupMainTypeMapService
{
}
src/main/java/com/zzsn/event/service/impl/GroupMainTypeServiceImpl.java
0 → 100644
浏览文件 @
6ba8a2c5
package
com
.
zzsn
.
event
.
service
.
impl
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.lang.tree.Tree
;
import
cn.hutool.core.lang.tree.TreeNode
;
import
cn.hutool.core.lang.tree.TreeUtil
;
import
cn.hutool.core.util.StrUtil
;
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.constant.Result
;
import
com.zzsn.event.constant.TreeNodeInfo
;
import
com.zzsn.event.entity.GroupMainType
;
import
com.zzsn.event.entity.InfoSourceMainGroup
;
import
com.zzsn.event.mapper.GroupMainTypeMapper
;
import
com.zzsn.event.service.IGroupMainTypeService
;
import
com.zzsn.event.service.InfoSourceMainGroupService
;
import
com.zzsn.event.vo.GroupMainTypeVo
;
import
com.zzsn.event.vo.InfoSourceGroupPage
;
import
com.zzsn.event.vo.InfoSourceMainGroupPage
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.StringUtils
;
import
javax.validation.constraints.NotNull
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
* @Description: 信息源组类别
* @Author: jeecg-boot
* @Date: 2021-11-25
* @Version: V1.0
*/
@Service
public
class
GroupMainTypeServiceImpl
extends
ServiceImpl
<
GroupMainTypeMapper
,
GroupMainType
>
implements
IGroupMainTypeService
{
@Autowired
private
InfoSourceMainGroupService
iInfoSourceMainGroupService
;
@Override
public
List
<
GroupMainTypeVo
>
listByParentId
(
String
parentId
)
{
if
(!
parentId
.
equals
(
"0"
))
{
GroupMainType
parent
=
this
.
getById
(
parentId
);
if
(
null
==
parent
)
{
throw
new
RuntimeException
(
"参数parentId不存在"
);
}
if
(
StringUtils
.
isEmpty
(
parent
.
getHasChild
())
||
"0"
.
equals
(
parent
.
getHasChild
()))
{
List
<
GroupMainTypeVo
>
finalList
=
new
ArrayList
<>();
//查询当前节点下的所有信息源组
List
<
InfoSourceMainGroupPage
>
pageList
=
iInfoSourceMainGroupService
.
listByTypeId
(
Arrays
.
asList
(
parentId
),
1
);
if
(
pageList
!=
null
&&
pageList
.
size
()
>
0
)
{
for
(
InfoSourceMainGroupPage
infoSourceGroupPage
:
pageList
)
{
GroupMainTypeVo
groupTypeVo2
=
new
GroupMainTypeVo
();
groupTypeVo2
.
setId
(
infoSourceGroupPage
.
getId
());
groupTypeVo2
.
setHasChild
(
null
);
groupTypeVo2
.
setTypeName
(
infoSourceGroupPage
.
getGroupName
());
groupTypeVo2
.
setPid
(
parentId
);
groupTypeVo2
.
setIsGroup
(
true
);
finalList
.
add
(
groupTypeVo2
);
}
}
return
finalList
;
}
}
GroupMainTypeVo
groupTypeVo
=
new
GroupMainTypeVo
();
groupTypeVo
.
setId
(
"0"
);
groupTypeVo
.
setTypeName
(
"所有"
);
groupTypeVo
.
setPid
(
"0"
);
groupTypeVo
.
setHasChild
(
"1"
);
List
<
GroupMainTypeVo
>
list
=
super
.
list
().
stream
().
map
(
e
->
{
GroupMainTypeVo
groupTypeVo1
=
new
GroupMainTypeVo
();
BeanUtils
.
copyProperties
(
e
,
groupTypeVo1
);
return
groupTypeVo1
;
}).
collect
(
Collectors
.
toList
());
Map
<
String
,
List
<
GroupMainTypeVo
>>
pidMap
=
list
.
stream
().
collect
(
Collectors
.
groupingBy
(
GroupMainTypeVo:
:
getPid
));
// List<GroupMainType> firstGroup = list.stream().filter(item -> item.getPid().equals(parentId)).collect(Collectors.toList());
List
<
GroupMainTypeVo
>
firstGroup
=
list
.
stream
().
filter
(
item
->
item
.
getPid
().
equals
(
parentId
)).
map
(
e
->
{
GroupMainTypeVo
groupTypeVo1
=
new
GroupMainTypeVo
();
BeanUtils
.
copyProperties
(
e
,
groupTypeVo1
);
return
groupTypeVo1
;
}).
collect
(
Collectors
.
toList
());
for
(
GroupMainTypeVo
typeVo
:
firstGroup
)
{
if
(
StringUtils
.
isEmpty
(
typeVo
.
getHasChild
())
||
"0"
.
equals
(
typeVo
.
getHasChild
()))
{
List
<
String
>
oneInList
=
new
ArrayList
<>();
oneInList
.
add
(
typeVo
.
getId
());
//tips 当数据量大 最好不用列表
Integer
count
=
iInfoSourceMainGroupService
.
countListByTypeAndIdList
(
oneInList
,
"1"
);
typeVo
.
setChildrenCount
(
count
);
}
else
{
//获取每个下面最后一级分类列表
List
<
GroupMainTypeVo
>
singleList
=
new
ArrayList
<>(
1
);
singleList
.
add
(
typeVo
);
List
<
GroupMainTypeVo
>
finalGradeList
=
new
ArrayList
<>();
getFinalIdListInMap
(
singleList
,
pidMap
,
finalGradeList
);
List
<
String
>
finalIdList
=
finalGradeList
.
stream
().
map
(
GroupMainTypeVo:
:
getId
).
collect
(
Collectors
.
toList
());
if
(!
finalIdList
.
isEmpty
())
{
Integer
count
=
iInfoSourceMainGroupService
.
countListByTypeAndIdList
(
finalIdList
,
"1"
);
typeVo
.
setChildrenCount
(
count
);
}
else
{
typeVo
.
setChildrenCount
(
0
);
}
}
}
return
firstGroup
;
}
@Override
public
void
deleteGroupType
(
String
id
)
{
GroupMainType
byId
=
super
.
getById
(
id
);
String
pid
=
byId
.
getPid
();
super
.
remove
(
Wrappers
.<
GroupMainType
>
lambdaQuery
().
like
(
GroupMainType:
:
getPathIds
,
id
));
/**处理之前父节点的hasChild字段*/
updateOldParentNode
(
pid
);
}
@Override
public
Result
<?>
addGroupType
(
GroupMainType
groupMainType
)
{
List
<
GroupMainType
>
list
=
super
.
list
(
Wrappers
.<
GroupMainType
>
lambdaQuery
()
.
and
(
e
->
e
.
eq
(
GroupMainType:
:
getTypeName
,
groupMainType
.
getTypeName
()))
);
if
(
CollectionUtil
.
isNotEmpty
(
list
)){
return
Result
.
FAIL
(
"节点名称已存在"
);
}
if
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isBlank
(
groupMainType
.
getPid
())){
groupMainType
.
setPid
(
TreeNodeInfo
.
ROOT_PID_VALUE
);
}
else
{
GroupMainType
parent
=
super
.
getById
(
groupMainType
.
getPid
());
if
(
parent
!=
null
&&
!
TreeNodeInfo
.
HAS_CHILD
.
equals
(
parent
.
getHasChild
())){
parent
.
setHasChild
(
TreeNodeInfo
.
HAS_CHILD
);
super
.
updateById
(
parent
);
}
}
groupMainType
.
setHasChild
(
TreeNodeInfo
.
NO_CHILD
);
groupMainType
.
setCreateTime
(
new
Date
());
super
.
save
(
groupMainType
);
if
(
TreeNodeInfo
.
ROOT_PID_VALUE
.
equals
(
groupMainType
.
getPid
())){
groupMainType
.
setPathIds
(
groupMainType
.
getId
());
}
else
{
GroupMainType
parent
=
super
.
getById
(
groupMainType
.
getPid
());
groupMainType
.
setPathIds
(
parent
.
getPathIds
()
+
","
+
groupMainType
.
getId
());
}
super
.
updateById
(
groupMainType
);
return
Result
.
OK
(
groupMainType
);
}
@Override
public
Result
<?>
updateGroupType
(
GroupMainType
groupMainType
)
{
GroupMainType
byId
=
super
.
getById
(
groupMainType
.
getId
());
if
(
ObjectUtils
.
isEmpty
(
byId
)){
return
Result
.
FAIL
(
"未找到对应的节点"
);
}
String
oldPid
=
byId
.
getPid
();
String
newPid
=
groupMainType
.
getPid
();
if
(!
oldPid
.
equals
(
newPid
))
{
/**不允许移动到子节点下*/
if
(
TreeNodeInfo
.
HAS_CHILD
.
equals
(
byId
.
getHasChild
())){
List
<
GroupMainType
>
childIds
=
super
.
list
(
Wrappers
.<
GroupMainType
>
lambdaQuery
().
like
(
GroupMainType:
:
getPathIds
,
byId
.
getId
()).
select
(
GroupMainType:
:
getId
));
if
(
CollectionUtil
.
isNotEmpty
(
childIds
)){
List
<
String
>
collect
=
childIds
.
stream
().
map
(
GroupMainType:
:
getId
).
collect
(
Collectors
.
toList
());
if
(
collect
.
contains
(
newPid
))
{
return
Result
.
FAIL
(
"不允许移动到子节点下"
);
}
}
}
/**处理之前父节点的hasChild字段*/
updateOldParentNode
(
oldPid
);
if
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isBlank
(
newPid
)
||
TreeNodeInfo
.
ROOT_PID_VALUE
.
equals
(
newPid
)){
groupMainType
.
setPid
(
TreeNodeInfo
.
ROOT_PID_VALUE
);
newPid
=
groupMainType
.
getPid
();
}
/**处理新的父节点的hasChild字段*/
if
(!
TreeNodeInfo
.
ROOT_PID_VALUE
.
equals
(
newPid
))
{
super
.
update
(
Wrappers
.<
GroupMainType
>
lambdaUpdate
().
set
(
GroupMainType:
:
getHasChild
,
TreeNodeInfo
.
HAS_CHILD
).
eq
(
GroupMainType:
:
getId
,
newPid
));
}
groupMainType
.
setUpdateTime
(
new
Date
());
super
.
updateById
(
groupMainType
);
/**处理本节点的所有子节点的绝对路径*/
List
<
GroupMainType
>
list
=
super
.
list
(
Wrappers
.<
GroupMainType
>
lambdaQuery
().
like
(
GroupMainType:
:
getPathIds
,
groupMainType
.
getId
()));
if
(
CollectionUtil
.
isNotEmpty
(
list
)){
String
finalNewPid
=
newPid
;
if
(!
TreeNodeInfo
.
ROOT_PID_VALUE
.
equals
(
finalNewPid
))
{
/**非根节点 移动到其他非根节点*/
GroupMainType
projectPid
=
super
.
getById
(
finalNewPid
);
if
(!
TreeNodeInfo
.
ROOT_PID_VALUE
.
equals
(
oldPid
))
{
String
id
=
groupMainType
.
getId
();
String
fullPath
=
groupMainType
.
getPathIds
();
String
replace
=
fullPath
.
replace
(
id
,
""
);
list
.
forEach
(
e
->{
String
path
=
projectPid
.
getPathIds
()+
","
+
e
.
getPathIds
().
replace
(
replace
,
""
);
e
.
setPathIds
(
path
);
});
}
else
{
/**根节点 移动到其他非根节点*/
list
.
forEach
(
e
->{
String
path
=
projectPid
.
getPathIds
()+
","
+
e
.
getPathIds
();
e
.
setPathIds
(
path
);
});
}
}
else
{
String
id
=
groupMainType
.
getId
();
String
fullPath
=
groupMainType
.
getPathIds
();
String
replace
=
fullPath
.
replace
(
id
,
""
);
/**移动到根节点*/
list
.
forEach
(
e
->{
String
path
=
e
.
getPathIds
().
replace
(
replace
,
""
);
e
.
setPathIds
(
path
);
});
}
super
.
updateBatchById
(
list
);
}
}
else
{
groupMainType
.
setUpdateTime
(
new
Date
());
super
.
updateById
(
groupMainType
);
}
return
Result
.
OK
(
groupMainType
);
}
@Override
public
void
deleteGroupTypeByIds
(
List
<
String
>
list
)
{
LambdaQueryWrapper
<
GroupMainType
>
queryWrapper
=
Wrappers
.<
GroupMainType
>
lambdaQuery
();
for
(
String
s
:
list
)
{
queryWrapper
.
or
(
e
->
e
.
like
(
GroupMainType:
:
getPathIds
,
s
));
}
super
.
remove
(
queryWrapper
);
}
@Override
public
Result
<?>
getInfoGroupTypeTree
()
{
List
<
GroupMainType
>
list
=
super
.
list
();
List
<
TreeNode
<
String
>>
nodeList
=
getTreeNodes
(
list
);
List
<
Tree
<
String
>>
treeList
=
TreeUtil
.
build
(
nodeList
,
"0"
);
return
Result
.
OK
(
treeList
);
}
@Override
public
Result
<?>
sourceGroupPermissionQueryList
(
String
groupName
)
{
List
<
InfoSourceMainGroupPage
>
list
=
baseMapper
.
sourceGroupPermissionQueryList
(
groupName
);
if
(
CollectionUtil
.
isEmpty
(
list
)){
return
Result
.
OK
();
}
else
{
Map
<
String
,
List
<
InfoSourceMainGroupPage
>>
collect
=
list
.
stream
().
filter
(
f
->
StrUtil
.
isNotBlank
(
f
.
getTypeId
())).
collect
(
Collectors
.
groupingBy
(
InfoSourceMainGroupPage:
:
getTypeId
));
return
Result
.
OK
(
collect
);
}
}
@Override
public
List
<
GroupMainTypeVo
>
allList
(
Boolean
contain
,
String
subjectId
,
String
keywords
)
{
List
<
GroupMainTypeVo
>
allList
=
new
ArrayList
<>();
GroupMainTypeVo
groupTypeVo
=
new
GroupMainTypeVo
();
groupTypeVo
.
setId
(
"0"
);
groupTypeVo
.
setTypeName
(
"所有"
);
groupTypeVo
.
setPid
(
"0"
);
groupTypeVo
.
setHasChild
(
"1"
);
List
<
GroupMainTypeVo
>
list
=
super
.
list
().
stream
().
map
(
e
->
{
GroupMainTypeVo
groupTypeVo1
=
new
GroupMainTypeVo
();
BeanUtils
.
copyProperties
(
e
,
groupTypeVo1
);
return
groupTypeVo1
;
}).
collect
(
Collectors
.
toList
());
List
<
String
>
collect
=
list
.
stream
().
map
(
GroupMainTypeVo:
:
getId
).
collect
(
Collectors
.
toList
());
//若contain=true 则把与各个类别绑定的信息源组当成类别的子节点,并且只展示状态为启动的
List
<
InfoSourceMainGroupPage
>
infoSourceGroupPageList
=
iInfoSourceMainGroupService
.
listByTypeIdList
(
collect
,
subjectId
,
1
,
keywords
);
if
(
null
!=
keywords
){
if
(
infoSourceGroupPageList
.
isEmpty
()){
return
Collections
.
EMPTY_LIST
;
}
return
infoSourceGroupPageList
.
stream
().
map
(
item
->
GroupMainTypeVo
.
builder
()
.
id
(
item
.
getId
())
.
typeName
(
item
.
getGroupName
())
.
build
()).
collect
(
Collectors
.
toList
());
}
if
(
contain
)
{
Map
<
String
,
List
<
InfoSourceMainGroupPage
>>
map
=
infoSourceGroupPageList
.
stream
().
collect
(
Collectors
.
groupingBy
(
InfoSourceMainGroupPage:
:
getTypeId
));
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++)
{
GroupMainTypeVo
groupTypeVo1
=
list
.
get
(
i
);
if
(
StringUtils
.
isEmpty
(
groupTypeVo1
.
getHasChild
()))
{
List
<
InfoSourceMainGroupPage
>
pageList
=
map
.
get
(
groupTypeVo1
.
getId
());
if
(
pageList
!=
null
&&
pageList
.
size
()
>
0
)
{
for
(
InfoSourceMainGroupPage
infoSourceGroupPage
:
pageList
)
{
GroupMainTypeVo
groupTypeVo2
=
new
GroupMainTypeVo
();
groupTypeVo2
.
setId
(
infoSourceGroupPage
.
getId
());
groupTypeVo2
.
setHasChild
(
null
);
groupTypeVo2
.
setTypeName
(
infoSourceGroupPage
.
getGroupName
());
groupTypeVo2
.
setPid
(
groupTypeVo1
.
getId
());
groupTypeVo2
.
setIsGroup
(
true
);
list
.
add
(
groupTypeVo2
);
}
}
}
}
}
List
<
GroupMainTypeVo
>
typeList
=
getTreeList
(
list
);
groupTypeVo
.
setChildren
(
typeList
);
allList
.
add
(
groupTypeVo
);
return
allList
;
}
//获取授权用户业务分类信息,树状结构
private
List
<
GroupMainTypeVo
>
getTreeList
(
List
<
GroupMainTypeVo
>
authTypeList
)
{
List
<
GroupMainTypeVo
>
topList
=
new
ArrayList
<>();
authTypeList
.
forEach
(
e
->
{
if
(
"0"
.
equals
(
e
.
getPid
()))
{
topList
.
add
(
e
);
}
});
for
(
GroupMainTypeVo
groupTypeVo
:
topList
)
{
setChildren
(
groupTypeVo
,
authTypeList
);
}
return
topList
;
}
//递归获取树形结构数据
private
void
setChildren
(
GroupMainTypeVo
parent
,
List
<
GroupMainTypeVo
>
list
)
{
Set
<
GroupMainTypeVo
>
children
=
getChildren
(
list
,
parent
.
getId
());
parent
.
setChildren
(
new
ArrayList
<>(
children
));
for
(
GroupMainTypeVo
groupTypeVo
:
children
)
{
setChildren
(
groupTypeVo
,
list
);
}
}
private
Set
<
GroupMainTypeVo
>
getChildren
(
List
<
GroupMainTypeVo
>
list
,
String
id
)
{
Set
<
GroupMainTypeVo
>
children
=
new
HashSet
<>();
for
(
GroupMainTypeVo
infoSourceTypeVo
:
list
)
{
if
(
infoSourceTypeVo
.
getPid
().
equals
(
id
))
{
children
.
add
(
infoSourceTypeVo
);
}
}
return
children
;
}
@NotNull
private
List
<
TreeNode
<
String
>>
getTreeNodes
(
List
<
GroupMainType
>
list
)
{
List
<
TreeNode
<
String
>>
nodeList
=
new
ArrayList
<>();
list
.
forEach
(
e
->
{
TreeNode
<
String
>
treeNode
=
new
TreeNode
<>();
treeNode
.
setExtra
(
BeanUtil
.
beanToMap
(
e
,
false
,
true
));
treeNode
.
setId
(
e
.
getId
());
treeNode
.
setName
(
e
.
getTypeName
());
treeNode
.
setParentId
(
e
.
getPid
());
nodeList
.
add
(
treeNode
);
});
return
nodeList
;
}
/**
* 根据所传pid查询旧的父级节点的子节点并修改相应状态值
* @param pid
*/
private
void
updateOldParentNode
(
String
pid
)
{
if
(!
TreeNodeInfo
.
ROOT_PID_VALUE
.
equals
(
pid
))
{
Integer
count
=
baseMapper
.
selectCount
(
Wrappers
.<
GroupMainType
>
lambdaQuery
().
eq
(
GroupMainType:
:
getPid
,
pid
));
if
(
count
==
null
||
count
<=
1
)
{
super
.
update
(
Wrappers
.<
GroupMainType
>
lambdaUpdate
().
set
(
GroupMainType:
:
getHasChild
,
TreeNodeInfo
.
NO_CHILD
).
eq
(
GroupMainType:
:
getId
,
pid
));
}
}
}
private
void
getFinalIdListInMap
(
List
<
GroupMainTypeVo
>
groupTypeVoList
,
Map
<
String
,
List
<
GroupMainTypeVo
>>
pidMap
,
List
<
GroupMainTypeVo
>
finalGroupTypeVoList
)
{
List
<
GroupMainTypeVo
>
nextGradeNotFinalList
=
new
ArrayList
<>();
for
(
GroupMainTypeVo
subjectTypeVo
:
groupTypeVoList
)
{
List
<
GroupMainTypeVo
>
tempList
=
pidMap
.
get
(
subjectTypeVo
.
getId
());
if
(
tempList
!=
null
)
{
List
<
GroupMainTypeVo
>
finalList
=
tempList
.
stream
()
.
filter
(
item
->
null
==
item
.
getHasChild
()
&&
StringUtils
.
isEmpty
(
item
.
getHasChild
())
||
"0"
.
equals
(
item
.
getHasChild
()))
.
collect
(
Collectors
.
toList
());
finalGroupTypeVoList
.
addAll
(
finalList
);
tempList
.
removeAll
(
finalList
);
nextGradeNotFinalList
.
addAll
(
tempList
);
}
}
if
(
nextGradeNotFinalList
.
isEmpty
())
{
return
;
}
getFinalIdListInMap
(
nextGradeNotFinalList
,
pidMap
,
finalGroupTypeVoList
);
}
}
src/main/java/com/zzsn/event/service/impl/InfoSourceGroupMainServiceImpl.java
0 → 100644
浏览文件 @
6ba8a2c5
package
com
.
zzsn
.
event
.
service
.
impl
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.zzsn.event.entity.*
;
import
com.zzsn.event.enums.BindTypeEnum
;
import
com.zzsn.event.enums.CodePrefixEnum
;
import
com.zzsn.event.mapper.InfoSourceMainGroupMapper
;
import
com.zzsn.event.service.*
;
import
com.zzsn.event.util.CodeGenerateUtil
;
import
com.zzsn.event.vo.InfoSourceGroupPage
;
import
com.zzsn.event.vo.InfoSourceMainGroupPage
;
import
com.zzsn.event.vo.InfoSourceVo
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.StringUtils
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
* @Description: 信息源组表
* @Author: jeecg-boot
* @Date: 2021-11-25
* @Version: V1.0
*/
@Service
public
class
InfoSourceGroupMainServiceImpl
extends
ServiceImpl
<
InfoSourceMainGroupMapper
,
InfoSourceMainGroup
>
implements
InfoSourceMainGroupService
{
@Autowired
@Lazy
private
IGroupMainTypeService
groupMainTypeService
;
@Autowired
private
IGroupMainTypeMapService
groupMainTypeMapService
;
@Autowired
private
IInfoSourceMainGroupMapService
infoSourceMainGroupMapService
;
@Autowired
private
ISubjectInfoSourceMapService
iSubjectInfoSourceMapService
;
@Autowired
private
InfoSourceMainService
infoSourceMainService
;
@Autowired
private
CodeGenerateUtil
codeGenerateUtil
;
@Override
public
List
<
InfoSourceMainGroupPage
>
listByTypeId
(
List
<
String
>
list
,
int
status
)
{
return
baseMapper
.
listByTypeId
(
list
,
status
);
}
@Override
public
Integer
countListByTypeAndIdList
(
List
<
String
>
oneInList
,
String
status
)
{
return
baseMapper
.
countListByTypeAndIdList
(
oneInList
,
status
);
}
@Override
public
IPage
<
InfoSourceMainGroupPage
>
pageByTypeId
(
InfoSourceMainGroup
infoSourceMainGroup
,
Integer
pageNo
,
Integer
pageSize
,
String
groupTypeId
)
{
int
offset
=
(
pageNo
-
1
)
*
pageSize
;
//查询类别id的所有明细id
List
<
String
>
typeIds
=
new
ArrayList
<>();
if
(!
StringUtils
.
isEmpty
(
groupTypeId
)
&&
!
"0"
.
equals
(
groupTypeId
))
{
//查询分类id的所有的叶子节点id
List
<
GroupMainType
>
list
=
groupMainTypeService
.
list
(
Wrappers
.<
GroupMainType
>
lambdaQuery
().
like
(
GroupMainType:
:
getPathIds
,
groupTypeId
)
.
and
(
e
->
e
.
isNull
(
GroupMainType:
:
getHasChild
).
or
().
eq
(
GroupMainType:
:
getHasChild
,
"0"
)));
typeIds
=
list
.
stream
().
map
(
GroupMainType:
:
getId
).
collect
(
Collectors
.
toList
());
}
//查询列表
List
<
InfoSourceMainGroupPage
>
pageList
=
baseMapper
.
pageList
(
infoSourceMainGroup
,
typeIds
,
offset
,
pageSize
);
if
(
CollectionUtil
.
isEmpty
(
pageList
))
{
return
new
Page
<>(
pageNo
,
pageSize
,
0
);
}
List
<
String
>
idList
=
pageList
.
stream
().
map
(
InfoSourceMainGroupPage:
:
getId
).
collect
(
Collectors
.
toList
());
List
<
InfoSourceMainGroupPage
>
numberList
=
baseMapper
.
countList
(
idList
);
Map
<
String
,
InfoSourceMainGroupPage
>
countMap
=
numberList
.
stream
().
collect
(
Collectors
.
toMap
(
InfoSourceMainGroupPage:
:
getId
,
item
->
item
));
for
(
InfoSourceMainGroupPage
infoSourceGroupPage
:
pageList
)
{
InfoSourceMainGroupPage
infoSourceGroupPageCount
=
countMap
.
get
(
infoSourceGroupPage
.
getId
());
if
(
null
!=
infoSourceGroupPageCount
)
{
infoSourceGroupPage
.
setInfoSourceNum
(
infoSourceGroupPageCount
.
getInfoSourceNum
());
}
if
(!
StringUtils
.
isEmpty
(
infoSourceGroupPage
.
getTypeIds
()))
{
infoSourceGroupPage
.
setGroupTypeIds
(
Arrays
.
asList
(
infoSourceGroupPage
.
getTypeIds
().
split
(
","
)));
}
}
//获取总条数
Integer
count
=
baseMapper
.
totalCount
(
infoSourceMainGroup
,
typeIds
);
IPage
<
InfoSourceMainGroupPage
>
pageData
=
new
Page
<>(
pageNo
,
pageSize
,
count
);
pageData
.
setRecords
(
pageList
);
return
pageData
;
}
@Override
public
InfoSourceMainGroupPage
getGroupById
(
String
id
)
{
InfoSourceMainGroupPage
infoSourceMainGroupPage
=
baseMapper
.
selectGroupById
(
id
);
List
<
InfoSourceMainGroupPage
>
numberList
=
baseMapper
.
countList
(
Arrays
.
asList
(
id
));
if
(
CollectionUtil
.
isNotEmpty
(
numberList
))
{
infoSourceMainGroupPage
.
setInfoSourceNum
(
numberList
.
get
(
0
).
getInfoSourceNum
());
}
return
infoSourceMainGroupPage
;
}
@Override
public
void
deleteMain
(
String
groupId
)
{
super
.
removeById
(
groupId
);
//删除与类别的映射
groupMainTypeMapService
.
remove
(
Wrappers
.<
GroupMainTypeMap
>
lambdaQuery
().
eq
(
GroupMainTypeMap:
:
getGroupId
,
groupId
));
//删除信息源组与专题的绑定关系
List
<
String
>
infoSourceGroupIds
=
new
ArrayList
<>();
infoSourceGroupIds
.
add
(
groupId
);
iSubjectInfoSourceMapService
.
deleteInfoSourceIds
(
null
,
infoSourceGroupIds
,
BindTypeEnum
.
INFO_MAIN_SOURCE_GROUP
.
getvalue
());
//删除信息源与专题的绑定关系
List
<
String
>
idsList
=
baseMapper
.
selectInfoSourceByGroupIds
(
infoSourceGroupIds
);
if
(
idsList
!=
null
&&
idsList
.
size
()
>
0
)
{
iSubjectInfoSourceMapService
.
deleteInfoSourceIds
(
null
,
idsList
,
BindTypeEnum
.
INFO_MAIN_SOURCE
.
getvalue
());
}
//删除信息源组与信息源的绑定关系
infoSourceMainGroupMapService
.
remove
(
Wrappers
.<
InfoSourceMainGroupMap
>
lambdaQuery
().
eq
(
InfoSourceMainGroupMap:
:
getGroupId
,
groupId
));
}
@Override
public
void
deleteMainByIds
(
List
<
String
>
list
)
{
super
.
removeByIds
(
list
);
//删除与类别的映射
groupMainTypeMapService
.
remove
(
Wrappers
.<
GroupMainTypeMap
>
lambdaQuery
().
in
(
GroupMainTypeMap:
:
getGroupId
,
list
));
//删除信息源组与专题的绑定关系
List
<
String
>
infoSourceGroupIds
=
new
ArrayList
<>();
infoSourceGroupIds
.
addAll
(
list
);
iSubjectInfoSourceMapService
.
deleteInfoSourceIds
(
null
,
infoSourceGroupIds
,
BindTypeEnum
.
INFO_MAIN_SOURCE_GROUP
.
getvalue
());
//删除信息源与专题的绑定关系
List
<
String
>
idsList
=
baseMapper
.
selectInfoSourceByGroupIds
(
infoSourceGroupIds
);
if
(
idsList
!=
null
&&
idsList
.
size
()
>
0
)
{
iSubjectInfoSourceMapService
.
deleteInfoSourceIds
(
null
,
idsList
,
BindTypeEnum
.
INFO_MAIN_SOURCE
.
getvalue
());
}
//删除信息源组与信息源的绑定关系
infoSourceMainGroupMapService
.
remove
(
Wrappers
.<
InfoSourceMainGroupMap
>
lambdaQuery
().
in
(
InfoSourceMainGroupMap:
:
getGroupId
,
list
));
}
@Override
public
List
<
InfoSourceVo
>
bindListByGroupIds
(
List
<
String
>
list
)
{
return
baseMapper
.
bindListByGroupIds
(
list
);
}
@Override
public
void
updateMain
(
InfoSourceMainGroup
infoSourceGroup
,
List
<
String
>
groupTypeIds
)
{
super
.
updateById
(
infoSourceGroup
);
//删除信息源组-信息员组类别绑定关系
groupMainTypeMapService
.
remove
(
Wrappers
.<
GroupMainTypeMap
>
lambdaQuery
().
eq
(
GroupMainTypeMap:
:
getGroupId
,
infoSourceGroup
.
getId
()));
//插入新的
saveMapMain
(
infoSourceGroup
,
groupTypeIds
);
}
@Override
public
void
saveMain
(
InfoSourceMainGroup
infoSourceGroup
,
List
<
String
>
groupTypeIds
)
{
String
groupCode
=
codeGenerateUtil
.
geneCodeNo
(
CodePrefixEnum
.
INFO_SOURCE_MAIN_GROUP_DEFAULT
.
getValue
());
infoSourceGroup
.
setGroupCode
(
groupCode
);
super
.
save
(
infoSourceGroup
);
//插入信息源组-类别的绑定关系
saveMapMain
(
infoSourceGroup
,
groupTypeIds
);
}
@Override
public
List
<
InfoSourceMainGroupPage
>
listByTypeIdList
(
List
<
String
>
groupTypeIdList
,
String
subjectId
,
int
status
,
String
keywords
)
{
//在根据所有明细节点查出专题列表
return
baseMapper
.
listByTypeIdList
(
groupTypeIdList
,
subjectId
,
status
,
keywords
);
}
/**
* 根据分类id获取信息源列表(ynBind=0 :查询没有绑定该组的信息源列表 ynBind=1 :查询绑定该组的信息源列表 )
*/
@Override
public
IPage
<
InfoSourceVo
>
pageListByGroupId
(
InfoSourceVo
infoSourceVo
,
Integer
ynBind
,
String
groupId
,
Integer
pageNo
,
Integer
pageSize
)
{
int
offset
=
(
pageNo
-
1
)
*
pageSize
;
//查询列表
List
<
InfoSourceVo
>
pageList
=
baseMapper
.
pageListByGroupId
(
infoSourceVo
,
ynBind
,
groupId
,
offset
,
pageSize
);
//获取总条数
Integer
count
=
baseMapper
.
totalCountByGroupId
(
infoSourceVo
,
ynBind
,
groupId
);
IPage
<
InfoSourceVo
>
pageData
=
new
Page
<>(
pageNo
,
pageSize
,
count
);
pageData
.
setRecords
(
pageList
);
return
pageData
;
}
@Override
public
String
bind
(
String
groupId
,
List
<
String
>
sourceIds
)
{
String
message
=
"绑定成功!"
;
if
(!
StringUtils
.
isEmpty
(
groupId
)
&&
sourceIds
!=
null
&&
sourceIds
.
size
()
>
0
){
List
<
InfoSourceMainGroupMap
>
list
=
infoSourceMainGroupMapService
.
list
(
Wrappers
.<
InfoSourceMainGroupMap
>
lambdaQuery
()
.
eq
(
InfoSourceMainGroupMap:
:
getGroupId
,
groupId
)
.
in
(
InfoSourceMainGroupMap:
:
getSourceId
,
sourceIds
));
if
(
CollectionUtil
.
isEmpty
(
list
))
{
sourceIds
.
forEach
(
item
->
{
InfoSourceMainGroupMap
infoSourceGroupMap
=
new
InfoSourceMainGroupMap
();
infoSourceGroupMap
.
setGroupId
(
groupId
);
infoSourceGroupMap
.
setSourceId
(
item
);
infoSourceMainGroupMapService
.
save
(
infoSourceGroupMap
);
});
}
else
{
message
=
"部分已经绑定信息源成功过滤,未绑定的信息源已经绑定!"
;
List
<
String
>
bindSourceIds
=
list
.
stream
().
map
(
InfoSourceMainGroupMap:
:
getSourceId
).
collect
(
Collectors
.
toList
());
sourceIds
.
removeAll
(
bindSourceIds
);
if
(
sourceIds
.
size
()
>
0
)
{
sourceIds
.
forEach
(
item
->
{
InfoSourceMainGroupMap
infoSourceGroupMap
=
new
InfoSourceMainGroupMap
();
infoSourceGroupMap
.
setGroupId
(
groupId
);
infoSourceGroupMap
.
setSourceId
(
item
);
infoSourceMainGroupMapService
.
save
(
infoSourceGroupMap
);
});
}
}
}
return
message
;
}
@Override
public
void
unBind
(
String
groupId
,
List
<
String
>
sourceIds
)
{
if
(!
StringUtils
.
isEmpty
(
groupId
)
&&
sourceIds
!=
null
&&
sourceIds
.
size
()
>
0
){
infoSourceMainGroupMapService
.
remove
(
Wrappers
.<
InfoSourceMainGroupMap
>
lambdaQuery
()
.
eq
(
InfoSourceMainGroupMap:
:
getGroupId
,
groupId
)
.
in
(
InfoSourceMainGroupMap:
:
getSourceId
,
sourceIds
));
}
}
@Override
public
IPage
<
InfoSourceMain
>
infosourceMainList
(
InfoSourceMain
infoSourceMain
,
Integer
pageNo
,
Integer
pageSize
)
{
Page
<
InfoSourceMain
>
page
=
new
Page
<>(
pageNo
,
pageSize
);
Page
<
InfoSourceMain
>
page1
=
infoSourceMainService
.
page
(
page
,
Wrappers
.<
InfoSourceMain
>
lambdaQuery
()
.
like
(
StrUtil
.
isNotBlank
(
infoSourceMain
.
getInfoName
()),
InfoSourceMain:
:
getInfoName
,
infoSourceMain
.
getInfoName
())
.
eq
(
StrUtil
.
isNotBlank
(
infoSourceMain
.
getInfoAddress
()),
InfoSourceMain:
:
getInfoAddress
,
infoSourceMain
.
getInfoAddress
())
.
eq
(
StrUtil
.
isNotBlank
(
infoSourceMain
.
getCode
()),
InfoSourceMain:
:
getCode
,
infoSourceMain
.
getCode
())
.
eq
(
ObjectUtil
.
isNotEmpty
(
infoSourceMain
.
getType
()),
InfoSourceMain:
:
getType
,
infoSourceMain
.
getType
())
.
orderByDesc
(
InfoSourceMain:
:
getCreateTime
));
return
page1
;
}
@Override
public
List
<
InfoSourceMainGroupPage
>
bindInfoSourceMainGroupList
(
String
subjectId
,
List
<
Integer
>
types
)
{
return
baseMapper
.
bindInfoSourceMainGroupList
(
subjectId
,
types
);
}
@Override
public
List
<
InfoSourceMain
>
bindInfoSourceMainList
(
String
subjectId
,
List
<
Integer
>
types
)
{
return
baseMapper
.
bindInfoSourceMainList
(
subjectId
,
types
);
}
@Override
public
List
<
InfoSourceMainGroupPage
>
bindInfoSourceMainLabelList
(
String
subjectId
,
List
<
Integer
>
types
)
{
return
baseMapper
.
bindInfoSourceMainLabelList
(
subjectId
,
types
);
}
private
void
saveMapMain
(
InfoSourceMainGroup
infoSourceGroup
,
List
<
String
>
TypeIds
)
{
if
(!
StringUtils
.
isEmpty
(
TypeIds
))
{
for
(
String
TypeId
:
TypeIds
)
{
GroupMainTypeMap
groupTypeMap
=
new
GroupMainTypeMap
();
groupTypeMap
.
setGroupId
(
infoSourceGroup
.
getId
());
groupTypeMap
.
setCreateBy
(
infoSourceGroup
.
getCreateBy
());
groupTypeMap
.
setCreateTime
(
infoSourceGroup
.
getCreateTime
());
groupTypeMap
.
setUpdateBy
(
infoSourceGroup
.
getUpdateBy
());
groupTypeMap
.
setUpdateTime
(
infoSourceGroup
.
getUpdateTime
());
groupTypeMap
.
setSysOrgCode
(
infoSourceGroup
.
getSysOrgCode
());
groupTypeMap
.
setTypeId
(
TypeId
);
groupMainTypeMapService
.
save
(
groupTypeMap
);
}
}
}
}
src/main/java/com/zzsn/event/service/impl/InfoSourceGroupServiceImpl.java
浏览文件 @
6ba8a2c5
...
...
@@ -49,4 +49,15 @@ public class InfoSourceGroupServiceImpl extends ServiceImpl<InfoSourceGroupMappe
}
return
tree
;
}
@Override
public
List
<
GroupTreeVO
>
infourceMainGroupAndTypeTree
()
{
List
<
GroupTreeVO
>
tree
=
new
ArrayList
<>();
List
<
GroupTreeVO
>
groupTreeVOS
=
baseMapper
.
infourceMainGroupAndTypeTree
();
if
(
CollectionUtils
.
isNotEmpty
(
groupTreeVOS
))
{
tree
=
TreeUtil
.
tree
(
groupTreeVOS
,
"0"
);
tree
.
sort
(
Comparator
.
comparing
(
GroupTreeVO:
:
getCreateTime
));
}
return
tree
;
}
}
src/main/java/com/zzsn/event/service/impl/InfoSourceMainGroupMapServiceImpl.java
0 → 100644
浏览文件 @
6ba8a2c5
package
com
.
zzsn
.
event
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.zzsn.event.entity.InfoSourceMainGroupMap
;
import
com.zzsn.event.mapper.InfoSourceMainGroupMapMapper
;
import
com.zzsn.event.service.IInfoSourceMainGroupMapService
;
import
org.springframework.stereotype.Service
;
/**
* @Description: 信息源组和信息源关联表
* @Author: jeecg-boot
* @Date: 2021-11-24
* @Version: V1.0
*/
@Service
public
class
InfoSourceMainGroupMapServiceImpl
extends
ServiceImpl
<
InfoSourceMainGroupMapMapper
,
InfoSourceMainGroupMap
>
implements
IInfoSourceMainGroupMapService
{
}
src/main/java/com/zzsn/event/service/impl/InfoSourceMainServiceImpl.java
0 → 100644
浏览文件 @
6ba8a2c5
package
com
.
zzsn
.
event
.
service
.
impl
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.json.JSONUtil
;
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.event.entity.InfoSourceMain
;
import
com.zzsn.event.entity.SysDictItem
;
import
com.zzsn.event.enums.BindTypeEnum
;
import
com.zzsn.event.feign.api.RemoteSystemService
;
import
com.zzsn.event.mapper.InfoSourceMainMapper
;
import
com.zzsn.event.service.InfoSourceMainGroupService
;
import
com.zzsn.event.service.InfoSourceMainService
;
import
com.zzsn.event.vo.InfoSourceMainGroupPage
;
import
com.zzsn.event.vo.InfoSourceVo
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.StringUtils
;
import
java.util.*
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
/**
* <p>
* 信息源表 服务实现类
* </p>
*
* @author obcy
* @since 2025-06-19
*/
@Service
@Slf4j
public
class
InfoSourceMainServiceImpl
extends
ServiceImpl
<
InfoSourceMainMapper
,
InfoSourceMain
>
implements
InfoSourceMainService
{
@Autowired
private
InfoSourceMainGroupService
infoSourceMainGroupService
;
@Autowired
private
RemoteSystemService
remoteSystemService
;
@Override
public
IPage
<
InfoSourceMain
>
subjectBindList
(
InfoSourceMain
infoSourceMain
,
String
subjectId
,
Integer
pageNo
,
Integer
pageSize
)
{
Page
<
InfoSourceMain
>
page
=
new
Page
<>(
pageNo
,
pageSize
);
IPage
<
InfoSourceMain
>
pageList
=
baseMapper
.
subjectBindIdPageList
(
page
,
infoSourceMain
,
subjectId
);
if
(
pageList
!=
null
&&
CollectionUtils
.
isNotEmpty
(
pageList
.
getRecords
()))
{
List
<
InfoSourceMain
>
infoSourceMains
=
baseMapper
.
bindGroupSourceIdList
(
subjectId
,
pageList
.
getRecords
().
stream
().
map
(
InfoSourceMain:
:
getId
).
collect
(
Collectors
.
toList
()));
Map
<
String
,
InfoSourceMain
>
collect1
=
infoSourceMains
.
stream
().
collect
(
Collectors
.
toMap
(
InfoSourceMain:
:
getId
,
Function
.
identity
(),
(
exist
,
replace
)
->
exist
));
for
(
InfoSourceMain
infoSourceMain1
:
pageList
.
getRecords
()){
if
(
ObjectUtil
.
isEmpty
(
infoSourceMain1
.
getIsFreeCheck
())){
InfoSourceMain
infoSourceVo2
=
collect1
.
get
(
infoSourceMain1
.
getId
());
if
(
infoSourceVo2
!=
null
)
{
infoSourceMain1
.
setIsFreeCheck
(
infoSourceVo2
.
getIsFreeCheck
());
}
}
if
(
ObjectUtil
.
isEmpty
(
infoSourceMain1
.
getIsExemptKeyword
())){
InfoSourceMain
infoSourceVo2
=
collect1
.
get
(
infoSourceMain1
.
getId
());
if
(
infoSourceVo2
!=
null
)
{
infoSourceMain1
.
setIsExemptKeyword
(
infoSourceVo2
.
getIsExemptKeyword
());
}
}
}
}
return
pageList
;
}
@Override
public
JSONObject
bindInfoSourceMainGroupList
(
String
subjectId
)
{
List
<
InfoSourceMainGroupPage
>
infoSourceGroupPages
=
infoSourceMainGroupService
.
bindInfoSourceMainGroupList
(
subjectId
,
BindTypeEnum
.
getInfoSourceMainGroupType
());
JSONObject
jsonObject
=
new
JSONObject
();
if
(
CollectionUtil
.
isEmpty
(
infoSourceGroupPages
))
{
return
jsonObject
;
}
Map
<
Integer
,
List
<
InfoSourceMainGroupPage
>>
collect
=
infoSourceGroupPages
.
stream
().
collect
(
Collectors
.
groupingBy
(
InfoSourceMainGroupPage:
:
getSourceType
));
collect
.
forEach
((
k
,
v
)->
{
BindTypeEnum
enumByValue
=
BindTypeEnum
.
getEnumByValue
(
k
);
if
(
ObjectUtil
.
isNotNull
(
enumByValue
))
{
//合并相同信息源组
List
<
InfoSourceMainGroupPage
>
list
=
new
ArrayList
<>();
for
(
InfoSourceMainGroupPage
groupPage
:
v
)
{
Optional
<
InfoSourceMainGroupPage
>
first
=
list
.
stream
().
filter
(
f
->
StrUtil
.
equals
(
f
.
getId
(),
groupPage
.
getId
())).
findFirst
();
if
(
first
.
isPresent
()){
InfoSourceMainGroupPage
infoSourceGroupPage
=
first
.
get
();
infoSourceGroupPage
.
setGroupTypeNames
(
infoSourceGroupPage
.
getGroupTypeNames
()+
"、"
+
groupPage
.
getGroupTypeNames
());
}
else
{
list
.
add
(
groupPage
);
}
}
jsonObject
.
put
(
enumByValue
.
toString
(),
list
);
}
});
return
jsonObject
;
}
@Override
public
JSONObject
bindInfoSourceMainList
(
String
subjectId
)
{
List
<
InfoSourceMain
>
infoSourceVos
=
infoSourceMainGroupService
.
bindInfoSourceMainList
(
subjectId
,
BindTypeEnum
.
getInfoSourceMainType
());
JSONObject
jsonObject
=
new
JSONObject
();
if
(
CollectionUtil
.
isEmpty
(
infoSourceVos
))
{
return
jsonObject
;
}
Map
<
Integer
,
List
<
InfoSourceMain
>>
collect
=
infoSourceVos
.
stream
().
collect
(
Collectors
.
groupingBy
(
InfoSourceMain:
:
getSourceType
));
collect
.
forEach
((
k
,
v
)->
{
BindTypeEnum
enumByValue
=
BindTypeEnum
.
getEnumByValue
(
k
);
if
(
ObjectUtil
.
isNotNull
(
enumByValue
))
{
jsonObject
.
put
(
enumByValue
.
toString
(),
v
);
}
});
return
jsonObject
;
}
@Override
public
JSONObject
bindInfoSourceMainLabelList
(
String
subjectId
)
{
List
<
InfoSourceMainGroupPage
>
infoSourceGroupPages
=
infoSourceMainGroupService
.
bindInfoSourceMainLabelList
(
subjectId
,
BindTypeEnum
.
getInfoSourceMainLabelType
());
JSONObject
jsonObject
=
new
JSONObject
();
if
(
CollectionUtil
.
isEmpty
(
infoSourceGroupPages
))
{
return
jsonObject
;
}
//字典类的标签处理层级关系
List
<
String
>
dictCodes
=
infoSourceGroupPages
.
stream
().
filter
(
f
->
"3"
.
equals
(
f
.
getBusinessCaliber
())).
map
(
InfoSourceMainGroupPage:
:
getDictCode
).
collect
(
Collectors
.
toList
());
dictCodes
.
forEach
(
e
->
{
List
<
SysDictItem
>
dictList
=
getDictList
(
e
);
infoSourceGroupPages
.
forEach
(
ee
->
{
if
(!
StringUtils
.
isEmpty
(
ee
.
getWeight
())
&&
"0"
.
equals
(
ee
.
getWeight
()))
{
ee
.
setWeight
(
null
);
}
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
<
InfoSourceMainGroupPage
>>
collect
=
infoSourceGroupPages
.
stream
().
collect
(
Collectors
.
groupingBy
(
InfoSourceMainGroupPage:
:
getSourceType
));
collect
.
forEach
((
k
,
v
)->
{
BindTypeEnum
enumByValue
=
BindTypeEnum
.
getEnumByValue
(
k
);
if
(
ObjectUtil
.
isNotNull
(
enumByValue
))
{
jsonObject
.
put
(
enumByValue
.
toString
(),
v
);
}
});
return
jsonObject
;
}
private
List
<
SysDictItem
>
getDictList
(
String
dictCode
){
Object
dictList
=
remoteSystemService
.
getDictList
(
dictCode
);
return
JSONUtil
.
toList
(
JSONUtil
.
parseArray
(
dictList
),
SysDictItem
.
class
);
}
}
src/main/java/com/zzsn/event/service/impl/SubjectServiceImpl.java
浏览文件 @
6ba8a2c5
...
...
@@ -986,6 +986,18 @@ public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> impl
if
(
StrUtil
.
equals
(
subjectPage
.
getSourceType
(),
"3"
))
{
bindLabels
(
subjectPage
);
}
//绑定信息源组
if
(
StrUtil
.
equals
(
subjectPage
.
getSourceType
(),
"4"
))
{
bindInfoSourceMainGroup
(
subjectPage
);
}
//绑定信息源
if
(
StrUtil
.
equals
(
subjectPage
.
getSourceType
(),
"5"
))
{
bindMainInfoSource
(
subjectPage
);
}
//绑定信息源标签
if
(
StrUtil
.
equals
(
subjectPage
.
getSourceType
(),
"6"
))
{
bindMainLabels
(
subjectPage
);
}
configurationMessageService
.
bindInfoSourceSend
(
subjectId
);
return
Result
.
OK
(
"绑定成功"
);
...
...
@@ -1292,6 +1304,66 @@ public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> impl
//绑定屏蔽标签信息源
bindLabels
(
subjectId
,
bindLabels
,
BindTypeEnum
.
EXCLUDE_INFO_SOURCE_LABEL
.
getvalue
());
}
}
private
void
bindInfoSourceMainGroup
(
SubjectPage
subjectPage
)
{
String
sourceBindType
=
subjectPage
.
getSourceBindType
();
List
<
String
>
idList
=
subjectPage
.
getBindIds
();
if
(
CollectionUtil
.
isEmpty
(
idList
)){
return
;
}
if
(
StrUtil
.
equals
(
sourceBindType
,
"1"
))
{
//绑定通用信息源组
bindInfoSource
(
subjectPage
,
idList
,
BindTypeEnum
.
INFO_MAIN_SOURCE_GROUP
.
getvalue
());
}
if
(
StrUtil
.
equals
(
sourceBindType
,
"2"
))
{
//绑定定向信息源组
bindInfoSource
(
subjectPage
,
idList
,
BindTypeEnum
.
DIRECTIONA_MAIN_INFO_SOURCE_GROUP
.
getvalue
());
}
if
(
StrUtil
.
equals
(
sourceBindType
,
"3"
))
{
//绑定屏蔽信息源组
bindInfoSource
(
subjectPage
,
idList
,
BindTypeEnum
.
EXCLUDE_MAIN_INFO_SOURCE_GROUP
.
getvalue
());
}
}
private
void
bindMainInfoSource
(
SubjectPage
subjectPage
)
{
String
sourceBindType
=
subjectPage
.
getSourceBindType
();
List
<
String
>
idList
=
subjectPage
.
getBindIds
();
if
(
CollectionUtil
.
isEmpty
(
idList
)){
return
;
}
if
(
StrUtil
.
equals
(
sourceBindType
,
"1"
))
{
//绑定通用信息源
bindInfoSource
(
subjectPage
,
idList
,
BindTypeEnum
.
INFO_MAIN_SOURCE
.
getvalue
());
}
if
(
StrUtil
.
equals
(
sourceBindType
,
"2"
))
{
//绑定定向信息源
bindInfoSource
(
subjectPage
,
idList
,
BindTypeEnum
.
DIRECTIONA_MAIN_INFO_SOURCE
.
getvalue
());
}
if
(
StrUtil
.
equals
(
sourceBindType
,
"3"
))
{
//绑定屏蔽信息源
bindInfoSource
(
subjectPage
,
idList
,
BindTypeEnum
.
EXCLUDE_MAIN_INFO_SOURCE
.
getvalue
());
}
}
private
void
bindMainLabels
(
SubjectPage
subjectPage
)
{
String
subjectId
=
subjectPage
.
getId
();
String
sourceBindType
=
subjectPage
.
getSourceBindType
();
List
<
BindLabelVo
>
bindLabels
=
subjectPage
.
getBindLabels
();
if
(
CollectionUtil
.
isEmpty
(
bindLabels
)){
return
;
}
if
(
StrUtil
.
equals
(
sourceBindType
,
"1"
))
{
//绑定通用标签信息源
bindLabels
(
subjectId
,
bindLabels
,
BindTypeEnum
.
INFO_SOURCE_MAIN_LABEL
.
getvalue
());
}
if
(
StrUtil
.
equals
(
sourceBindType
,
"2"
))
{
//绑定定向标签信息源
bindLabels
(
subjectId
,
bindLabels
,
BindTypeEnum
.
DIRECTIONA_INFO_MAIN_SOURCE_LABEL
.
getvalue
());
}
if
(
StrUtil
.
equals
(
sourceBindType
,
"3"
))
{
//绑定屏蔽标签信息源
bindLabels
(
subjectId
,
bindLabels
,
BindTypeEnum
.
EXCLUDE_INFO_MAIN_SOURCE_LABEL
.
getvalue
());
}
}
...
...
src/main/java/com/zzsn/event/util/ExcelExportUtil.java
浏览文件 @
6ba8a2c5
...
...
@@ -456,4 +456,40 @@ public class ExcelExportUtil {
return
xssfCell
.
getStringCellValue
();
}
}
/**
* 读取excel数据
*
* @param firstRow 第一行有用数据(0表示第一行)
* @param columnNum 有用数据的总列数
* @return java.util.List<java.util.List < java.lang.String>>
*/
public
static
List
<
List
<
String
>>
readExcel
(
InputStream
inputStream
,
Integer
firstRow
,
Integer
columnNum
)
throws
Exception
{
List
<
List
<
String
>>
dataList
=
new
ArrayList
<>();
//获取整个excel
XSSFWorkbook
hb
=
new
XSSFWorkbook
(
inputStream
);
int
sheets
=
hb
.
getNumberOfSheets
();
for
(
int
i
=
0
;
i
<
sheets
;
i
++)
{
XSSFSheet
sheet
=
hb
.
getSheetAt
(
i
);
//第一行
int
firstRowNum
=
sheet
.
getFirstRowNum
();
//最后一行
int
lastRowNum
=
sheet
.
getPhysicalNumberOfRows
();
for
(
int
j
=
firstRowNum
+
firstRow
;
j
<
lastRowNum
;
j
++)
{
//获取行
XSSFRow
row
=
sheet
.
getRow
(
j
);
if
(
row
!=
null
)
{
List
<
String
>
list
=
new
ArrayList
<>();
for
(
int
m
=
0
;
m
<
columnNum
;
m
++)
{
String
data
=
ExcelExportUtil
.
getValue
(
row
.
getCell
(
m
)).
trim
();
list
.
add
(
data
);
}
dataList
.
add
(
list
);
}
}
}
return
dataList
;
}
}
src/main/java/com/zzsn/event/vo/GroupMainTypeVo.java
0 → 100644
浏览文件 @
6ba8a2c5
package
com
.
zzsn
.
event
.
vo
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public
class
GroupMainTypeVo
{
/**
* 主键
*/
private
String
id
;
/**
* 类别名称
*/
private
String
typeName
;
/**
* 创建人
*/
private
String
createBy
;
/**
* 创建日期
*/
private
java
.
util
.
Date
createTime
;
/**
* 更新人
*/
private
String
updateBy
;
/**
* 更新日期
*/
private
java
.
util
.
Date
updateTime
;
/**
* 所属部门
*/
private
String
sysOrgCode
;
/**
* 父级节点
*/
private
String
pid
;
/**
* 是否有子节点
*/
private
String
hasChild
;
/**
* 下级节点
*/
private
java
.
util
.
List
<
GroupMainTypeVo
>
children
;
private
Boolean
isGroup
=
false
;
/**
* 与专题关系 false:未绑定 true:已绑定
*/
// private Boolean status;
private
Integer
status
;
/**
* 下级节点个数
*/
private
Integer
childrenCount
;
}
src/main/java/com/zzsn/event/vo/InfoSourceGroupPage.java
浏览文件 @
6ba8a2c5
...
...
@@ -29,7 +29,7 @@ public class InfoSourceGroupPage {
/**
* 组类别id
*/
private
List
<
String
>
groupTypeIds
;
private
String
groupTypeIds
;
private
String
typeIds
;
private
String
typeId
;
...
...
src/main/java/com/zzsn/event/vo/InfoSourceMainGroupPage.java
0 → 100644
浏览文件 @
6ba8a2c5
package
com
.
zzsn
.
event
.
vo
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
lombok.Data
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
java.util.List
;
@Data
public
class
InfoSourceMainGroupPage
{
/**
* 主键
*/
private
String
id
;
/**
* 组编码
*/
private
String
groupCode
;
/**
* 信息源组名称
*/
private
String
groupName
;
/**
* 绑定信息源组的信息源ids
*/
private
List
<
String
>
infoSourceIds
;
/**
* 组类别id
*/
private
List
<
String
>
groupTypeIds
;
private
String
typeIds
;
private
String
typeId
;
/**
* 组类别名称
*/
private
String
groupTypeNames
;
/**
* 分组说明
*/
private
String
groupRemark
;
/**
* 状态
*/
private
Integer
status
;
/**
* 创建人
*/
private
String
createBy
;
/**
* 创建日期
*/
@JsonFormat
(
timezone
=
"GMT+8"
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
java
.
util
.
Date
createTime
;
/**
* 更新人
*/
private
String
updateBy
;
/**
* 更新日期
*/
@JsonFormat
(
timezone
=
"GMT+8"
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
java
.
util
.
Date
updateTime
;
/**
* 所属部门
*/
private
String
sysOrgCode
;
/**
* 信息源类别
*/
private
Integer
sourceType
;
/**
* 信息源权重(以组设置)
*/
private
String
weight
;
/**
* 专题绑定信息源的主键id
*/
private
String
subjectInfoSourceId
;
private
Integer
infoSourceNum
;
private
String
groupTypeId
;
private
String
subjectId
;
/**
* 是否免过关键词 0否 1是
*/
private
Integer
isExemptKeyword
;
/**
* 是否免审核 0否 1是
*/
private
Integer
isFreeCheck
;
/**绑定的标签字段*/
private
String
labelCode
;
private
String
labelName
;
private
String
businessCaliber
;
private
String
labelItemCode
;
private
String
labelItemName
;
private
String
dictCode
;
/**绑定的标签字段end*/
}
src/main/java/com/zzsn/event/vo/InfoSourceVo.java
浏览文件 @
6ba8a2c5
...
...
@@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import
lombok.Data
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -264,4 +265,20 @@ public class InfoSourceVo {
private
Integer
isExemptKeyword
;
/**是否免审核 0否 1是*/
private
Integer
isFreeCheck
;
private
String
groupId
;
private
String
code
;
private
String
infoAddress
;
private
String
infoName
;
private
String
groupName
;
/**专题绑定的信息源的类型,定向或者非定向*/
private
String
subjectInfoSourceType
;
public
List
<
String
>
toExcelList
(){
List
<
String
>
list
=
new
ArrayList
<>();
list
.
add
(
id
);
list
.
add
(
code
);
list
.
add
(
infoName
);
list
.
add
(
infoAddress
);
return
list
;
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论