【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则跳过执行下个
if (parameterClassType == null) {
try {
listenerMethod.invoke(businessObject);
listenerMethod.invoke(bean);
} catch (IllegalAccessException | InvocationTargetException e) {
log.error("方法调用失败,反射调用异常", e);
throw new ServiceException(EventExceptionEnum.ERROR_INVOKE);

View File

@ -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<String> allKeys = sysOrgSubFlagCache.getAllKeys();
// 删除所有子集标识
sysOrgSubFlagCache.remove(allKeys);
}
/**

View File

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