feat: 主动上报流程人员回显
This commit is contained in:
+12
@@ -155,12 +155,16 @@ public class ProcessEsAnnualReportServiceImpl extends ServiceImpl<ProcessEsAnnua
|
||||
Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
|
||||
String taskName = task.getName();
|
||||
String processInstanceId = actFlowCommonService.getProcessInstanceIdByTaskId(taskId);
|
||||
// 获取流程实例
|
||||
ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult();
|
||||
String processDefinitionId = processInstance.getProcessDefinitionId();
|
||||
ProcessEsAnnualReport annualReport;
|
||||
String executionId = task.getExecutionId();
|
||||
String contactUser = (String) runtimeService.getVariable(executionId, "contactUser");
|
||||
String workGroupUser = (String) runtimeService.getVariable(executionId, "workGroupUser");
|
||||
String contactUserLeaderLeader;
|
||||
LambdaQueryWrapper<ProcessEsAnnualReport> wrapper = new LambdaQueryWrapper<>();
|
||||
Map<String, Object> userVariable = new HashMap<>();
|
||||
switch (taskName) {
|
||||
case CONTACT_USER_DISTRIBUTE:
|
||||
annualReport = annualReportDataVO.getDataList().get(0);
|
||||
@@ -176,6 +180,8 @@ public class ProcessEsAnnualReportServiceImpl extends ServiceImpl<ProcessEsAnnua
|
||||
taskService.setVariable(taskId, "workGroupUserList", workGroupUserList);
|
||||
// 将联络人主管级上一级领导保存到流程变量中
|
||||
taskService.setVariable(taskId, contactUser + "-ContactUserLeaderLeader", contactUserLeaderLeader);
|
||||
userVariable.put("workGroupUserList", workGroupUsers);
|
||||
userVariable.put("contactUser", contactUser);
|
||||
} else {
|
||||
// 保存联络人主管级上级领导
|
||||
dataList.forEach(data -> data.setContactUserLeaderLeader(contactUserLeaderLeader));
|
||||
@@ -186,6 +192,8 @@ public class ProcessEsAnnualReportServiceImpl extends ServiceImpl<ProcessEsAnnua
|
||||
saveBatch(dataList);
|
||||
taskService.setVariable(taskId, "contactUserLeaderLeader", contactUserLeaderLeader);
|
||||
}
|
||||
userVariable.put("contactUserLeaderLeader", contactUserLeaderLeader);
|
||||
processNodeLinkService.incrementSaveNodeUserLink(processDefinitionId, processInstanceId, userVariable);
|
||||
break;
|
||||
case WORK_GROUP_COLLECT:
|
||||
// 先删后增
|
||||
@@ -206,6 +214,8 @@ public class ProcessEsAnnualReportServiceImpl extends ServiceImpl<ProcessEsAnnua
|
||||
saveBatch(dataList);
|
||||
// 设置下一个节点的审批人流程变量
|
||||
taskService.setVariable(taskId, "collectUserLeader", collectUserLeader);
|
||||
userVariable.put("collectUserLeader", collectUserLeader);
|
||||
processNodeLinkService.incrementSaveNodeUserLink(processDefinitionId, processInstanceId, userVariable);
|
||||
break;
|
||||
case CONTACT_USER_COLLECT:
|
||||
// 先删后增
|
||||
@@ -218,6 +228,8 @@ public class ProcessEsAnnualReportServiceImpl extends ServiceImpl<ProcessEsAnnua
|
||||
dataList.forEach(data -> data.setProcessInstanceId(processInstanceId));
|
||||
dataList.forEach(data -> data.setContactUserLeaderLeader(contactUserLeaderLeader));
|
||||
taskService.setVariable(taskId, "contactUserLeaderLeader", contactUserLeaderLeader);
|
||||
userVariable.put("contactUserLeaderLeader", contactUserLeaderLeader);
|
||||
processNodeLinkService.incrementSaveNodeUserLink(processDefinitionId, processInstanceId, userVariable);
|
||||
saveBatch(dataList);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user