Merge remote-tracking branch 'yudao/develop' into develop
# Conflicts: # yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/contract/CrmContractServiceImpl.javaplp
commit
eddd0a8801
@ -1,27 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.bpm.api.listener;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.module.bpm.api.listener.dto.BpmResultListenerRespDTO;
|
|
||||||
|
|
||||||
// TODO @芋艿:后续改成支持 RPC
|
|
||||||
/**
|
|
||||||
* 业务流程实例的结果发生变化的监听器 Api
|
|
||||||
*
|
|
||||||
* @author HUIHUI
|
|
||||||
*/
|
|
||||||
public interface BpmResultListenerApi {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 监听的流程定义 Key
|
|
||||||
*
|
|
||||||
* @return 返回监听的流程定义 Key
|
|
||||||
*/
|
|
||||||
String getProcessDefinitionKey();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 处理事件
|
|
||||||
*
|
|
||||||
* @param event 事件
|
|
||||||
*/
|
|
||||||
void onEvent(BpmResultListenerRespDTO event);
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,4 +1,4 @@
|
|||||||
package cn.iocoder.yudao.module.bpm.framework.bpm.core.event;
|
package cn.iocoder.yudao.module.bpm.event;
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import org.springframework.context.ApplicationListener;
|
import org.springframework.context.ApplicationListener;
|
||||||
@ -1,36 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.bpm.framework.bpm.listener;
|
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
||||||
import cn.iocoder.yudao.module.bpm.api.listener.BpmResultListenerApi;
|
|
||||||
import cn.iocoder.yudao.module.bpm.api.listener.dto.BpmResultListenerRespDTO;
|
|
||||||
import cn.iocoder.yudao.module.bpm.framework.bpm.core.event.BpmProcessInstanceResultEvent;
|
|
||||||
import jakarta.annotation.Resource;
|
|
||||||
import org.springframework.context.ApplicationListener;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
// TODO @芋艿:后续改成支持 RPC
|
|
||||||
/**
|
|
||||||
* 业务流程结果监听器实现类
|
|
||||||
*
|
|
||||||
* @author HUIHUI
|
|
||||||
*/
|
|
||||||
@Component
|
|
||||||
public class BpmServiceResultListener implements ApplicationListener<BpmProcessInstanceResultEvent> {
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private List<BpmResultListenerApi> bpmResultListenerApis;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public final void onApplicationEvent(BpmProcessInstanceResultEvent event) {
|
|
||||||
bpmResultListenerApis.forEach(bpmResultListenerApi -> {
|
|
||||||
if (!StrUtil.equals(event.getProcessDefinitionKey(), bpmResultListenerApi.getProcessDefinitionKey())) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
bpmResultListenerApi.onEvent(BeanUtils.toBean(event, BpmResultListenerRespDTO.class));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue