fix: 企标变更流程责任部门变更报错

This commit is contained in:
2023-10-31 18:20:30 +08:00
parent cc116eb4f1
commit b026e643f1
@@ -194,6 +194,7 @@ public class ProcessEsInitChangeServiceImpl extends ServiceImpl<ProcessEsInitCha
String userId = UserUtils.getUserId();
CommonVO commonVO = initChangeDataVO.getCommonVO();
List<ProcessEsInitChange> initChangeList = initChangeDataVO.getDataList();
InitChangeFlowUserVO flowUserInfoVO = initChangeDataVO.getFlowUserInfoVO();
String taskId = commonVO.getTaskId();
if (StrUtil.isBlank(taskId) && !actFlowCommonService.taskExists(taskId)) {
throw new JeroBootException("taskId为空或任务不存在");
@@ -201,12 +202,17 @@ public class ProcessEsInitChangeServiceImpl extends ServiceImpl<ProcessEsInitCha
String processInstanceId = actFlowCommonService.getProcessInstanceIdByTaskId(taskId);
String processDefinitionId = actFlowCommonService.getProcessDefId(processInstanceId);
if (pass) {
if (initChangeList != null) {
if (initChangeList != null && flowUserInfoVO != null) {
saveOrUpdateBatch(initChangeList);
Map<String, Object> variables = this.setVariables(initChangeDataVO);
processNodeLinkService.saveNodeUserLink(processDefinitionId, processInstanceId, this.getUserMap(variables));
actFlowCommonService.setProcessVariables(processInstanceId, variables);
}
if (flowUserInfoVO != null) {
Map<String, Object> variables = this.setVariables(initChangeDataVO);
processNodeLinkService.saveNodeUserLink(processDefinitionId, processInstanceId, this.getUserMap(variables));
actFlowCommonService.setProcessVariables(processInstanceId, variables);
}
runtimeService.setVariable(processInstanceId, "pass", true);
} else {
// 设置流程变量