add - 新增取消流程实例的接口
This commit is contained in:
parent
e01c3d4d6d
commit
0cb09a5316
@ -24,15 +24,12 @@ public interface BpmProcessInstanceService {
|
||||
/**
|
||||
* 取消流程实例
|
||||
*
|
||||
* @return
|
||||
* @return true or false, true mean's cancelled
|
||||
*/
|
||||
Boolean cancelProcessInstance(BpmProcessInstanceCancelDTO processInstanceCancelDTO);
|
||||
|
||||
/**
|
||||
* 我发起的审批列表
|
||||
* */
|
||||
/**
|
||||
* 获得流程实例的分页
|
||||
* 获得流程实例的分页 / 我发起的审批列表
|
||||
*
|
||||
* @param pageReqVO 分页请求
|
||||
* @return 流程实例的分页
|
||||
|
||||
@ -28,6 +28,7 @@ import org.flowable.common.engine.impl.identity.Authentication;
|
||||
import org.flowable.engine.*;
|
||||
import org.flowable.engine.delegate.event.FlowableCancelledEvent;
|
||||
import org.flowable.engine.history.HistoricProcessInstance;
|
||||
import org.flowable.engine.history.HistoricProcessInstanceQuery;
|
||||
import org.flowable.engine.repository.ProcessDefinition;
|
||||
import org.flowable.engine.runtime.ProcessInstance;
|
||||
import org.flowable.engine.runtime.ProcessInstanceQuery;
|
||||
@ -205,16 +206,21 @@ public class BpmProcessInstanceServiceImpl implements BpmProcessInstanceService
|
||||
|
||||
@Override
|
||||
public HistoricProcessInstance getHistoricProcessInstance(String id, String tenantId) {
|
||||
return historyService.createHistoricProcessInstanceQuery().processInstanceId(id)
|
||||
.processInstanceTenantId(tenantId)
|
||||
.singleResult();
|
||||
HistoricProcessInstanceQuery query = historyService.createHistoricProcessInstanceQuery().processInstanceId(id);
|
||||
if (StringUtils.isNotBlank(tenantId)) {
|
||||
query.processInstanceTenantId(tenantId);
|
||||
}
|
||||
return query.singleResult();
|
||||
}
|
||||
|
||||
|
||||
public HistoricProcessInstance getHistoricProcessInstanceByBusinessKey(String businessKey, String tenantId) {
|
||||
return historyService.createHistoricProcessInstanceQuery().processInstanceBusinessKey(businessKey)
|
||||
.processInstanceTenantId(tenantId)
|
||||
.singleResult();
|
||||
HistoricProcessInstanceQuery query =
|
||||
historyService.createHistoricProcessInstanceQuery().processInstanceBusinessKey(businessKey);
|
||||
if (StringUtils.isNotBlank(tenantId)) {
|
||||
query.processInstanceTenantId(tenantId);
|
||||
}
|
||||
return query.singleResult();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -15,7 +15,7 @@ import org.springframework.stereotype.Component;
|
||||
* @author wangli
|
||||
* @since 2023/7/10 18:22
|
||||
*/
|
||||
@Profile("local")
|
||||
@Profile({"local", "dev"})
|
||||
@Slf4j
|
||||
@Component
|
||||
public class CustomBpmProcessEventListener implements BpmProcessEventListener {
|
||||
|
||||
@ -11,7 +11,7 @@ import org.springframework.stereotype.Component;
|
||||
* @author wangli
|
||||
* @since 2023/7/10 18:22
|
||||
*/
|
||||
@Profile("local")
|
||||
@Profile({"local", "dev"})
|
||||
@Component
|
||||
public class CustomBpmTaskEventListener implements BpmTaskEventListener {
|
||||
@Override
|
||||
|
||||
@ -45,6 +45,7 @@ public class BpmProcessInstanceController {
|
||||
return CommonResponse.success(result);
|
||||
}
|
||||
|
||||
@DeleteMapping("/cancel")
|
||||
public CommonResponse<Boolean> cancelProcessInstant(@Valid @RequestBody BpmProcessInstanceCancelDTO dto) {
|
||||
log.info("取消审核cancelProcessInstant===>>>参数:{}", JSON.toJSONString(dto));
|
||||
return CommonResponse.success(bpmProcessInstanceService.cancelProcessInstance(dto));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user