From dfa99011d88c83f037f95efd6c1a4972eb220d07 Mon Sep 17 00:00:00 2001 From: fengshuonan Date: Sun, 25 Sep 2022 23:47:47 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=907.2.5=E3=80=91=E3=80=90org=E3=80=91?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=8E=B7=E5=8F=96=E7=BB=84=E7=BB=87=E6=A0=91?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=8C=87=E5=AE=9A=E7=BB=84=E7=BB=87=E6=9C=BA?= =?UTF-8?q?=E6=9E=84=E4=B8=8B=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/pojo/organization/HrOrganizationRequest.java | 7 +++++++ .../service/impl/HrOrganizationServiceImpl.java | 10 ++++++++++ 2 files changed, 17 insertions(+) diff --git a/kernel-s-system/system-api/src/main/java/cn/stylefeng/roses/kernel/system/api/pojo/organization/HrOrganizationRequest.java b/kernel-s-system/system-api/src/main/java/cn/stylefeng/roses/kernel/system/api/pojo/organization/HrOrganizationRequest.java index 24ed491d1..e4c7ec76c 100644 --- a/kernel-s-system/system-api/src/main/java/cn/stylefeng/roses/kernel/system/api/pojo/organization/HrOrganizationRequest.java +++ b/kernel-s-system/system-api/src/main/java/cn/stylefeng/roses/kernel/system/api/pojo/organization/HrOrganizationRequest.java @@ -35,6 +35,7 @@ import lombok.EqualsAndHashCode; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; import java.math.BigDecimal; +import java.util.List; /** * 系统组织机构表 @@ -134,6 +135,12 @@ public class HrOrganizationRequest extends BaseRequest { @ChineseDescription("动态表单数据") private ExpandDataInfo expandDataInfo; + /** + * 限制从哪些组织机构中查询,传组织机构id集合 + */ + @ChineseDescription("限制从哪些组织机构中查询") + private List orgIdLimit; + /** * 组织机构树zTree形式 */ diff --git a/kernel-s-system/system-business-organization/src/main/java/cn/stylefeng/roses/kernel/system/modular/organization/service/impl/HrOrganizationServiceImpl.java b/kernel-s-system/system-business-organization/src/main/java/cn/stylefeng/roses/kernel/system/modular/organization/service/impl/HrOrganizationServiceImpl.java index 5a27a2372..bfb411cdf 100644 --- a/kernel-s-system/system-business-organization/src/main/java/cn/stylefeng/roses/kernel/system/modular/organization/service/impl/HrOrganizationServiceImpl.java +++ b/kernel-s-system/system-business-organization/src/main/java/cn/stylefeng/roses/kernel/system/modular/organization/service/impl/HrOrganizationServiceImpl.java @@ -499,6 +499,16 @@ public class HrOrganizationServiceImpl extends ServiceImpl orgIdLimit = hrOrganizationRequest.getOrgIdLimit(); + if (ObjectUtil.isNotEmpty(orgIdLimit)) { + queryWrapper.nested(qw -> { + for (Long itemOrgId : orgIdLimit) { + qw.or().like(HrOrganization::getOrgPids, itemOrgId); + } + }); + } + return queryWrapper; }