From 33328901139fa30c9aaab18243a8d820e49d2b1a Mon Sep 17 00:00:00 2001 From: fengshuonan Date: Fri, 14 Jul 2023 18:56:41 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=908.0=E3=80=91=E3=80=90org=E3=80=91?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=85=AC=E5=8F=B8=E5=88=A0=E9=99=A4=E7=BC=93?= =?UTF-8?q?=E5=AD=98=EF=BC=8C=E4=BF=AE=E5=A4=8Devent=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E5=99=A8=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../event/sdk/publish/BusinessEventPublisher.java | 2 +- .../modular/org/listener/OrgOperateListener.java | 13 ++++++------- .../org/service/impl/HrOrganizationServiceImpl.java | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/kernel-d-event/event-sdk/src/main/java/cn/stylefeng/roses/kernel/event/sdk/publish/BusinessEventPublisher.java b/kernel-d-event/event-sdk/src/main/java/cn/stylefeng/roses/kernel/event/sdk/publish/BusinessEventPublisher.java index f0c9c6078..6a32b2dd1 100644 --- a/kernel-d-event/event-sdk/src/main/java/cn/stylefeng/roses/kernel/event/sdk/publish/BusinessEventPublisher.java +++ b/kernel-d-event/event-sdk/src/main/java/cn/stylefeng/roses/kernel/event/sdk/publish/BusinessEventPublisher.java @@ -56,7 +56,7 @@ public class BusinessEventPublisher { // 如果方法的参数数量为0,则直接调用,如果不为0,则跳过执行下个 if (parameterClassType == null) { try { - listenerMethod.invoke(businessObject); + listenerMethod.invoke(bean); } catch (IllegalAccessException | InvocationTargetException e) { log.error("方法调用失败,反射调用异常", e); throw new ServiceException(EventExceptionEnum.ERROR_INVOKE); diff --git a/kernel-s-system/system-business-hr/src/main/java/cn/stylefeng/roses/kernel/sys/modular/org/listener/OrgOperateListener.java b/kernel-s-system/system-business-hr/src/main/java/cn/stylefeng/roses/kernel/sys/modular/org/listener/OrgOperateListener.java index c88603423..4b210916d 100644 --- a/kernel-s-system/system-business-hr/src/main/java/cn/stylefeng/roses/kernel/sys/modular/org/listener/OrgOperateListener.java +++ b/kernel-s-system/system-business-hr/src/main/java/cn/stylefeng/roses/kernel/sys/modular/org/listener/OrgOperateListener.java @@ -47,13 +47,12 @@ public class OrgOperateListener { * @since 2023/7/14 18:40 */ @BusinessListener(businessCode = OrgConstants.EDIT_ORG_EVENT) - public void editOrgCallback(HrOrganization businessObject) { - if (ObjectUtil.isNotEmpty(businessObject.getOrgId())) { - sysOrgSubFlagCache.remove(String.valueOf(businessObject.getOrgId())); - } - if (ObjectUtil.isNotEmpty(businessObject.getOrgParentId())) { - sysOrgSubFlagCache.remove(String.valueOf(businessObject.getOrgParentId())); - } + public void editOrgCallback() { + // 获取所有主键 + Collection allKeys = sysOrgSubFlagCache.getAllKeys(); + + // 删除所有子集标识 + sysOrgSubFlagCache.remove(allKeys); } /** diff --git a/kernel-s-system/system-business-hr/src/main/java/cn/stylefeng/roses/kernel/sys/modular/org/service/impl/HrOrganizationServiceImpl.java b/kernel-s-system/system-business-hr/src/main/java/cn/stylefeng/roses/kernel/sys/modular/org/service/impl/HrOrganizationServiceImpl.java index 9ddd62da7..0b8cc29d6 100644 --- a/kernel-s-system/system-business-hr/src/main/java/cn/stylefeng/roses/kernel/sys/modular/org/service/impl/HrOrganizationServiceImpl.java +++ b/kernel-s-system/system-business-hr/src/main/java/cn/stylefeng/roses/kernel/sys/modular/org/service/impl/HrOrganizationServiceImpl.java @@ -129,7 +129,7 @@ public class HrOrganizationServiceImpl extends ServiceImpl