mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-24 16:05:08 +08:00
✨ CRM:完善合同的审批逻辑
This commit is contained in:
@ -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,32 +0,0 @@
|
||||
package cn.iocoder.yudao.module.bpm.api.listener.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
// TODO @芋艿:后续改成支持 RPC
|
||||
/**
|
||||
* 业务流程实例的结果 Response DTO
|
||||
*
|
||||
* @author HUIHUI
|
||||
*/
|
||||
@Data
|
||||
public class BpmResultListenerRespDTO {
|
||||
|
||||
/**
|
||||
* 流程实例的编号
|
||||
*/
|
||||
private String id;
|
||||
/**
|
||||
* 流程实例的 key
|
||||
*/
|
||||
private String processDefinitionKey;
|
||||
/**
|
||||
* 流程实例的结果
|
||||
*/
|
||||
private Integer result;
|
||||
/**
|
||||
* 流程实例对应的业务标识
|
||||
* 例如说,请假
|
||||
*/
|
||||
private String businessKey;
|
||||
|
||||
}
|
@ -1,10 +1,8 @@
|
||||
package cn.iocoder.yudao.module.bpm.framework.bpm.core.event;
|
||||
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.task.BpmProcessInstanceExtDO;
|
||||
import lombok.Data;
|
||||
import org.springframework.context.ApplicationEvent;
|
||||
package cn.iocoder.yudao.module.bpm.event;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import org.springframework.context.ApplicationEvent;
|
||||
|
||||
/**
|
||||
* 流程实例的结果发生变化的 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 org.springframework.context.ApplicationListener;
|
@ -7,7 +7,7 @@ import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance.BpmProcessI
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance.BpmProcessInstanceRespVO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmProcessDefinitionExtDO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.task.BpmProcessInstanceExtDO;
|
||||
import cn.iocoder.yudao.module.bpm.framework.bpm.core.event.BpmProcessInstanceResultEvent;
|
||||
import cn.iocoder.yudao.module.bpm.event.BpmProcessInstanceResultEvent;
|
||||
import cn.iocoder.yudao.module.bpm.service.message.dto.BpmMessageSendWhenProcessInstanceApproveReqDTO;
|
||||
import cn.iocoder.yudao.module.bpm.service.message.dto.BpmMessageSendWhenProcessInstanceRejectReqDTO;
|
||||
import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
|
||||
|
@ -1,5 +1,6 @@
|
||||
package cn.iocoder.yudao.module.bpm.framework.bpm.core.event;
|
||||
|
||||
import cn.iocoder.yudao.module.bpm.event.BpmProcessInstanceResultEvent;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.context.ApplicationEventPublisher;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
@ -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));
|
||||
});
|
||||
}
|
||||
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
package cn.iocoder.yudao.module.bpm.service.oa.listener;
|
||||
|
||||
import cn.iocoder.yudao.module.bpm.framework.bpm.core.event.BpmProcessInstanceResultEvent;
|
||||
import cn.iocoder.yudao.module.bpm.framework.bpm.core.event.BpmProcessInstanceResultEventListener;
|
||||
import cn.iocoder.yudao.module.bpm.event.BpmProcessInstanceResultEvent;
|
||||
import cn.iocoder.yudao.module.bpm.event.BpmProcessInstanceResultEventListener;
|
||||
import cn.iocoder.yudao.module.bpm.service.oa.BpmOALeaveService;
|
||||
import cn.iocoder.yudao.module.bpm.service.oa.BpmOALeaveServiceImpl;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
Reference in New Issue
Block a user