mirror of https://gitee.com/stylefeng/roses
【8.0】【org】编辑公司删除缓存,修复event发布器的问题
parent
5983c18767
commit
3332890113
|
@ -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);
|
||||||
|
|
|
@ -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);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -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);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue