【8.0】【org】编辑公司删除缓存,修复event发布器的问题

pull/57/head
fengshuonan 2023-07-14 18:56:41 +08:00
parent 5983c18767
commit 3332890113
3 changed files with 8 additions and 9 deletions

View File

@ -56,7 +56,7 @@ public class BusinessEventPublisher {
// 如果方法的参数数量为0则直接调用如果不为0则跳过执行下个 // 如果方法的参数数量为0则直接调用如果不为0则跳过执行下个
if (parameterClassType == null) { if (parameterClassType == null) {
try { try {
listenerMethod.invoke(businessObject); listenerMethod.invoke(bean);
} catch (IllegalAccessException | InvocationTargetException e) { } catch (IllegalAccessException | InvocationTargetException e) {
log.error("方法调用失败,反射调用异常", e); log.error("方法调用失败,反射调用异常", e);
throw new ServiceException(EventExceptionEnum.ERROR_INVOKE); throw new ServiceException(EventExceptionEnum.ERROR_INVOKE);

View File

@ -47,13 +47,12 @@ public class OrgOperateListener {
* @since 2023/7/14 18:40 * @since 2023/7/14 18:40
*/ */
@BusinessListener(businessCode = OrgConstants.EDIT_ORG_EVENT) @BusinessListener(businessCode = OrgConstants.EDIT_ORG_EVENT)
public void editOrgCallback(HrOrganization businessObject) { public void editOrgCallback() {
if (ObjectUtil.isNotEmpty(businessObject.getOrgId())) { // 获取所有主键
sysOrgSubFlagCache.remove(String.valueOf(businessObject.getOrgId())); Collection<String> allKeys = sysOrgSubFlagCache.getAllKeys();
}
if (ObjectUtil.isNotEmpty(businessObject.getOrgParentId())) { // 删除所有子集标识
sysOrgSubFlagCache.remove(String.valueOf(businessObject.getOrgParentId())); sysOrgSubFlagCache.remove(allKeys);
}
} }
/** /**

View File

@ -129,7 +129,7 @@ public class HrOrganizationServiceImpl extends ServiceImpl<HrOrganizationMapper,
this.updateById(hrOrganization); this.updateById(hrOrganization);
// 发布编辑机构事件 // 发布编辑机构事件
BusinessEventPublisher.publishEvent(OrgConstants.EDIT_ORG_EVENT, hrOrganization); BusinessEventPublisher.publishEvent(OrgConstants.EDIT_ORG_EVENT, null);
} }