fix: 立项变更驳回后再次提交报错BUG

This commit is contained in:
2023-10-30 17:08:54 +08:00
parent ae48c88406
commit e3414dc946
@@ -191,6 +191,7 @@ public class ProcessEsInitChangeServiceImpl extends ServiceImpl<ProcessEsInitCha
public void approvalInitChange(InitChangeDataVO initChangeDataVO, boolean pass) {
String userId = UserUtils.getUserId();
CommonVO commonVO = initChangeDataVO.getCommonVO();
List<ProcessEsInitChange> initChangeList = initChangeDataVO.getDataList();
String taskId = commonVO.getTaskId();
if (StrUtil.isBlank(taskId) && !actFlowCommonService.taskExists(taskId)) {
throw new JeroBootException("taskId为空或任务不存在");
@@ -198,11 +199,10 @@ public class ProcessEsInitChangeServiceImpl extends ServiceImpl<ProcessEsInitCha
String processInstanceId = actFlowCommonService.getProcessInstanceIdByTaskId(taskId);
String processDefinitionId = actFlowCommonService.getProcessDefId(processInstanceId);
if (pass) {
InitChangeFlowUserVO flowUserInfoVO = initChangeDataVO.getFlowUserInfoVO();
if (flowUserInfoVO != null) {
Map<String, Object> userMap = new HashMap<>(this.setUserVariables(flowUserInfoVO));
processNodeLinkService.saveNodeUserLink(processDefinitionId, processInstanceId, userMap);
Map<String, Object> variables = setUserVariables(flowUserInfoVO);
if (initChangeList != null) {
saveOrUpdateBatch(initChangeList);
Map<String, Object> variables = this.setVariables(initChangeDataVO);
processNodeLinkService.saveNodeUserLink(processDefinitionId, processInstanceId, this.getUserMap(variables));
actFlowCommonService.setProcessVariables(processInstanceId, variables);
}
runtimeService.setVariable(processInstanceId, "pass", true);