From f15241e313948dd4e93ddfe600bfa9628795043a Mon Sep 17 00:00:00 2001 From: fengshuonan Date: Wed, 29 Jun 2022 11:37:49 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=907.2.3=E3=80=91=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E5=88=86=E7=BB=84=E4=B8=9A=E5=8A=A1=E7=9A=84=E6=89=80=E6=9C=89?= =?UTF-8?q?=E5=88=86=E7=BB=84=E5=88=97=E8=A1=A8=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../group/api/constants/GroupConstants.java | 5 ++++ .../service/impl/SysGroupServiceImpl.java | 25 ++++++++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/kernel-s-group/group-api/src/main/java/cn/stylefeng/roses/kernel/group/api/constants/GroupConstants.java b/kernel-s-group/group-api/src/main/java/cn/stylefeng/roses/kernel/group/api/constants/GroupConstants.java index a66f591f7..fca766e48 100644 --- a/kernel-s-group/group-api/src/main/java/cn/stylefeng/roses/kernel/group/api/constants/GroupConstants.java +++ b/kernel-s-group/group-api/src/main/java/cn/stylefeng/roses/kernel/group/api/constants/GroupConstants.java @@ -47,6 +47,11 @@ public interface GroupConstants { */ String GROUP_ADD_NAME = "添加分组"; + /** + * 所有分组 + */ + String ALL_GROUP_NAME = "所有分组"; + /** * 未分组 */ diff --git a/kernel-s-group/group-business/src/main/java/cn/stylefeng/roses/kernel/group/modular/service/impl/SysGroupServiceImpl.java b/kernel-s-group/group-business/src/main/java/cn/stylefeng/roses/kernel/group/modular/service/impl/SysGroupServiceImpl.java index c370a1a69..5e1d216fb 100644 --- a/kernel-s-group/group-business/src/main/java/cn/stylefeng/roses/kernel/group/modular/service/impl/SysGroupServiceImpl.java +++ b/kernel-s-group/group-business/src/main/java/cn/stylefeng/roses/kernel/group/modular/service/impl/SysGroupServiceImpl.java @@ -32,7 +32,7 @@ public class SysGroupServiceImpl extends ServiceImpl i List userGroupList = this.baseMapper.getUserGroupList(groupBizCode, userId); // 增加两个固定的选中和取消选项 - addCommonGroup(groupBizCode, userGroupList); + addAllGroup(groupBizCode, userGroupList); return userGroupList; } @@ -130,4 +130,27 @@ public class SysGroupServiceImpl extends ServiceImpl i result.add(0, addGroup); } + /** + * 返回所有分组和未分组的查询 + * + * @author fengshuonan + * @date 2022/6/28 10:50 + */ + private void addAllGroup(String groupBizCode, List result) { + + // 添加分组 + SysGroup addGroup = new SysGroup(); + addGroup.setGroupBizCode(groupBizCode); + addGroup.setGroupName(GroupConstants.ALL_GROUP_NAME); + + // 未分组 + SysGroup noneGroup = new SysGroup(); + noneGroup.setGroupBizCode(groupBizCode); + noneGroup.setGroupName(GroupConstants.GROUP_DELETE_NAME); + + result.add(0, noneGroup); + result.add(0, addGroup); + } + + }