Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
E
event
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
陈世强
event
Commits
ae92a653
提交
ae92a653
authored
8月 26, 2025
作者:
yanxin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
支撑根据分组查询绑定标签字典
上级
f398883f
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
64 行增加
和
19 行删除
+64
-19
SubjectDictMapMapper.java
...main/java/com/zzsn/event/mapper/SubjectDictMapMapper.java
+7
-7
SubjectMapper.java
src/main/java/com/zzsn/event/mapper/SubjectMapper.java
+2
-0
SubjectDictMapMapper.xml
...n/java/com/zzsn/event/mapper/xml/SubjectDictMapMapper.xml
+18
-4
SubjectMapper.xml
src/main/java/com/zzsn/event/mapper/xml/SubjectMapper.xml
+4
-0
SubjectService.java
src/main/java/com/zzsn/event/service/SubjectService.java
+7
-0
SubjectDictMapServiceImpl.java
...om/zzsn/event/service/impl/SubjectDictMapServiceImpl.java
+20
-8
SubjectServiceImpl.java
.../java/com/zzsn/event/service/impl/SubjectServiceImpl.java
+6
-0
没有找到文件。
src/main/java/com/zzsn/event/mapper/SubjectDictMapMapper.java
浏览文件 @
ae92a653
...
@@ -22,29 +22,29 @@ public interface SubjectDictMapMapper extends BaseMapper<SubjectDictMap> {
...
@@ -22,29 +22,29 @@ public interface SubjectDictMapMapper extends BaseMapper<SubjectDictMap> {
/**
/**
* 专题绑定的数据字典信息
* 专题绑定的数据字典信息
*
*
* @param subjectId 专题id
* @param subjectId
List
专题id
* @author lkg
* @author lkg
* @date 2025/3/28
* @date 2025/3/28
*/
*/
List
<
DictVO
>
boundList
(
@Param
(
"subjectId
"
)
String
subjectId
);
List
<
DictVO
>
boundList
(
@Param
(
"subjectId
List"
)
List
<
String
>
subjectIdList
);
List
<
String
>
boundIdList
(
@Param
(
"subjectId
"
)
String
subjectId
);
List
<
String
>
boundIdList
(
@Param
(
"subjectId
List"
)
List
<
String
>
subjectIdList
);
/**
/**
* 流程中标签模型绑定的数据字典信息
* 流程中标签模型绑定的数据字典信息
*
*
* @param subjectId
* @param subjectId
List
* @return
* @return
*/
*/
List
<
DictVO
>
boundArrangeList
(
@Param
(
"subjectId
"
)
String
subjectId
);
List
<
DictVO
>
boundArrangeList
(
@Param
(
"subjectId
List"
)
List
<
String
>
subjectIdList
);
/**
/**
* 老逻辑中标签模型绑定的数据字典信息
* 老逻辑中标签模型绑定的数据字典信息
*
*
* @param subjectId
* @param subjectId
List
* @return
* @return
*/
*/
List
<
DictVO
>
boundOldList
(
@Param
(
"subjectId
"
)
String
subjectId
);
List
<
DictVO
>
boundOldList
(
@Param
(
"subjectId
List"
)
List
<
String
>
subjectIdList
);
/**
/**
* 查询非数据字典的标签类型
* 查询非数据字典的标签类型
...
...
src/main/java/com/zzsn/event/mapper/SubjectMapper.java
浏览文件 @
ae92a653
...
@@ -125,4 +125,6 @@ public interface SubjectMapper extends BaseMapper<Subject> {
...
@@ -125,4 +125,6 @@ public interface SubjectMapper extends BaseMapper<Subject> {
List
<
String
>
getBindSubjectIds
(
@Param
(
"id"
)
String
id
);
List
<
String
>
getBindSubjectIds
(
@Param
(
"id"
)
String
id
);
String
getMinCreateTime
(
@Param
(
"subjectIdList"
)
List
<
String
>
subjectIdList
);
String
getMinCreateTime
(
@Param
(
"subjectIdList"
)
List
<
String
>
subjectIdList
);
List
<
String
>
getIdListByType
(
@Param
(
"typeId"
)
String
typeId
);
}
}
src/main/java/com/zzsn/event/mapper/xml/SubjectDictMapMapper.xml
浏览文件 @
ae92a653
...
@@ -16,12 +16,18 @@
...
@@ -16,12 +16,18 @@
select d.id,d.dict_code as code,d.dict_name as name,'bind' as type
select d.id,d.dict_code as code,d.dict_name as name,'bind' as type
from subject_dict_map m
from subject_dict_map m
inner join clb_system.sys_dict d on m.dict_id = d.id
inner join clb_system.sys_dict d on m.dict_id = d.id
where m.subject_id = #{subjectId}
where m.subject_id in
<foreach
collection=
"subjectIdList"
item=
"id"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</select>
</select>
<select
id=
"boundIdList"
resultType=
"String"
>
<select
id=
"boundIdList"
resultType=
"String"
>
select dict_id
select dict_id
from subject_dict_map
from subject_dict_map
where subject_id = #{subjectId}
where subject_id in
<foreach
collection=
"subjectIdList"
item=
"id"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</select>
</select>
<select
id=
"boundArrangeList"
resultType=
"com.zzsn.event.vo.DictVO"
>
<select
id=
"boundArrangeList"
resultType=
"com.zzsn.event.vo.DictVO"
>
...
@@ -39,7 +45,11 @@
...
@@ -39,7 +45,11 @@
WHERE
WHERE
arrange_id IN
arrange_id IN
(SELECT DISTINCT arrange_id FROM clb_model_arrange_subject_map
(SELECT DISTINCT arrange_id FROM clb_model_arrange_subject_map
WHERE subject_id = #{subjectId} AND del_flag = 0 )
WHERE subject_id in
<foreach
collection=
"subjectIdList"
item=
"id"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
AND del_flag = 0 )
AND del_flag = 0
AND del_flag = 0
AND base_node_id = '1872120615905812482')
AND base_node_id = '1872120615905812482')
and (label_id is not null or dict_code is not null)
and (label_id is not null or dict_code is not null)
...
@@ -53,7 +63,11 @@
...
@@ -53,7 +63,11 @@
WHERE
WHERE
type = 3 AND id IN
type = 3 AND id IN
(SELECT DISTINCT model_id FROM subject_model_map
(SELECT DISTINCT model_id FROM subject_model_map
WHERE subject_id = #{subjectId} AND type = 3)
WHERE subject_id in
<foreach
collection=
"subjectIdList"
item=
"id"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
AND type = 3)
</select>
</select>
<select
id=
"findLabelType"
resultType=
"com.zzsn.event.vo.DictVO"
>
<select
id=
"findLabelType"
resultType=
"com.zzsn.event.vo.DictVO"
>
...
...
src/main/java/com/zzsn/event/mapper/xml/SubjectMapper.xml
浏览文件 @
ae92a653
...
@@ -329,4 +329,8 @@
...
@@ -329,4 +329,8 @@
</foreach>
</foreach>
</if>
</if>
</select>
</select>
<select
id=
"getIdListByType"
resultType=
"java.lang.String"
>
select DISTINCT subject_id from subject_type_map where type_id = #{typeId}
</select>
</mapper>
</mapper>
src/main/java/com/zzsn/event/service/SubjectService.java
浏览文件 @
ae92a653
...
@@ -212,4 +212,11 @@ public interface SubjectService extends IService<Subject> {
...
@@ -212,4 +212,11 @@ public interface SubjectService extends IService<Subject> {
Subject
getSubjectOrEventById
(
String
id
);
Subject
getSubjectOrEventById
(
String
id
);
/**根据编码查询专题或者事件*/
/**根据编码查询专题或者事件*/
Subject
getSubjectOrEvent
(
String
subjectCode
);
Subject
getSubjectOrEvent
(
String
subjectCode
);
/**
* 根据分组获取专题id列表
* @param typeId
* @return
*/
List
<
String
>
getIdListByType
(
String
typeId
);
}
}
src/main/java/com/zzsn/event/service/impl/SubjectDictMapServiceImpl.java
浏览文件 @
ae92a653
...
@@ -3,19 +3,19 @@ package com.zzsn.event.service.impl;
...
@@ -3,19 +3,19 @@ package com.zzsn.event.service.impl;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.zzsn.event.entity.Subject
;
import
com.zzsn.event.entity.SubjectDictMap
;
import
com.zzsn.event.entity.SubjectDictMap
;
import
com.zzsn.event.service.SubjectDictMapService
;
import
com.zzsn.event.service.SubjectDictMapService
;
import
com.zzsn.event.mapper.SubjectDictMapMapper
;
import
com.zzsn.event.mapper.SubjectDictMapMapper
;
import
com.zzsn.event.service.SubjectService
;
import
com.zzsn.event.util.tree.Node
;
import
com.zzsn.event.util.tree.Node
;
import
com.zzsn.event.vo.DictVO
;
import
com.zzsn.event.vo.DictVO
;
import
com.zzsn.event.vo.SubjectBindLabelParam
;
import
com.zzsn.event.vo.SubjectBindLabelParam
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.*
;
import
java.util.Comparator
;
import
java.util.List
;
import
java.util.TreeSet
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
import
java.util.stream.Stream
;
...
@@ -27,6 +27,9 @@ import java.util.stream.Stream;
...
@@ -27,6 +27,9 @@ import java.util.stream.Stream;
@Service
@Service
public
class
SubjectDictMapServiceImpl
extends
ServiceImpl
<
SubjectDictMapMapper
,
SubjectDictMap
>
implements
SubjectDictMapService
{
public
class
SubjectDictMapServiceImpl
extends
ServiceImpl
<
SubjectDictMapMapper
,
SubjectDictMap
>
implements
SubjectDictMapService
{
@Autowired
private
SubjectService
subjectService
;
@Override
@Override
public
void
modify
(
SubjectBindLabelParam
bindLabelParam
)
{
public
void
modify
(
SubjectBindLabelParam
bindLabelParam
)
{
String
subjectId
=
bindLabelParam
.
getSubjectId
();
String
subjectId
=
bindLabelParam
.
getSubjectId
();
...
@@ -49,9 +52,18 @@ public class SubjectDictMapServiceImpl extends ServiceImpl<SubjectDictMapMapper,
...
@@ -49,9 +52,18 @@ public class SubjectDictMapServiceImpl extends ServiceImpl<SubjectDictMapMapper,
@Override
@Override
public
List
<
DictVO
>
boundList
(
String
subjectId
)
{
public
List
<
DictVO
>
boundList
(
String
subjectId
)
{
Subject
byId
=
subjectService
.
getById
(
subjectId
);
List
<
String
>
subjectIdList
=
Collections
.
singletonList
(
subjectId
);
if
(
byId
==
null
){
//不是专题时,根据分组获取专题列表
subjectIdList
=
subjectService
.
getIdListByType
(
subjectId
);
}
if
(
subjectIdList
.
isEmpty
()){
return
new
ArrayList
<>();
}
//直接绑定的字典
//直接绑定的字典
List
<
DictVO
>
dictVOS
=
baseMapper
.
boundList
(
subjectId
);
List
<
DictVO
>
dictVOS
=
baseMapper
.
boundList
(
subjectId
List
);
List
<
String
>
boundIds
=
baseMapper
.
boundIdList
(
subjectId
);
List
<
String
>
boundIds
=
baseMapper
.
boundIdList
(
subjectId
List
);
if
(
boundIds
.
size
()>
dictVOS
.
size
()){
if
(
boundIds
.
size
()>
dictVOS
.
size
()){
List
<
String
>
ids
=
dictVOS
.
stream
().
map
(
DictVO:
:
getId
).
collect
(
Collectors
.
toList
());
List
<
String
>
ids
=
dictVOS
.
stream
().
map
(
DictVO:
:
getId
).
collect
(
Collectors
.
toList
());
List
<
String
>
lids
=
new
ArrayList
<>(
boundIds
);
List
<
String
>
lids
=
new
ArrayList
<>(
boundIds
);
...
@@ -64,11 +76,11 @@ public class SubjectDictMapServiceImpl extends ServiceImpl<SubjectDictMapMapper,
...
@@ -64,11 +76,11 @@ public class SubjectDictMapServiceImpl extends ServiceImpl<SubjectDictMapMapper,
dictVOS
.
addAll
(
baseMapper
.
findLeaderLabelType
(
boundIds
));
dictVOS
.
addAll
(
baseMapper
.
findLeaderLabelType
(
boundIds
));
}
}
//流程中标签模型绑定字典
//流程中标签模型绑定字典
List
<
DictVO
>
dictArrange
=
baseMapper
.
boundArrangeList
(
subjectId
);
List
<
DictVO
>
dictArrange
=
baseMapper
.
boundArrangeList
(
subjectId
List
);
dictVOS
.
addAll
(
dictArrange
);
dictVOS
.
addAll
(
dictArrange
);
if
(
dictArrange
.
isEmpty
()){
if
(
dictArrange
.
isEmpty
()){
//未绑定流程的(可能)查询老逻辑保定的字典
//未绑定流程的(可能)查询老逻辑保定的字典
List
<
DictVO
>
dictOld
=
baseMapper
.
boundOldList
(
subjectId
);
List
<
DictVO
>
dictOld
=
baseMapper
.
boundOldList
(
subjectId
List
);
dictVOS
.
addAll
(
dictOld
);
dictVOS
.
addAll
(
dictOld
);
}
}
dictVOS
.
forEach
(
dictVO
->
{
dictVOS
.
forEach
(
dictVO
->
{
...
...
src/main/java/com/zzsn/event/service/impl/SubjectServiceImpl.java
浏览文件 @
ae92a653
...
@@ -1545,6 +1545,12 @@ public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> impl
...
@@ -1545,6 +1545,12 @@ public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> impl
}
}
}
}
@Override
public
List
<
String
>
getIdListByType
(
String
typeId
)
{
return
this
.
baseMapper
.
getIdListByType
(
typeId
);
}
@Override
@Override
public
Subject
getSubjectOrEventById
(
String
id
)
{
public
Subject
getSubjectOrEventById
(
String
id
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论