修改流程结束后,同一人同时处理多个指向同一个流程的业务表单时出错的问题
Some checks are pending
Java CI with Maven / build (11) (push) Waiting to run
Java CI with Maven / build (17) (push) Waiting to run
Java CI with Maven / build (8) (push) Waiting to run
yudao-ui-admin CI / build (14.x) (push) Waiting to run
yudao-ui-admin CI / build (16.x) (push) Waiting to run
Some checks are pending
Java CI with Maven / build (11) (push) Waiting to run
Java CI with Maven / build (17) (push) Waiting to run
Java CI with Maven / build (8) (push) Waiting to run
yudao-ui-admin CI / build (14.x) (push) Waiting to run
yudao-ui-admin CI / build (16.x) (push) Waiting to run
This commit is contained in:
parent
3cc7b76996
commit
8f93e5fd11
@ -13,7 +13,10 @@ public abstract class BpmProcessInstanceStatusEventListener
|
||||
|
||||
@Override
|
||||
public final void onApplicationEvent(BpmProcessInstanceStatusEvent event) {
|
||||
if (!StrUtil.equals(event.getProcessDefinitionKey(), getProcessDefinitionKey())) {
|
||||
// if (!StrUtil.equals(event.getProcessDefinitionKey(), getProcessDefinitionKey())) {
|
||||
// return;
|
||||
// }
|
||||
if (!StrUtil.equals(event.getId(), getProcessInstanceId())) {
|
||||
return;
|
||||
}
|
||||
onEvent(event);
|
||||
@ -23,7 +26,10 @@ public abstract class BpmProcessInstanceStatusEventListener
|
||||
* @return 返回监听的流程定义 Key
|
||||
*/
|
||||
protected abstract String getProcessDefinitionKey();
|
||||
|
||||
/**
|
||||
* @return 返回监听的流程定义id
|
||||
*/
|
||||
protected abstract String getProcessInstanceId();
|
||||
/**
|
||||
* 处理事件
|
||||
*
|
||||
|
@ -34,9 +34,7 @@ public class BpmOALeaveServiceImpl implements BpmOALeaveService {
|
||||
/**
|
||||
* OA 请假对应的流程定义 KEY
|
||||
*/
|
||||
// public static final String PROCESS_KEY = "oa_leave";
|
||||
//my-test-flow02'
|
||||
public static final String PROCESS_KEY = "my-test-flow02";
|
||||
public static final String PROCESS_KEY = "pch-qjgl-001";
|
||||
|
||||
@Resource
|
||||
private BpmOALeaveMapper leaveMapper;
|
||||
|
@ -31,9 +31,8 @@ import static cn.iocoder.yudao.module.home.enums.ErrorCodeConstants.*;
|
||||
@Service
|
||||
@Validated
|
||||
public class HyglServiceImpl implements HyglService {
|
||||
// public static final String PROCESS_KEY = "hygl-001";
|
||||
public static String PROCESS_KEY = "";
|
||||
|
||||
public static String processInstanceId = "";
|
||||
@Resource
|
||||
private HyglMapper hyglMapper;
|
||||
@Resource
|
||||
@ -60,7 +59,7 @@ public class HyglServiceImpl implements HyglService {
|
||||
|
||||
// 发起 BPM 流程
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||
String processInstanceId = processInstanceApi.createProcessInstance(userId,
|
||||
processInstanceId = processInstanceApi.createProcessInstance(userId,
|
||||
new BpmProcessInstanceCreateReqDTO().setProcessDefinitionKey(PROCESS_KEY)
|
||||
.setVariables(processInstanceVariables).setBusinessKey(String.valueOf(hygl.getId()))
|
||||
.setStartUserSelectAssignees(createReqVO.getStartUserSelectAssignees()));
|
||||
|
@ -4,6 +4,7 @@ import cn.iocoder.yudao.module.bpm.event.BpmProcessInstanceStatusEvent;
|
||||
import cn.iocoder.yudao.module.bpm.event.BpmProcessInstanceStatusEventListener;
|
||||
import cn.iocoder.yudao.module.home.service.hygl.HyglService;
|
||||
import cn.iocoder.yudao.module.home.service.hygl.HyglServiceImpl;
|
||||
import cn.iocoder.yudao.module.home.service.kqgl.KqglServiceImpl;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@ -18,6 +19,10 @@ public class BpmHyglStatusListener extends BpmProcessInstanceStatusEventListener
|
||||
return HyglServiceImpl.PROCESS_KEY;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getProcessInstanceId(){
|
||||
return KqglServiceImpl.processInstanceId;
|
||||
}
|
||||
@Override
|
||||
protected void onEvent(BpmProcessInstanceStatusEvent event) {
|
||||
hyglService.updateHyglStatus(Long.parseLong(event.getBusinessKey()), event.getStatus());
|
||||
|
@ -33,7 +33,7 @@ import static cn.iocoder.yudao.module.home.enums.ErrorCodeConstants.*;
|
||||
public class JbglServiceImpl implements JbglService {
|
||||
// public static final String PROCESS_KEY = "jbgl-001";
|
||||
public static String PROCESS_KEY = "";
|
||||
|
||||
public static String processInstanceId = "";
|
||||
@Resource
|
||||
private JbglMapper jbglMapper;
|
||||
@Resource
|
||||
@ -60,7 +60,7 @@ public class JbglServiceImpl implements JbglService {
|
||||
|
||||
// 发起 BPM 流程
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||
String processInstanceId = processInstanceApi.createProcessInstance(userId,
|
||||
processInstanceId = processInstanceApi.createProcessInstance(userId,
|
||||
new BpmProcessInstanceCreateReqDTO().setProcessDefinitionKey(PROCESS_KEY)
|
||||
.setVariables(processInstanceVariables).setBusinessKey(String.valueOf(jbgl.getId()))
|
||||
.setStartUserSelectAssignees(createReqVO.getStartUserSelectAssignees()));
|
||||
|
@ -7,6 +7,7 @@ import cn.iocoder.yudao.module.home.service.clgl.ClglService;
|
||||
import cn.iocoder.yudao.module.home.service.clgl.ClglServiceImpl;
|
||||
import cn.iocoder.yudao.module.home.service.jbgl.JbglService;
|
||||
import cn.iocoder.yudao.module.home.service.jbgl.JbglServiceImpl;
|
||||
import cn.iocoder.yudao.module.home.service.kqgl.KqglServiceImpl;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@ -22,6 +23,10 @@ public class BpmJbglStatusListener extends BpmProcessInstanceStatusEventListener
|
||||
return JbglServiceImpl.PROCESS_KEY;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getProcessInstanceId(){
|
||||
return KqglServiceImpl.processInstanceId;
|
||||
}
|
||||
@Override
|
||||
protected void onEvent(BpmProcessInstanceStatusEvent event) {
|
||||
jbglService.updateJbglStatus(Long.parseLong(event.getBusinessKey()), event.getStatus());
|
||||
|
@ -33,7 +33,7 @@ import static cn.iocoder.yudao.module.home.enums.ErrorCodeConstants.*;
|
||||
public class KqglServiceImpl implements KqglService {
|
||||
// public static final String PROCESS_KEY = "kqgl-001";
|
||||
public static String PROCESS_KEY = "";
|
||||
|
||||
public static String processInstanceId = "";
|
||||
@Resource
|
||||
private KqglMapper kqglMapper;
|
||||
@Resource
|
||||
@ -49,7 +49,7 @@ public class KqglServiceImpl implements KqglService {
|
||||
.setUserId(userId).setStatus(BpmTaskStatusEnum.RUNNING.getStatus());
|
||||
kqglMapper.insert(kqgl);
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||
String processInstanceId = processInstanceApi.createProcessInstance(userId,
|
||||
processInstanceId = processInstanceApi.createProcessInstance(userId,
|
||||
new BpmProcessInstanceCreateReqDTO().setProcessDefinitionKey(PROCESS_KEY)
|
||||
.setVariables(processInstanceVariables).setBusinessKey(String.valueOf(kqgl.getId()))
|
||||
.setStartUserSelectAssignees(createReqVO.getStartUserSelectAssignees()));
|
||||
|
@ -19,6 +19,10 @@ public class BpmKqglStatusListener extends BpmProcessInstanceStatusEventListener
|
||||
return KqglServiceImpl.PROCESS_KEY;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getProcessInstanceId(){
|
||||
return KqglServiceImpl.processInstanceId;
|
||||
}
|
||||
@Override
|
||||
protected void onEvent(BpmProcessInstanceStatusEvent event) {
|
||||
kqglService.updateClglStatus(Long.parseLong(event.getBusinessKey()), event.getStatus());
|
||||
|
Loading…
Reference in New Issue
Block a user